From 375c89e69543913377794d8771baed508edfeb26 Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Tue, 23 Jul 2024 14:28:31 +0200 Subject: [PATCH 01/50] Updated to 1.2.42+git --- VERSION | 2 +- go.sum | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f3014908e..0dfda79db 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.42 \ No newline at end of file +1.2.42+git \ No newline at end of file diff --git a/go.sum b/go.sum index d6c25ef6d..290a1d0c4 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,9 @@ +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= +github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680 h1:5YCGq0gkf/sCEkDFIsMBPj59GOm5cMibGqDBH2OWWfQ= github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680/go.mod h1:xDyzBwyYzcEhsaDXtmxCNM4p5BrtuoVYYsRTuJqmCeg= github.com/arangodb-helper/go-helper v0.4.2 h1:Ekf8EtPYQdhlwtqJAEn17i7zbtuavksWamasxcyOGWQ= @@ -14,8 +20,10 @@ github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2 github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -23,14 +31,19 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEe github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -40,10 +53,15 @@ github.com/dchest/siphash v1.2.2 h1:9DFz8tQwl9pTVt5iok/9zKyzA1Q6bRGiF3HPiEEVr9I= github.com/dchest/siphash v1.2.2/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9 h1:74lLNRzvsdIlkTgfDSMuaPjBr4cf6k7pwQQANm/yLKU= github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9/go.mod h1:GgB8SF9nRG+GqaDtLcwJZsQFhcogVCJ79j4EdT0c2V4= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= 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.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= 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/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= @@ -52,9 +70,13 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 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-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 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/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= @@ -79,6 +101,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -86,6 +110,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/cel-go v0.17.7/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= 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.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -102,16 +128,23 @@ github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15 h1:cW/amwGEJK5MSKntPXRjX4dxs/nGxGT8gXKIsKFmHGc= github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15/go.mod h1:Fdm/oWRW+CH8PRbLntksCNtmcCBximKPkVQYvmMl80k= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josephburnett/jd v1.6.1 h1:Uzqhcje4WqvVyp85F3Oj0ezISPTlnhnr/KaLZIy8qh0= github.com/josephburnett/jd v1.6.1/go.mod h1:R8ZnZnLt2D4rhW4NvBc/USTo6mzyNT6fYNIIWOJA9GY= 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/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= 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/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= @@ -149,6 +182,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 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/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= @@ -159,6 +193,7 @@ github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible h1:Jd6xfriVlJ6hWPvYO github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible/go.mod h1:xlUlxe/2ItGlQyMTstqeDv9r3U4obH7xYd26TbDQutY= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -187,21 +222,49 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.19.0 h1:hYz4ZVdUgjXTBUmrkrw55j1nHx68LfOKIQk5IYtyScg= github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= +go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= +go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= +go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= +go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs= +go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc= +go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0/go.mod h1:5z+/ZWJQKXa9YT34fQNx5K8Hd1EoIhvtUygUQPqEOgQ= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -211,9 +274,11 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20230125214544-b3c2aaf6208d/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -266,8 +331,12 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= @@ -281,6 +350,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= 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= @@ -292,15 +362,20 @@ k8s.io/apiextensions-apiserver v0.29.6 h1:tUu1N6Zt9GT8KVcPF5aGDqfISz1mveM4yFh7eL k8s.io/apiextensions-apiserver v0.29.6/go.mod h1:iw1EbwZat08I219qrQKoFMHGo7J9KxPqMpVKxCbNbCs= k8s.io/apimachinery v0.29.6 h1:CLjJ5b0hWW7531n/njRE3rnusw3rhVGCFftPfnG54CI= k8s.io/apimachinery v0.29.6/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= +k8s.io/apiserver v0.29.6/go.mod h1:HrQwfPWxhwEa+n8/+5YwSF5yT2WXbeyFjqq6KEXHTX8= k8s.io/client-go v0.29.6 h1:5E2ebuB/p0F0THuQatyvhDvPL2SIeqwTPrtnrwKob/8= k8s.io/client-go v0.29.6/go.mod h1:jHZcrQqDplyv20v7eu+iFM4gTpglZSZoMVcKrh8sRGg= +k8s.io/component-base v0.29.6/go.mod h1:kIahZm8aw9lV8Vw17LF89REmeBrv5+QEl3v7HsrmITY= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kms v0.29.6/go.mod h1:vWVImKkJd+1BQY4tBwdfSwjQBiLrnbNtHADcDEDQFtk= k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a h1:ZeIPbyHHqahGIbeyLJJjAUhnxCKqXaDY+n89Ms8szyA= k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= From ae55994d681f49f6343ac341cfdf46e315c003a7 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:32:36 +0200 Subject: [PATCH 02/50] [Feature] ArangoRoute CRD (#1689) --- .golangci.yaml | 2 + CHANGELOG.md | 1 + Makefile | 6 +- .../crds/networking-route.yaml | 22 ++ .../templates/deployment-operator/role.yaml | 3 + .../crds/networking-route.yaml | 22 ++ .../templates/deployment-operator/role.yaml | 3 + .../crds/networking-route.yaml | 22 ++ .../templates/deployment-operator/role.yaml | 3 + .../kube-arangodb/crds/networking-route.yaml | 22 ++ .../templates/deployment-operator/role.yaml | 3 + docs/api/ArangoRoute.V1Alpha1.md | 91 +++++++ internal/cr_validation_test.go | 10 + internal/docs_parser_test.go | 2 +- internal/docs_test.go | 14 + internal/schema_builder_test.go | 2 +- pkg/apis/networking/definitions.go | 29 +++ pkg/apis/networking/v1alpha1/doc.go | 23 ++ pkg/apis/networking/v1alpha1/register.go | 52 ++++ pkg/apis/networking/v1alpha1/route.go | 69 +++++ pkg/apis/networking/v1alpha1/route_spec.go | 50 ++++ .../v1alpha1/route_spec_destination.go | 50 ++++ .../v1alpha1/route_spec_destination_schema.go | 55 ++++ .../route_spec_destination_service.go | 49 ++++ .../v1alpha1/route_spec_destination_tls.go | 30 +++ .../networking/v1alpha1/route_spec_route.go | 52 ++++ pkg/apis/networking/v1alpha1/route_status.go | 29 +++ .../v1alpha1/zz_generated.deepcopy.go | 242 ++++++++++++++++++ pkg/apis/shared/validate.go | 59 ++++- pkg/apis/shared/validate_test.go | 13 +- pkg/crd/crds/crds.go | 3 + pkg/crd/crds/crds_test.go | 1 + pkg/crd/crds/networking-route.go | 51 ++++ .../networking-route.schema.generated.yaml | 55 ++++ pkg/crd/crds/networking-route.yaml | 22 ++ pkg/crd/networking.go | 40 +++ pkg/deployment/resources/inspector/ar.go | 192 ++++++++++++++ .../resources/inspector/ar_anonymous.go | 45 ++++ pkg/deployment/resources/inspector/ar_gvk.go | 43 ++++ pkg/deployment/resources/inspector/ar_mod.go | 47 ++++ .../resources/inspector/ar_v1alpha1.go | 138 ++++++++++ .../resources/inspector/inspector.go | 16 ++ .../resources/inspector/inspector_test.go | 6 +- .../resources/inspector/pdbs_version_test.go | 4 +- .../resources/inspector/throttles.go | 3 +- .../clientset/versioned/clientset.go | 13 + .../versioned/fake/clientset_generated.go | 7 + .../clientset/versioned/fake/register.go | 2 + .../clientset/versioned/scheme/register.go | 2 + .../typed/networking/v1alpha1/arangoroute.go | 199 ++++++++++++++ .../typed/networking/v1alpha1/doc.go | 24 ++ .../typed/networking/v1alpha1/fake/doc.go | 24 ++ .../v1alpha1/fake/fake_arangoroute.go | 145 +++++++++++ .../v1alpha1/fake/fake_networking_client.go | 44 ++++ .../v1alpha1/generated_expansion.go | 25 ++ .../networking/v1alpha1/networking_client.go | 111 ++++++++ .../informers/externalversions/factory.go | 6 + .../informers/externalversions/generic.go | 5 + .../externalversions/networking/interface.go | 50 ++++ .../networking/v1alpha1/arangoroute.go | 94 +++++++ .../networking/v1alpha1/interface.go | 49 ++++ .../networking/v1alpha1/arangoroute.go | 103 ++++++++ .../v1alpha1/expansion_generated.go | 31 +++ .../inspector/arangoroute/definition.go | 44 ++++ .../inspector/arangoroute/v1alpha1/loader.go | 53 ++++ .../inspector/arangoroute/v1alpha1/reader.go | 50 ++++ .../inspector/constants/ar_constants.go | 66 +++++ .../inspector/definitions/components.go | 4 +- pkg/util/k8sutil/inspector/inspector.go | 4 +- pkg/util/k8sutil/inspector/mods/mods.go | 8 +- .../k8sutil/inspector/throttle/throttle.go | 16 +- 71 files changed, 2850 insertions(+), 25 deletions(-) create mode 100644 chart/kube-arangodb-arm64/crds/networking-route.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/crds/networking-route.yaml create mode 100644 chart/kube-arangodb-enterprise/crds/networking-route.yaml create mode 100644 chart/kube-arangodb/crds/networking-route.yaml create mode 100644 docs/api/ArangoRoute.V1Alpha1.md create mode 100644 pkg/apis/networking/definitions.go create mode 100644 pkg/apis/networking/v1alpha1/doc.go create mode 100644 pkg/apis/networking/v1alpha1/register.go create mode 100644 pkg/apis/networking/v1alpha1/route.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_destination.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_destination_schema.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_destination_service.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_destination_tls.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_route.go create mode 100644 pkg/apis/networking/v1alpha1/route_status.go create mode 100644 pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go create mode 100644 pkg/crd/crds/networking-route.go create mode 100644 pkg/crd/crds/networking-route.schema.generated.yaml create mode 100644 pkg/crd/crds/networking-route.yaml create mode 100644 pkg/crd/networking.go create mode 100644 pkg/deployment/resources/inspector/ar.go create mode 100644 pkg/deployment/resources/inspector/ar_anonymous.go create mode 100644 pkg/deployment/resources/inspector/ar_gvk.go create mode 100644 pkg/deployment/resources/inspector/ar_mod.go create mode 100644 pkg/deployment/resources/inspector/ar_v1alpha1.go create mode 100644 pkg/generated/clientset/versioned/typed/networking/v1alpha1/arangoroute.go create mode 100644 pkg/generated/clientset/versioned/typed/networking/v1alpha1/doc.go create mode 100644 pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/doc.go create mode 100644 pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_arangoroute.go create mode 100644 pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_networking_client.go create mode 100644 pkg/generated/clientset/versioned/typed/networking/v1alpha1/generated_expansion.go create mode 100644 pkg/generated/clientset/versioned/typed/networking/v1alpha1/networking_client.go create mode 100644 pkg/generated/informers/externalversions/networking/interface.go create mode 100644 pkg/generated/informers/externalversions/networking/v1alpha1/arangoroute.go create mode 100644 pkg/generated/informers/externalversions/networking/v1alpha1/interface.go create mode 100644 pkg/generated/listers/networking/v1alpha1/arangoroute.go create mode 100644 pkg/generated/listers/networking/v1alpha1/expansion_generated.go create mode 100644 pkg/util/k8sutil/inspector/arangoroute/definition.go create mode 100644 pkg/util/k8sutil/inspector/arangoroute/v1alpha1/loader.go create mode 100644 pkg/util/k8sutil/inspector/arangoroute/v1alpha1/reader.go create mode 100644 pkg/util/k8sutil/inspector/constants/ar_constants.go diff --git a/.golangci.yaml b/.golangci.yaml index a841e8cf2..d46694844 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -77,6 +77,8 @@ linters-settings: alias: mlSharedTests - pkg: github.com/arangodb/kube-arangodb/pkg/apis/analytics/v1alpha1 alias: analyticsApi + - pkg: github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1 + alias: networkingApi - pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1 alias: mlApi - pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8501342fe..b7d9770dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) +- (Feature) ArangoRoute CRD ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index bf6f3cf4e..b82382f3a 100644 --- a/Makefile +++ b/Makefile @@ -440,7 +440,8 @@ update-generated: apps:v1 \ ml:v1alpha1 ml:v1beta1 \ scheduler:v1alpha1 scheduler:v1beta1 \ - analytics:v1alpha1" \ + analytics:v1alpha1 \ + networking:v1alpha1" \ --go-header-file "./tools/codegen/boilerplate.go.txt" \ $(VERIFYARGS) GOPATH=$(GOBUILDDIR) $(VENDORDIR)/k8s.io/code-generator/generate-groups.sh \ @@ -894,7 +895,8 @@ CRDS:=apps-job \ replication-deploymentreplication \ ml-storage ml-extension ml-job-batch ml-job-cron \ scheduler-profile \ - analytics-graphanalyticsengine + analytics-graphanalyticsengine \ + networking-route .PHONY: sync sync: diff --git a/chart/kube-arangodb-arm64/crds/networking-route.yaml b/chart/kube-arangodb-arm64/crds/networking-route.yaml new file mode 100644 index 000000000..514c0763f --- /dev/null +++ b/chart/kube-arangodb-arm64/crds/networking-route.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-arm64/templates/deployment-operator/role.yaml b/chart/kube-arangodb-arm64/templates/deployment-operator/role.yaml index ad6fd3796..18d5e8582 100644 --- a/chart/kube-arangodb-arm64/templates/deployment-operator/role.yaml +++ b/chart/kube-arangodb-arm64/templates/deployment-operator/role.yaml @@ -16,6 +16,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] {{- if .Values.rbac.extensions.acs }} - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] diff --git a/chart/kube-arangodb-enterprise-arm64/crds/networking-route.yaml b/chart/kube-arangodb-enterprise-arm64/crds/networking-route.yaml new file mode 100644 index 000000000..514c0763f --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/crds/networking-route.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/deployment-operator/role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/deployment-operator/role.yaml index ad6fd3796..18d5e8582 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/deployment-operator/role.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/deployment-operator/role.yaml @@ -16,6 +16,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] {{- if .Values.rbac.extensions.acs }} - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] diff --git a/chart/kube-arangodb-enterprise/crds/networking-route.yaml b/chart/kube-arangodb-enterprise/crds/networking-route.yaml new file mode 100644 index 000000000..514c0763f --- /dev/null +++ b/chart/kube-arangodb-enterprise/crds/networking-route.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise/templates/deployment-operator/role.yaml b/chart/kube-arangodb-enterprise/templates/deployment-operator/role.yaml index ad6fd3796..18d5e8582 100644 --- a/chart/kube-arangodb-enterprise/templates/deployment-operator/role.yaml +++ b/chart/kube-arangodb-enterprise/templates/deployment-operator/role.yaml @@ -16,6 +16,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] {{- if .Values.rbac.extensions.acs }} - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] diff --git a/chart/kube-arangodb/crds/networking-route.yaml b/chart/kube-arangodb/crds/networking-route.yaml new file mode 100644 index 000000000..514c0763f --- /dev/null +++ b/chart/kube-arangodb/crds/networking-route.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb/templates/deployment-operator/role.yaml b/chart/kube-arangodb/templates/deployment-operator/role.yaml index ad6fd3796..18d5e8582 100644 --- a/chart/kube-arangodb/templates/deployment-operator/role.yaml +++ b/chart/kube-arangodb/templates/deployment-operator/role.yaml @@ -16,6 +16,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status","arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] {{- if .Values.rbac.extensions.acs }} - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] diff --git a/docs/api/ArangoRoute.V1Alpha1.md b/docs/api/ArangoRoute.V1Alpha1.md new file mode 100644 index 000000000..f0e148992 --- /dev/null +++ b/docs/api/ArangoRoute.V1Alpha1.md @@ -0,0 +1,91 @@ +--- +layout: page +parent: CRD reference +title: ArangoRoute V1Alpha1 +--- + +# API Reference for ArangoRoute V1Alpha1 + +## Spec + +### .spec.deployment + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec.go#L27) + +Deployment specifies the ArangoDeployment object name + +*** + +### .spec.destination.schema + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L30) + +Schema defines HTTP/S schema used for connection + +*** + +### .spec.destination.service.checksum + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) + +UID keeps the information about object Checksum + +*** + +### .spec.destination.service.name + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) + +Name of the object + +*** + +### .spec.destination.service.namespace + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) + +Namespace of the object. Should default to the namespace of the parent object + +*** + +### .spec.destination.service.port + +Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_service.go#L36) + +Port defines Port or Port Name used as destination + +Links: +* [Documentation](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) + +*** + +### .spec.destination.service.uid + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) + +UID keeps the information about object UID + +*** + +### .spec.destination.tls.insecure + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go#L25) + +Insecure allows Insecure traffic + +*** + +### .spec.route.path + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_route.go#L29) + +Path specifies the Path route + +## Status + +### .status.conditions + +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status.go#L28) + +Conditions specific to the entire extension + diff --git a/internal/cr_validation_test.go b/internal/cr_validation_test.go index 6cdfe38fb..b5d8dc04c 100644 --- a/internal/cr_validation_test.go +++ b/internal/cr_validation_test.go @@ -40,6 +40,7 @@ import ( deploymentv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1" schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1" @@ -283,6 +284,15 @@ func Test_GenerateCRValidationSchemas(t *testing.T) { }, }, }, + "networking-route": { + fmt.Sprintf("%s/pkg/apis/networking/v1alpha1", root): { + "v1alpha1": { + objects: map[string]interface{}{ + "spec": networkingApi.ArangoRoute{}.Spec, + }, + }, + }, + }, } for filePrefix, packagesToVersion := range input { diff --git a/internal/docs_parser_test.go b/internal/docs_parser_test.go index bd181ab8f..9f2784e43 100644 --- a/internal/docs_parser_test.go +++ b/internal/docs_parser_test.go @@ -293,7 +293,7 @@ func isSimpleType(obj reflect.Type) (string, string, bool) { } func extractTag(tag string) (string, bool) { - parts := strings.SplitN(tag, ",", 2) + parts := strings.Split(tag, ",") if len(parts) == 1 { return parts[0], false diff --git a/internal/docs_test.go b/internal/docs_test.go index cdfd79d2a..b1c8a2003 100644 --- a/internal/docs_test.go +++ b/internal/docs_test.go @@ -42,6 +42,7 @@ import ( deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" replicationApi "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" @@ -249,6 +250,19 @@ func Test_GenerateAPIDocs(t *testing.T) { }, }, }, + "networking": map[string]inputPackage{ + "v1alpha1": { + Types: inputPackageTypes{ + "ArangoRoute.V1Alpha1": { + "Spec": networkingApi.ArangoRoute{}.Spec, + "Status": networkingApi.ArangoRoute{}.Status, + }, + }, + Shared: []string{ + "shared/v1", + }, + }, + }, "analytics": map[string]inputPackage{ "v1alpha1": { Types: inputPackageTypes{ diff --git a/internal/schema_builder_test.go b/internal/schema_builder_test.go index 4b0a2edbb..af82eb633 100644 --- a/internal/schema_builder_test.go +++ b/internal/schema_builder_test.go @@ -228,7 +228,7 @@ func (b *schemaBuilder) StructToSchema(t *testing.T, structObj reflect.Type, pat schema.Properties[k] = v } } else { - require.NotEmpty(t, n, fullFieldName) + require.NotEmpty(t, n, fullFieldName, inline) schema.Properties[n] = *s } } diff --git a/pkg/apis/networking/definitions.go b/pkg/apis/networking/definitions.go new file mode 100644 index 000000000..629edad93 --- /dev/null +++ b/pkg/apis/networking/definitions.go @@ -0,0 +1,29 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package networking + +const ( + ArangoRouteCRDName = ArangoRouteResourcePlural + "." + ArangoNetworkingGroupName + ArangoRouteResourceKind = "ArangoRoute" + ArangoRouteResourcePlural = "arangoroutes" + + ArangoNetworkingGroupName = "networking.arangodb.com" +) diff --git a/pkg/apis/networking/v1alpha1/doc.go b/pkg/apis/networking/v1alpha1/doc.go new file mode 100644 index 000000000..441bd1b92 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/doc.go @@ -0,0 +1,23 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// +k8s:deepcopy-gen=package +// +groupName=networking.arangodb.com +package v1alpha1 diff --git a/pkg/apis/networking/v1alpha1/register.go b/pkg/apis/networking/v1alpha1/register.go new file mode 100644 index 000000000..af7697c9f --- /dev/null +++ b/pkg/apis/networking/v1alpha1/register.go @@ -0,0 +1,52 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/networking" +) + +const ( + ArangoNetworkingVersion = "v1alpha1" +) + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme + + SchemeGroupVersion = schema.GroupVersion{Group: networking.ArangoNetworkingGroupName, Version: ArangoNetworkingVersion} +) + +// Resource gets an ArangoCluster GroupResource for a specified resource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// addKnownTypes adds the set of types defined in this package to the supplied scheme. +func addKnownTypes(s *runtime.Scheme) error { + s.AddKnownTypes(SchemeGroupVersion) + meta.AddToGroupVersion(s, SchemeGroupVersion) + return nil +} diff --git a/pkg/apis/networking/v1alpha1/route.go b/pkg/apis/networking/v1alpha1/route.go new file mode 100644 index 000000000..4b47f3dcc --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route.go @@ -0,0 +1,69 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/networking" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoRouteList is a list of Arango Routes. +type ArangoRouteList struct { + meta.TypeMeta `json:",inline"` + meta.ListMeta `json:"metadata,omitempty"` + + Items []ArangoRoute `json:"items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoRoute contains definition and status of the Arango Route. +type ArangoRoute struct { + meta.TypeMeta `json:",inline"` + meta.ObjectMeta `json:"metadata,omitempty"` + + Spec ArangoRouteSpec `json:"spec"` + Status ArangoRouteStatus `json:"status"` +} + +// AsOwner creates an OwnerReference for the given Extension +func (a *ArangoRoute) AsOwner() meta.OwnerReference { + trueVar := true + return meta.OwnerReference{ + APIVersion: SchemeGroupVersion.String(), + Kind: networking.ArangoRouteResourceKind, + Name: a.Name, + UID: a.UID, + Controller: &trueVar, + } +} + +func (a *ArangoRoute) GetStatus() ArangoRouteStatus { + return a.Status +} + +func (a *ArangoRoute) SetStatus(status ArangoRouteStatus) { + a.Status = status +} diff --git a/pkg/apis/networking/v1alpha1/route_spec.go b/pkg/apis/networking/v1alpha1/route_spec.go new file mode 100644 index 000000000..d98caf3ca --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + +type ArangoRouteSpec struct { + // Deployment specifies the ArangoDeployment object name + Deployment string `json:"deployment,omitempty"` + + // Destination defines the route destination + Destination *ArangoRouteSpecDestination `json:"destination,omitempty"` + + // Route defines the route spec + Route *ArangoRouteSpecRoute `json:"route,omitempty"` +} + +func (s *ArangoRouteSpec) Validate() error { + if s == nil { + s = &ArangoRouteSpec{} + } + + if err := shared.WithErrors(shared.PrefixResourceErrors("spec", + shared.PrefixResourceError("deployment", shared.ValidateResourceName(s.Deployment)), + shared.ValidateRequiredInterfacePath("destination", s.Destination), + shared.ValidateRequiredInterfacePath("route", s.Route), + )); err != nil { + return err + } + + return nil +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination.go b/pkg/apis/networking/v1alpha1/route_spec_destination.go new file mode 100644 index 000000000..e491bea21 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_destination.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + +type ArangoRouteSpecDestination struct { + // Service defines service upstream reference + Service *ArangoRouteSpecDestinationService `json:"service,omitempty"` + + // Schema defines HTTP/S schema used for connection + Schema *ArangoRouteSpecDestinationSchema `json:"schema,omitempty"` + + // TLS defines TLS Configuration + TLS *ArangoRouteSpecDestinationTLS `json:"tls,omitempty"` +} + +func (s *ArangoRouteSpecDestination) Validate() error { + if s == nil { + s = &ArangoRouteSpecDestination{} + } + + if err := shared.WithErrors( + shared.ValidateOptionalInterfacePath("service", s.Service), + shared.ValidateOptionalInterfacePath("schema", s.Schema), + shared.ValidateOptionalInterfacePath("tls", s.TLS), + ); err != nil { + return err + } + + return nil +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_schema.go b/pkg/apis/networking/v1alpha1/route_spec_destination_schema.go new file mode 100644 index 000000000..6ad96e2a5 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_schema.go @@ -0,0 +1,55 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/strings" +) + +type ArangoRouteSpecDestinationSchema string + +const ( + ArangoRouteSpecDestinationSchemaHTTP ArangoRouteSpecDestinationSchema = "http" + ArangoRouteSpecDestinationSchemaHTTPS ArangoRouteSpecDestinationSchema = "https" + ArangoRouteSpecDestinationSchemaDefault = ArangoRouteSpecDestinationSchemaHTTP +) + +func (a *ArangoRouteSpecDestinationSchema) Get() ArangoRouteSpecDestinationSchema { + if a == nil { + return ArangoRouteSpecDestinationSchemaDefault + } + + return ArangoRouteSpecDestinationSchema(strings.ToLower(string(*a))) +} + +func (a *ArangoRouteSpecDestinationSchema) String() string { + return string(a.Get()) +} + +func (a *ArangoRouteSpecDestinationSchema) Validate() error { + switch x := a.Get(); x { + case ArangoRouteSpecDestinationSchemaHTTP, ArangoRouteSpecDestinationSchemaHTTPS: + return nil + default: + return errors.Errorf("Invalid schema: %s", x.String()) + } +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_service.go b/pkg/apis/networking/v1alpha1/route_spec_destination_service.go new file mode 100644 index 000000000..af55e3edc --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_service.go @@ -0,0 +1,49 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/util/intstr" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" +) + +type ArangoRouteSpecDestinationService struct { + *sharedApi.Object `json:",inline,omitempty"` + + // Port defines Port or Port Name used as destination + // +doc/type: intstr.IntOrString + // +doc/link: Documentation|https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ + Port *intstr.IntOrString `json:"port,omitempty"` +} + +func (s *ArangoRouteSpecDestinationService) Validate() error { + if s == nil { + s = &ArangoRouteSpecDestinationService{} + } + + if err := shared.WithErrors(s.Object.Validate()); err != nil { + return err + } + + return nil +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go b/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go new file mode 100644 index 000000000..e5fdb3449 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go @@ -0,0 +1,30 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +type ArangoRouteSpecDestinationTLS struct { + // Insecure allows Insecure traffic + Insecure *bool `json:"insecure,omitempty"` +} + +func (s *ArangoRouteSpecDestinationTLS) Validate() error { + return nil +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_route.go b/pkg/apis/networking/v1alpha1/route_spec_route.go new file mode 100644 index 000000000..018396094 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_route.go @@ -0,0 +1,52 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" +) + +type ArangoRouteSpecRoute struct { + // Path specifies the Path route + Path *string `json:"path,omitempty"` +} + +func (s *ArangoRouteSpecRoute) GetPath() string { + if s == nil && s.Path == nil { + return "/" + } + + return *s.Path +} + +func (s *ArangoRouteSpecRoute) Validate() error { + if s == nil { + s = &ArangoRouteSpecRoute{} + } + + if err := shared.WithErrors( + shared.PrefixResourceError("path", shared.ValidateAPIPath(s.GetPath())), + ); err != nil { + return err + } + + return nil +} diff --git a/pkg/apis/networking/v1alpha1/route_status.go b/pkg/apis/networking/v1alpha1/route_status.go new file mode 100644 index 000000000..514db9e44 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_status.go @@ -0,0 +1,29 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + +type ArangoRouteStatus struct { + // Conditions specific to the entire extension + // +doc/type: api.Conditions + Conditions api.ConditionList `json:"conditions,omitempty"` +} diff --git a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..6b2e00ac8 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,242 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRoute) DeepCopyInto(out *ArangoRoute) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRoute. +func (in *ArangoRoute) DeepCopy() *ArangoRoute { + if in == nil { + return nil + } + out := new(ArangoRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoRoute) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteList) DeepCopyInto(out *ArangoRouteList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ArangoRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteList. +func (in *ArangoRouteList) DeepCopy() *ArangoRouteList { + if in == nil { + return nil + } + out := new(ArangoRouteList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoRouteList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteSpec) DeepCopyInto(out *ArangoRouteSpec) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(ArangoRouteSpecDestination) + (*in).DeepCopyInto(*out) + } + if in.Route != nil { + in, out := &in.Route, &out.Route + *out = new(ArangoRouteSpecRoute) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteSpec. +func (in *ArangoRouteSpec) DeepCopy() *ArangoRouteSpec { + if in == nil { + return nil + } + out := new(ArangoRouteSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteSpecDestination) DeepCopyInto(out *ArangoRouteSpecDestination) { + *out = *in + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(ArangoRouteSpecDestinationService) + (*in).DeepCopyInto(*out) + } + if in.Schema != nil { + in, out := &in.Schema, &out.Schema + *out = new(ArangoRouteSpecDestinationSchema) + **out = **in + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(ArangoRouteSpecDestinationTLS) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteSpecDestination. +func (in *ArangoRouteSpecDestination) DeepCopy() *ArangoRouteSpecDestination { + if in == nil { + return nil + } + out := new(ArangoRouteSpecDestination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteSpecDestinationService) DeepCopyInto(out *ArangoRouteSpecDestinationService) { + *out = *in + if in.Object != nil { + in, out := &in.Object, &out.Object + *out = new(v1.Object) + (*in).DeepCopyInto(*out) + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(intstr.IntOrString) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteSpecDestinationService. +func (in *ArangoRouteSpecDestinationService) DeepCopy() *ArangoRouteSpecDestinationService { + if in == nil { + return nil + } + out := new(ArangoRouteSpecDestinationService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteSpecDestinationTLS) DeepCopyInto(out *ArangoRouteSpecDestinationTLS) { + *out = *in + if in.Insecure != nil { + in, out := &in.Insecure, &out.Insecure + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteSpecDestinationTLS. +func (in *ArangoRouteSpecDestinationTLS) DeepCopy() *ArangoRouteSpecDestinationTLS { + if in == nil { + return nil + } + out := new(ArangoRouteSpecDestinationTLS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteSpecRoute) DeepCopyInto(out *ArangoRouteSpecRoute) { + *out = *in + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteSpecRoute. +func (in *ArangoRouteSpecRoute) DeepCopy() *ArangoRouteSpecRoute { + if in == nil { + return nil + } + out := new(ArangoRouteSpecRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteStatus) DeepCopyInto(out *ArangoRouteStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(deploymentv1.ConditionList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatus. +func (in *ArangoRouteStatus) DeepCopy() *ArangoRouteStatus { + if in == nil { + return nil + } + out := new(ArangoRouteStatus) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/shared/validate.go b/pkg/apis/shared/validate.go index 7d221de38..e415d4fff 100644 --- a/pkg/apis/shared/validate.go +++ b/pkg/apis/shared/validate.go @@ -33,12 +33,17 @@ import ( var ( resourceNameRE = regexp.MustCompile(`^([0-9\-\.a-z])+$`) + apiPathRE = regexp.MustCompile(`^/([A-Za-z0-9\-]+/)*$`) ) const ( ServiceTypeNone core.ServiceType = "None" ) +type ValidateInterface interface { + Validate() error +} + // ValidateResourceName validates a kubernetes resource name. // If not valid, an error is returned. // See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/ @@ -70,6 +75,19 @@ func ValidateUID(uid types.UID) error { return err } +// ValidateAPIPath validates if it is valid API Path +func ValidateAPIPath(path string) error { + if path == "" { + return nil + } + + if apiPathRE.MatchString(path) { + return nil + } + + return errors.WithStack(errors.Errorf("String '%s' is not a valid api path", path)) +} + // ValidatePullPolicy Validates core.PullPolicy func ValidatePullPolicy(in core.PullPolicy) error { switch in { @@ -80,19 +98,19 @@ func ValidatePullPolicy(in core.PullPolicy) error { return errors.Errorf("Unknown pull policy: '%s'", string(in)) } -type ValidateInterface interface { - Validate() error -} - func Validate[T interface{}](in T) error { - return validate(in) + res, _ := validate(in) + return res } -func validate(in any) error { +func validate(in any) (error, bool) { + if in == nil { + return nil, false + } if v, ok := in.(ValidateInterface); ok { - return v.Validate() + return v.Validate(), true } - return nil + return nil, false } // ValidateOptional Validates object if is not nil @@ -104,6 +122,17 @@ func ValidateOptional[T interface{}](in *T, validator func(T) error) error { return nil } +// ValidateOptionalInterface Validates object if is not nil +func ValidateOptionalInterface[T ValidateInterface](in T) error { + res, _ := validate(in) + return res +} + +// ValidateOptionalInterfacePath Validates object if is not nil with path +func ValidateOptionalInterfacePath[T ValidateInterface](path string, in T) error { + return PrefixResourceError(path, ValidateOptionalInterface(in)) +} + // ValidateRequired Validates object and required not nil value func ValidateRequired[T interface{}](in *T, validator func(T) error) error { if in != nil { @@ -113,6 +142,20 @@ func ValidateRequired[T interface{}](in *T, validator func(T) error) error { return errors.Errorf("should be not nil") } +// ValidateRequiredInterface Validates object if is not nil +func ValidateRequiredInterface[T ValidateInterface](in T) error { + res, ok := validate(in) + if !ok { + return errors.Errorf("should be not nil") + } + return res +} + +// ValidateRequiredInterfacePath Validates object if is not nil with path +func ValidateRequiredInterfacePath[T ValidateInterface](path string, in T) error { + return PrefixResourceError(path, ValidateRequiredInterface(in)) +} + // ValidateList validates all elements on the list func ValidateList[T interface{}](in []T, validator func(T) error) error { errors := make([]error, len(in)) diff --git a/pkg/apis/shared/validate_test.go b/pkg/apis/shared/validate_test.go index 06dad2c24..31b7f6787 100644 --- a/pkg/apis/shared/validate_test.go +++ b/pkg/apis/shared/validate_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,3 +31,14 @@ func Test_ValidateUID(t *testing.T) { require.Error(t, ValidateUID("")) require.NoError(t, ValidateUID(uuid.NewUUID())) } + +func Test_ValidateAPIPath(t *testing.T) { + require.NoError(t, ValidateAPIPath("")) + require.NoError(t, ValidateAPIPath("/")) + require.Error(t, ValidateAPIPath("//")) + require.Error(t, ValidateAPIPath("/api/zz")) + require.NoError(t, ValidateAPIPath("/api/")) + require.NoError(t, ValidateAPIPath("/api/test/qw/")) + require.NoError(t, ValidateAPIPath("/api/test/2/")) + require.Error(t, ValidateAPIPath("/&/")) +} diff --git a/pkg/crd/crds/crds.go b/pkg/crd/crds/crds.go index 6afef097c..8158a8745 100644 --- a/pkg/crd/crds/crds.go +++ b/pkg/crd/crds/crds.go @@ -90,6 +90,9 @@ func AllDefinitions() []Definition { // Analytics AnalyticsGAEDefinitionWithOptions(), + + // Networking + NetworkingRouteDefinitionWithOptions(), } } diff --git a/pkg/crd/crds/crds_test.go b/pkg/crd/crds/crds_test.go index 6f558f4eb..60368f107 100644 --- a/pkg/crd/crds/crds_test.go +++ b/pkg/crd/crds/crds_test.go @@ -144,6 +144,7 @@ func Test_CRDGetters(t *testing.T) { StorageLocalStorageWithOptions, SchedulerProfileWithOptions, AnalyticsGAEWithOptions, + NetworkingRouteWithOptions, } require.Equal(t, len(AllDefinitions()), len(getters)) diff --git a/pkg/crd/crds/networking-route.go b/pkg/crd/crds/networking-route.go new file mode 100644 index 000000000..fd570e313 --- /dev/null +++ b/pkg/crd/crds/networking-route.go @@ -0,0 +1,51 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package crds + +import ( + _ "embed" + + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +func NetworkingRouteWithOptions(opts ...func(*CRDOptions)) *apiextensions.CustomResourceDefinition { + return getCRD(NetworkingRouteDefinitionData(), opts...) +} + +func NetworkingRouteDefinitionWithOptions(opts ...func(*CRDOptions)) Definition { + return Definition{ + DefinitionData: NetworkingRouteDefinitionData(), + CRD: NetworkingRouteWithOptions(opts...), + } +} + +func NetworkingRouteDefinitionData() DefinitionData { + return DefinitionData{ + definition: networkingRoute, + schemaDefinition: networkingRouteSchemaRaw, + } +} + +//go:embed networking-route.yaml +var networkingRoute []byte + +//go:embed networking-route.schema.generated.yaml +var networkingRouteSchemaRaw []byte diff --git a/pkg/crd/crds/networking-route.schema.generated.yaml b/pkg/crd/crds/networking-route.schema.generated.yaml new file mode 100644 index 000000000..ee0df1501 --- /dev/null +++ b/pkg/crd/crds/networking-route.schema.generated.yaml @@ -0,0 +1,55 @@ +v1alpha1: + openAPIV3Schema: + properties: + spec: + properties: + deployment: + description: Deployment specifies the ArangoDeployment object name + type: string + destination: + description: Destination defines the route destination + properties: + schema: + description: Schema defines HTTP/S schema used for connection + type: string + service: + description: Service defines service upstream reference + properties: + checksum: + description: UID keeps the information about object Checksum + type: string + name: + description: Name of the object + type: string + namespace: + description: Namespace of the object. Should default to the namespace of the parent object + type: string + port: + description: Port defines Port or Port Name used as destination + type: string + x-kubernetes-int-or-string: true + uid: + description: UID keeps the information about object UID + type: string + type: object + tls: + description: TLS defines TLS Configuration + properties: + insecure: + description: Insecure allows Insecure traffic + type: boolean + type: object + type: object + route: + description: Route defines the route spec + properties: + path: + description: Path specifies the Path route + type: string + type: object + type: object + status: + description: Object with preserved fields for backward compatibility + type: object + x-kubernetes-preserve-unknown-fields: true + type: object diff --git a/pkg/crd/crds/networking-route.yaml b/pkg/crd/crds/networking-route.yaml new file mode 100644 index 000000000..514c0763f --- /dev/null +++ b/pkg/crd/crds/networking-route.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/pkg/crd/networking.go b/pkg/crd/networking.go new file mode 100644 index 000000000..911892724 --- /dev/null +++ b/pkg/crd/networking.go @@ -0,0 +1,40 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package crd + +import ( + "github.com/arangodb/kube-arangodb/pkg/crd/crds" +) + +func init() { + defs := []func(...func(options *crds.CRDOptions)) crds.Definition{ + crds.NetworkingRouteDefinitionWithOptions, + } + for _, getDef := range defs { + defFn := getDef // bring into scope + registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition { + return defFn(opts.AsFunc()) + }, &crds.CRDOptions{ + WithSchema: true, + WithPreserve: false, + }) + } +} diff --git a/pkg/deployment/resources/inspector/ar.go b/pkg/deployment/resources/inspector/ar.go new file mode 100644 index 000000000..cdb37e4c5 --- /dev/null +++ b/pkg/deployment/resources/inspector/ar.go @@ -0,0 +1,192 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "context" + "time" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version" +) + +func init() { + requireRegisterInspectorLoader(arangoRoutesInspectorLoaderObj) +} + +var arangoRoutesInspectorLoaderObj = arangoRoutesInspectorLoader{} + +type arangoRoutesInspectorLoader struct { +} + +func (p arangoRoutesInspectorLoader) Component() definitions.Component { + return definitions.ArangoRoute +} + +func (p arangoRoutesInspectorLoader) Load(ctx context.Context, i *inspectorState) { + var q arangoRoutesInspector + p.loadV1Alpha1(ctx, i, &q) + i.arangoRoutes = &q + q.state = i + q.last = time.Now() +} + +func (p arangoRoutesInspectorLoader) loadV1Alpha1(ctx context.Context, i *inspectorState, q *arangoRoutesInspector) { + var z arangoRoutesInspectorV1Alpha1 + + z.arangoRouteInspector = q + + z.arangoRoutes, z.err = p.getV1ArangoRoutes(ctx, i) + + q.v1alpha1 = &z +} + +func (p arangoRoutesInspectorLoader) getV1ArangoRoutes(ctx context.Context, i *inspectorState) (map[string]*networkingApi.ArangoRoute, error) { + objs, err := p.getV1ArangoRoutesList(ctx, i) + if err != nil { + return nil, err + } + + r := make(map[string]*networkingApi.ArangoRoute, len(objs)) + + for id := range objs { + r[objs[id].GetName()] = objs[id] + } + + return r, nil +} + +func (p arangoRoutesInspectorLoader) getV1ArangoRoutesList(ctx context.Context, i *inspectorState) ([]*networkingApi.ArangoRoute, error) { + ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) + defer cancel() + obj, err := i.client.Arango().NetworkingV1alpha1().ArangoRoutes(i.namespace).List(ctxChild, meta.ListOptions{ + Limit: globals.GetGlobals().Kubernetes().RequestBatchSize().Get(), + }) + + if err != nil { + return nil, err + } + + items := obj.Items + cont := obj.Continue + var s = int64(len(items)) + + if z := obj.RemainingItemCount; z != nil { + s += *z + } + + ptrs := make([]*networkingApi.ArangoRoute, 0, s) + + for { + for id := range items { + ptrs = append(ptrs, &items[id]) + } + + if cont == "" { + break + } + + items, cont, err = p.getV1ArangoRoutesListRequest(ctx, i, cont) + + if err != nil { + return nil, err + } + } + + return ptrs, nil +} + +func (p arangoRoutesInspectorLoader) getV1ArangoRoutesListRequest(ctx context.Context, i *inspectorState, cont string) ([]networkingApi.ArangoRoute, string, error) { + ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) + defer cancel() + obj, err := i.client.Arango().NetworkingV1alpha1().ArangoRoutes(i.namespace).List(ctxChild, meta.ListOptions{ + Limit: globals.GetGlobals().Kubernetes().RequestBatchSize().Get(), + Continue: cont, + }) + + if err != nil { + return nil, "", err + } + + return obj.Items, obj.Continue, err +} + +func (p arangoRoutesInspectorLoader) Verify(i *inspectorState) error { + return nil +} + +func (p arangoRoutesInspectorLoader) Copy(from, to *inspectorState, override bool) { + if to.arangoRoutes != nil { + if !override { + return + } + } + + to.arangoRoutes = from.arangoRoutes + to.arangoRoutes.state = to +} + +func (p arangoRoutesInspectorLoader) Name() string { + return "arangoRoutes" +} + +type arangoRoutesInspector struct { + state *inspectorState + + last time.Time + + v1alpha1 *arangoRoutesInspectorV1Alpha1 +} + +func (p *arangoRoutesInspector) LastRefresh() time.Time { + return p.last +} + +func (p *arangoRoutesInspector) Refresh(ctx context.Context) error { + p.Throttle(p.state.throttles).Invalidate() + return p.state.refresh(ctx, arangoRoutesInspectorLoaderObj) +} + +func (p *arangoRoutesInspector) Version() version.Version { + return version.V1 +} + +func (p *arangoRoutesInspector) Throttle(c throttle.Components) throttle.Throttle { + return c.ArangoRoute() +} + +func (p *arangoRoutesInspector) validate() error { + if p == nil { + return errors.Errorf("ArangoRouteInspector is nil") + } + + if p.state == nil { + return errors.Errorf("Parent is nil") + } + + return p.v1alpha1.validate() +} diff --git a/pkg/deployment/resources/inspector/ar_anonymous.go b/pkg/deployment/resources/inspector/ar_anonymous.go new file mode 100644 index 000000000..501ebb1e1 --- /dev/null +++ b/pkg/deployment/resources/inspector/ar_anonymous.go @@ -0,0 +1,45 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *arangoRoutesInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { + g := constants.ArangoRouteGKv1() + + if g.Kind == gvk.Kind && g.Group == gvk.Group { + switch gvk.Version { + case constants.ArangoRouteVersionV1Alpha1, DefaultVersion: + if p.v1alpha1 == nil || p.v1alpha1.err != nil { + return nil, false + } + return anonymous.NewAnonymous[*networkingApi.ArangoRoute](g, p.state.arangoRoutes.v1alpha1, p.state.ArangoRouteModInterface().V1Alpha1()), true + } + } + + return nil, false +} diff --git a/pkg/deployment/resources/inspector/ar_gvk.go b/pkg/deployment/resources/inspector/ar_gvk.go new file mode 100644 index 000000000..a1bb4caed --- /dev/null +++ b/pkg/deployment/resources/inspector/ar_gvk.go @@ -0,0 +1,43 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *arangoRoutesInspectorV1Alpha1) GroupVersionKind() schema.GroupVersionKind { + return constants.ArangoRouteGKv1() +} + +func (p *arangoRoutesInspectorV1Alpha1) GroupVersionResource() schema.GroupVersionResource { + return constants.ArangoRouteGRv1() +} + +func (p *arangoRoutesInspector) GroupKind() schema.GroupKind { + return constants.ArangoRouteGK() +} + +func (p *arangoRoutesInspector) GroupResource() schema.GroupResource { + return constants.ArangoRouteGR() +} diff --git a/pkg/deployment/resources/inspector/ar_mod.go b/pkg/deployment/resources/inspector/ar_mod.go new file mode 100644 index 000000000..eb9fd854f --- /dev/null +++ b/pkg/deployment/resources/inspector/ar_mod.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + arangoRoutev1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/mods" +) + +func (i *inspectorState) ArangoRouteModInterface() mods.ArangoRouteMods { + return arangoRouteMod{ + i: i, + } +} + +type arangoRouteMod struct { + i *inspectorState +} + +func (p arangoRouteMod) V1Alpha1() arangoRoutev1.ModInterface { + return wrapMod[*networkingApi.ArangoRoute](definitions.ArangoRoute, p.i.GetThrottles, p.clientv1alpha1) +} + +func (p arangoRouteMod) clientv1alpha1() generic.ModStatusClient[*networkingApi.ArangoRoute] { + return p.i.Client().Arango().NetworkingV1alpha1().ArangoRoutes(p.i.Namespace()) +} diff --git a/pkg/deployment/resources/inspector/ar_v1alpha1.go b/pkg/deployment/resources/inspector/ar_v1alpha1.go new file mode 100644 index 000000000..7d7c0d655 --- /dev/null +++ b/pkg/deployment/resources/inspector/ar_v1alpha1.go @@ -0,0 +1,138 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "context" + + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *arangoRoutesInspector) V1Alpha1() (ins.Inspector, error) { + if p.v1alpha1.err != nil { + return nil, p.v1alpha1.err + } + + return p.v1alpha1, nil +} + +type arangoRoutesInspectorV1Alpha1 struct { + arangoRouteInspector *arangoRoutesInspector + + arangoRoutes map[string]*networkingApi.ArangoRoute + err error +} + +func (p *arangoRoutesInspectorV1Alpha1) Filter(filters ...ins.Filter) []*networkingApi.ArangoRoute { + z := p.ListSimple() + + r := make([]*networkingApi.ArangoRoute, 0, len(z)) + + for _, o := range z { + if !ins.FilterObject(o, filters...) { + continue + } + + r = append(r, o) + } + + return r +} + +func (p *arangoRoutesInspectorV1Alpha1) validate() error { + if p == nil { + return errors.Errorf("ArangoRoutesV1AlphaInspector is nil") + } + + if p.arangoRouteInspector == nil { + return errors.Errorf("Parent is nil") + } + + if p.arangoRoutes == nil && p.err == nil { + return errors.Errorf("ArangoRoutes or err should be not nil") + } + + if p.arangoRoutes != nil && p.err != nil { + return errors.Errorf("ArangoRoutes or err cannot be not nil together") + } + + return nil +} + +func (p *arangoRoutesInspectorV1Alpha1) ListSimple() []*networkingApi.ArangoRoute { + var r []*networkingApi.ArangoRoute + for _, arangoRoute := range p.arangoRoutes { + r = append(r, arangoRoute) + } + + return r +} + +func (p *arangoRoutesInspectorV1Alpha1) GetSimple(name string) (*networkingApi.ArangoRoute, bool) { + arangoRoute, ok := p.arangoRoutes[name] + if !ok { + return nil, false + } + + return arangoRoute, true +} + +func (p *arangoRoutesInspectorV1Alpha1) Iterate(action ins.Action, filters ...ins.Filter) error { + for _, arangoRoute := range p.arangoRoutes { + if err := p.iterateArangoRoute(arangoRoute, action, filters...); err != nil { + return err + } + } + + return nil +} + +func (p *arangoRoutesInspectorV1Alpha1) iterateArangoRoute(arangoRoute *networkingApi.ArangoRoute, action ins.Action, filters ...ins.Filter) error { + for _, f := range filters { + if f == nil { + continue + } + + if !f(arangoRoute) { + return nil + } + } + + return action(arangoRoute) +} + +func (p *arangoRoutesInspectorV1Alpha1) Read() ins.ReadInterface { + return p +} + +func (p *arangoRoutesInspectorV1Alpha1) Get(ctx context.Context, name string, opts meta.GetOptions) (*networkingApi.ArangoRoute, error) { + if s, ok := p.GetSimple(name); !ok { + return nil, apiErrors.NewNotFound(constants.ArangoRouteGR(), name) + } else { + return s, nil + } +} diff --git a/pkg/deployment/resources/inspector/inspector.go b/pkg/deployment/resources/inspector/inspector.go index 55bcb6d0e..d28fae726 100644 --- a/pkg/deployment/resources/inspector/inspector.go +++ b/pkg/deployment/resources/inspector/inspector.go @@ -42,6 +42,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints" @@ -134,6 +135,7 @@ type inspectorState struct { serviceMonitors *serviceMonitorsInspector arangoMembers *arangoMembersInspector arangoTasks *arangoTasksInspector + arangoRoutes *arangoRoutesInspector arangoClusterSynchronizations *arangoClusterSynchronizationsInspector endpoints *endpointsInspector @@ -167,6 +169,10 @@ func (i *inspectorState) RegisterInformers(k8s informers.SharedInformerFactory, arango.Database().V1().ArangoTasks().Informer().AddEventHandler(i.eventHandler(definitions.ArangoTask)) } + if _, err := i.ArangoRoute().V1Alpha1(); err == nil { + arango.Networking().V1alpha1().ArangoRoutes().Informer().AddEventHandler(i.eventHandler(definitions.ArangoRoute)) + } + if _, err := i.ArangoClusterSynchronization().V1(); err == nil { arango.Database().V1().ArangoClusterSynchronizations().Informer().AddEventHandler(i.eventHandler(definitions.ArangoClusterSynchronization)) } @@ -225,6 +231,7 @@ func (i *inspectorState) AnonymousObjects() []anonymous.Impl { i.serviceMonitors, i.arangoMembers, i.arangoTasks, + i.arangoRoutes, i.arangoClusterSynchronizations, i.endpoints, } @@ -317,6 +324,10 @@ func (i *inspectorState) ArangoTask() arangotask.Definition { return i.arangoTasks } +func (i *inspectorState) ArangoRoute() arangoroute.Definition { + return i.arangoRoutes +} + func (i *inspectorState) Refresh(ctx context.Context) error { return i.refresh(ctx, inspectorLoadersList...) } @@ -464,6 +475,10 @@ func (i *inspectorState) validate() error { return err } + if err := i.arangoRoutes.validate(); err != nil { + return err + } + if err := i.arangoTasks.validate(); err != nil { return err } @@ -495,6 +510,7 @@ func (i *inspectorState) copyCore() *inspectorState { serviceMonitors: i.serviceMonitors, arangoMembers: i.arangoMembers, arangoTasks: i.arangoTasks, + arangoRoutes: i.arangoRoutes, arangoClusterSynchronizations: i.arangoClusterSynchronizations, throttles: i.throttles.Copy(), versionInfo: i.versionInfo, diff --git a/pkg/deployment/resources/inspector/inspector_test.go b/pkg/deployment/resources/inspector/inspector_test.go index c856fcd0c..848a92189 100644 --- a/pkg/deployment/resources/inspector/inspector_test.go +++ b/pkg/deployment/resources/inspector/inspector_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -142,7 +142,7 @@ func getAllTypes() []string { func Test_Inspector_RefreshMatrix(t *testing.T) { c := kclient.NewFakeClient() - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") @@ -302,7 +302,7 @@ func Test_Inspector_Load(t *testing.T) { func Test_Inspector_Invalidate(t *testing.T) { c := kclient.NewFakeClient() - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") diff --git a/pkg/deployment/resources/inspector/pdbs_version_test.go b/pkg/deployment/resources/inspector/pdbs_version_test.go index 1ab15bbb3..cea38d963 100644 --- a/pkg/deployment/resources/inspector/pdbs_version_test.go +++ b/pkg/deployment/resources/inspector/pdbs_version_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ func Test_PDB_Versions(t *testing.T) { GitVersion: v, }) - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") require.NoError(t, i.Refresh(context.Background())) diff --git a/pkg/deployment/resources/inspector/throttles.go b/pkg/deployment/resources/inspector/throttles.go index 15345ca03..39cf020b1 100644 --- a/pkg/deployment/resources/inspector/throttles.go +++ b/pkg/deployment/resources/inspector/throttles.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ func NewDefaultThrottle() throttle.Components { 30*time.Second, // ArangoDeploymentSynchronization 30*time.Second, // ArangoMember 30*time.Second, // ArangoTask + 30*time.Second, // ArangoRoute 30*time.Second, // Node 30*time.Second, // PV 15*time.Second, // PVC diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index d2f139f70..a4de07d21 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -33,6 +33,7 @@ import ( databasev2alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/deployment/v2alpha1" mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1alpha1" mlv1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1beta1" + networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/networking/v1alpha1" replicationv1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v1" replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v2alpha1" schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/scheduler/v1alpha1" @@ -52,6 +53,7 @@ type Interface interface { DatabaseV2alpha1() databasev2alpha1.DatabaseV2alpha1Interface MlV1alpha1() mlv1alpha1.MlV1alpha1Interface MlV1beta1() mlv1beta1.MlV1beta1Interface + NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface ReplicationV1() replicationv1.ReplicationV1Interface ReplicationV2alpha1() replicationv2alpha1.ReplicationV2alpha1Interface SchedulerV1alpha1() schedulerv1alpha1.SchedulerV1alpha1Interface @@ -69,6 +71,7 @@ type Clientset struct { databaseV2alpha1 *databasev2alpha1.DatabaseV2alpha1Client mlV1alpha1 *mlv1alpha1.MlV1alpha1Client mlV1beta1 *mlv1beta1.MlV1beta1Client + networkingV1alpha1 *networkingv1alpha1.NetworkingV1alpha1Client replicationV1 *replicationv1.ReplicationV1Client replicationV2alpha1 *replicationv2alpha1.ReplicationV2alpha1Client schedulerV1alpha1 *schedulerv1alpha1.SchedulerV1alpha1Client @@ -111,6 +114,11 @@ func (c *Clientset) MlV1beta1() mlv1beta1.MlV1beta1Interface { return c.mlV1beta1 } +// NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client +func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface { + return c.networkingV1alpha1 +} + // ReplicationV1 retrieves the ReplicationV1Client func (c *Clientset) ReplicationV1() replicationv1.ReplicationV1Interface { return c.replicationV1 @@ -208,6 +216,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.networkingV1alpha1, err = networkingv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.replicationV1, err = replicationv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -256,6 +268,7 @@ func New(c rest.Interface) *Clientset { cs.databaseV2alpha1 = databasev2alpha1.New(c) cs.mlV1alpha1 = mlv1alpha1.New(c) cs.mlV1beta1 = mlv1beta1.New(c) + cs.networkingV1alpha1 = networkingv1alpha1.New(c) cs.replicationV1 = replicationv1.New(c) cs.replicationV2alpha1 = replicationv2alpha1.New(c) cs.schedulerV1alpha1 = schedulerv1alpha1.New(c) diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 499793aa7..661164523 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -38,6 +38,8 @@ import ( fakemlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1alpha1/fake" mlv1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1beta1" fakemlv1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/ml/v1beta1/fake" + networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/networking/v1alpha1" + fakenetworkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake" replicationv1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v1" fakereplicationv1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v1/fake" replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v2alpha1" @@ -140,6 +142,11 @@ func (c *Clientset) MlV1beta1() mlv1beta1.MlV1beta1Interface { return &fakemlv1beta1.FakeMlV1beta1{Fake: &c.Fake} } +// NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client +func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface { + return &fakenetworkingv1alpha1.FakeNetworkingV1alpha1{Fake: &c.Fake} +} + // ReplicationV1 retrieves the ReplicationV1Client func (c *Clientset) ReplicationV1() replicationv1.ReplicationV1Interface { return &fakereplicationv1.FakeReplicationV1{Fake: &c.Fake} diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 2f65785ee..1804338cb 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -30,6 +30,7 @@ import ( databasev2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1" schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1" @@ -53,6 +54,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ databasev2alpha1.AddToScheme, mlv1alpha1.AddToScheme, mlv1beta1.AddToScheme, + networkingv1alpha1.AddToScheme, replicationv1.AddToScheme, replicationv2alpha1.AddToScheme, schedulerv1alpha1.AddToScheme, diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index cdaeb9465..3e5ad3944 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -30,6 +30,7 @@ import ( databasev2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1" schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1" @@ -53,6 +54,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ databasev2alpha1.AddToScheme, mlv1alpha1.AddToScheme, mlv1beta1.AddToScheme, + networkingv1alpha1.AddToScheme, replicationv1.AddToScheme, replicationv2alpha1.AddToScheme, schedulerv1alpha1.AddToScheme, diff --git a/pkg/generated/clientset/versioned/typed/networking/v1alpha1/arangoroute.go b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/arangoroute.go new file mode 100644 index 000000000..7713adf9a --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/arangoroute.go @@ -0,0 +1,199 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + scheme "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ArangoRoutesGetter has a method to return a ArangoRouteInterface. +// A group's client should implement this interface. +type ArangoRoutesGetter interface { + ArangoRoutes(namespace string) ArangoRouteInterface +} + +// ArangoRouteInterface has methods to work with ArangoRoute resources. +type ArangoRouteInterface interface { + Create(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.CreateOptions) (*v1alpha1.ArangoRoute, error) + Update(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.UpdateOptions) (*v1alpha1.ArangoRoute, error) + UpdateStatus(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.UpdateOptions) (*v1alpha1.ArangoRoute, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ArangoRoute, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ArangoRouteList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ArangoRoute, err error) + ArangoRouteExpansion +} + +// arangoRoutes implements ArangoRouteInterface +type arangoRoutes struct { + client rest.Interface + ns string +} + +// newArangoRoutes returns a ArangoRoutes +func newArangoRoutes(c *NetworkingV1alpha1Client, namespace string) *arangoRoutes { + return &arangoRoutes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the arangoRoute, and returns the corresponding arangoRoute object, and an error if there is any. +func (c *arangoRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ArangoRoute, err error) { + result = &v1alpha1.ArangoRoute{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoroutes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ArangoRoutes that match those selectors. +func (c *arangoRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ArangoRouteList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ArangoRouteList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested arangoRoutes. +func (c *arangoRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("arangoroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a arangoRoute and creates it. Returns the server's representation of the arangoRoute, and an error, if there is any. +func (c *arangoRoutes) Create(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.CreateOptions) (result *v1alpha1.ArangoRoute, err error) { + result = &v1alpha1.ArangoRoute{} + err = c.client.Post(). + Namespace(c.ns). + Resource("arangoroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoRoute). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a arangoRoute and updates it. Returns the server's representation of the arangoRoute, and an error, if there is any. +func (c *arangoRoutes) Update(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.UpdateOptions) (result *v1alpha1.ArangoRoute, err error) { + result = &v1alpha1.ArangoRoute{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoroutes"). + Name(arangoRoute.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoRoute). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *arangoRoutes) UpdateStatus(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.UpdateOptions) (result *v1alpha1.ArangoRoute, err error) { + result = &v1alpha1.ArangoRoute{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoroutes"). + Name(arangoRoute.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoRoute). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the arangoRoute and deletes it. Returns an error if one occurs. +func (c *arangoRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoroutes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *arangoRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoroutes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched arangoRoute. +func (c *arangoRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ArangoRoute, err error) { + result = &v1alpha1.ArangoRoute{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("arangoroutes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/networking/v1alpha1/doc.go b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/doc.go new file mode 100644 index 000000000..f45dab6c5 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/doc.go @@ -0,0 +1,24 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/doc.go new file mode 100644 index 000000000..cc487d814 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/doc.go @@ -0,0 +1,24 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_arangoroute.go b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_arangoroute.go new file mode 100644 index 000000000..021a9d6f7 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_arangoroute.go @@ -0,0 +1,145 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeArangoRoutes implements ArangoRouteInterface +type FakeArangoRoutes struct { + Fake *FakeNetworkingV1alpha1 + ns string +} + +var arangoroutesResource = v1alpha1.SchemeGroupVersion.WithResource("arangoroutes") + +var arangoroutesKind = v1alpha1.SchemeGroupVersion.WithKind("ArangoRoute") + +// Get takes name of the arangoRoute, and returns the corresponding arangoRoute object, and an error if there is any. +func (c *FakeArangoRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ArangoRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(arangoroutesResource, c.ns, name), &v1alpha1.ArangoRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ArangoRoute), err +} + +// List takes label and field selectors, and returns the list of ArangoRoutes that match those selectors. +func (c *FakeArangoRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ArangoRouteList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(arangoroutesResource, arangoroutesKind, c.ns, opts), &v1alpha1.ArangoRouteList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ArangoRouteList{ListMeta: obj.(*v1alpha1.ArangoRouteList).ListMeta} + for _, item := range obj.(*v1alpha1.ArangoRouteList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested arangoRoutes. +func (c *FakeArangoRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(arangoroutesResource, c.ns, opts)) + +} + +// Create takes the representation of a arangoRoute and creates it. Returns the server's representation of the arangoRoute, and an error, if there is any. +func (c *FakeArangoRoutes) Create(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.CreateOptions) (result *v1alpha1.ArangoRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(arangoroutesResource, c.ns, arangoRoute), &v1alpha1.ArangoRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ArangoRoute), err +} + +// Update takes the representation of a arangoRoute and updates it. Returns the server's representation of the arangoRoute, and an error, if there is any. +func (c *FakeArangoRoutes) Update(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.UpdateOptions) (result *v1alpha1.ArangoRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(arangoroutesResource, c.ns, arangoRoute), &v1alpha1.ArangoRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ArangoRoute), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeArangoRoutes) UpdateStatus(ctx context.Context, arangoRoute *v1alpha1.ArangoRoute, opts v1.UpdateOptions) (*v1alpha1.ArangoRoute, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(arangoroutesResource, "status", c.ns, arangoRoute), &v1alpha1.ArangoRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ArangoRoute), err +} + +// Delete takes name of the arangoRoute and deletes it. Returns an error if one occurs. +func (c *FakeArangoRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(arangoroutesResource, c.ns, name, opts), &v1alpha1.ArangoRoute{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeArangoRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangoroutesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.ArangoRouteList{}) + return err +} + +// Patch applies the patch and returns the patched arangoRoute. +func (c *FakeArangoRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ArangoRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(arangoroutesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ArangoRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ArangoRoute), err +} diff --git a/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_networking_client.go b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_networking_client.go new file mode 100644 index 000000000..1e1794418 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/fake/fake_networking_client.go @@ -0,0 +1,44 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/networking/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeNetworkingV1alpha1 struct { + *testing.Fake +} + +func (c *FakeNetworkingV1alpha1) ArangoRoutes(namespace string) v1alpha1.ArangoRouteInterface { + return &FakeArangoRoutes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeNetworkingV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/clientset/versioned/typed/networking/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..52d86c425 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/generated_expansion.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type ArangoRouteExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/networking/v1alpha1/networking_client.go b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/networking_client.go new file mode 100644 index 000000000..b8a690bff --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/networking/v1alpha1/networking_client.go @@ -0,0 +1,111 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type NetworkingV1alpha1Interface interface { + RESTClient() rest.Interface + ArangoRoutesGetter +} + +// NetworkingV1alpha1Client is used to interact with features provided by the networking.arangodb.com group. +type NetworkingV1alpha1Client struct { + restClient rest.Interface +} + +func (c *NetworkingV1alpha1Client) ArangoRoutes(namespace string) ArangoRouteInterface { + return newArangoRoutes(c, namespace) +} + +// NewForConfig creates a new NetworkingV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*NetworkingV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new NetworkingV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &NetworkingV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new NetworkingV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *NetworkingV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new NetworkingV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *NetworkingV1alpha1Client { + return &NetworkingV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *NetworkingV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index 484ba4ea1..180f55ea6 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -34,6 +34,7 @@ import ( deployment "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/deployment" internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" ml "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/ml" + networking "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/networking" replication "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/replication" scheduler "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/scheduler" storage "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/storage" @@ -269,6 +270,7 @@ type SharedInformerFactory interface { Backup() backup.Interface Database() deployment.Interface Ml() ml.Interface + Networking() networking.Interface Replication() replication.Interface Scheduler() scheduler.Interface Storage() storage.Interface @@ -294,6 +296,10 @@ func (f *sharedInformerFactory) Ml() ml.Interface { return ml.New(f, f.namespace, f.tweakListOptions) } +func (f *sharedInformerFactory) Networking() networking.Interface { + return networking.New(f, f.namespace, f.tweakListOptions) +} + func (f *sharedInformerFactory) Replication() replication.Interface { return replication.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 108f70a45..00f3e40c3 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -32,6 +32,7 @@ import ( v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" mlv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1" schedulerv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1" @@ -117,6 +118,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1beta1.SchemeGroupVersion.WithResource("arangomlstorages"): return &genericInformer{resource: resource.GroupResource(), informer: f.Ml().V1beta1().ArangoMLStorages().Informer()}, nil + // Group=networking.arangodb.com, Version=v1alpha1 + case networkingv1alpha1.SchemeGroupVersion.WithResource("arangoroutes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ArangoRoutes().Informer()}, nil + // Group=replication.database.arangodb.com, Version=v1 case replicationv1.SchemeGroupVersion.WithResource("arangodeploymentreplications"): return &genericInformer{resource: resource.GroupResource(), informer: f.Replication().V1().ArangoDeploymentReplications().Informer()}, nil diff --git a/pkg/generated/informers/externalversions/networking/interface.go b/pkg/generated/informers/externalversions/networking/interface.go new file mode 100644 index 000000000..2013452d9 --- /dev/null +++ b/pkg/generated/informers/externalversions/networking/interface.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by informer-gen. DO NOT EDIT. + +package networking + +import ( + internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/networking/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/generated/informers/externalversions/networking/v1alpha1/arangoroute.go b/pkg/generated/informers/externalversions/networking/v1alpha1/arangoroute.go new file mode 100644 index 000000000..6544ecae6 --- /dev/null +++ b/pkg/generated/informers/externalversions/networking/v1alpha1/arangoroute.go @@ -0,0 +1,94 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + networkingv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/generated/listers/networking/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ArangoRouteInformer provides access to a shared informer and lister for +// ArangoRoutes. +type ArangoRouteInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.ArangoRouteLister +} + +type arangoRouteInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewArangoRouteInformer constructs a new informer for ArangoRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewArangoRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredArangoRouteInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredArangoRouteInformer constructs a new informer for ArangoRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredArangoRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha1().ArangoRoutes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha1().ArangoRoutes(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1alpha1.ArangoRoute{}, + resyncPeriod, + indexers, + ) +} + +func (f *arangoRouteInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredArangoRouteInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *arangoRouteInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1alpha1.ArangoRoute{}, f.defaultInformer) +} + +func (f *arangoRouteInformer) Lister() v1alpha1.ArangoRouteLister { + return v1alpha1.NewArangoRouteLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/networking/v1alpha1/interface.go b/pkg/generated/informers/externalversions/networking/v1alpha1/interface.go new file mode 100644 index 000000000..316876c87 --- /dev/null +++ b/pkg/generated/informers/externalversions/networking/v1alpha1/interface.go @@ -0,0 +1,49 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ArangoRoutes returns a ArangoRouteInformer. + ArangoRoutes() ArangoRouteInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// ArangoRoutes returns a ArangoRouteInformer. +func (v *version) ArangoRoutes() ArangoRouteInformer { + return &arangoRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/generated/listers/networking/v1alpha1/arangoroute.go b/pkg/generated/listers/networking/v1alpha1/arangoroute.go new file mode 100644 index 000000000..737f34c10 --- /dev/null +++ b/pkg/generated/listers/networking/v1alpha1/arangoroute.go @@ -0,0 +1,103 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ArangoRouteLister helps list ArangoRoutes. +// All objects returned here must be treated as read-only. +type ArangoRouteLister interface { + // List lists all ArangoRoutes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.ArangoRoute, err error) + // ArangoRoutes returns an object that can list and get ArangoRoutes. + ArangoRoutes(namespace string) ArangoRouteNamespaceLister + ArangoRouteListerExpansion +} + +// arangoRouteLister implements the ArangoRouteLister interface. +type arangoRouteLister struct { + indexer cache.Indexer +} + +// NewArangoRouteLister returns a new ArangoRouteLister. +func NewArangoRouteLister(indexer cache.Indexer) ArangoRouteLister { + return &arangoRouteLister{indexer: indexer} +} + +// List lists all ArangoRoutes in the indexer. +func (s *arangoRouteLister) List(selector labels.Selector) (ret []*v1alpha1.ArangoRoute, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.ArangoRoute)) + }) + return ret, err +} + +// ArangoRoutes returns an object that can list and get ArangoRoutes. +func (s *arangoRouteLister) ArangoRoutes(namespace string) ArangoRouteNamespaceLister { + return arangoRouteNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ArangoRouteNamespaceLister helps list and get ArangoRoutes. +// All objects returned here must be treated as read-only. +type ArangoRouteNamespaceLister interface { + // List lists all ArangoRoutes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.ArangoRoute, err error) + // Get retrieves the ArangoRoute from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.ArangoRoute, error) + ArangoRouteNamespaceListerExpansion +} + +// arangoRouteNamespaceLister implements the ArangoRouteNamespaceLister +// interface. +type arangoRouteNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ArangoRoutes in the indexer for a given namespace. +func (s arangoRouteNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ArangoRoute, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.ArangoRoute)) + }) + return ret, err +} + +// Get retrieves the ArangoRoute from the indexer for a given namespace and name. +func (s arangoRouteNamespaceLister) Get(name string) (*v1alpha1.ArangoRoute, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("arangoroute"), name) + } + return obj.(*v1alpha1.ArangoRoute), nil +} diff --git a/pkg/generated/listers/networking/v1alpha1/expansion_generated.go b/pkg/generated/listers/networking/v1alpha1/expansion_generated.go new file mode 100644 index 000000000..e0d7ccab7 --- /dev/null +++ b/pkg/generated/listers/networking/v1alpha1/expansion_generated.go @@ -0,0 +1,31 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// ArangoRouteListerExpansion allows custom methods to be added to +// ArangoRouteLister. +type ArangoRouteListerExpansion interface{} + +// ArangoRouteNamespaceListerExpansion allows custom methods to be added to +// ArangoRouteNamespaceLister. +type ArangoRouteNamespaceListerExpansion interface{} diff --git a/pkg/util/k8sutil/inspector/arangoroute/definition.go b/pkg/util/k8sutil/inspector/arangoroute/definition.go new file mode 100644 index 000000000..e78513740 --- /dev/null +++ b/pkg/util/k8sutil/inspector/arangoroute/definition.go @@ -0,0 +1,44 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package arangoroute + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" + v1alpha1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/refresh" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version" +) + +type Inspector interface { + ArangoRoute() Definition +} + +type Definition interface { + refresh.Inspector + + gvk.GK + anonymous.Impl + + Version() version.Version + + V1Alpha1() (v1alpha1.Inspector, error) +} diff --git a/pkg/util/k8sutil/inspector/arangoroute/v1alpha1/loader.go b/pkg/util/k8sutil/inspector/arangoroute/v1alpha1/loader.go new file mode 100644 index 000000000..8fc237eed --- /dev/null +++ b/pkg/util/k8sutil/inspector/arangoroute/v1alpha1/loader.go @@ -0,0 +1,53 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" +) + +type Inspector interface { + gvk.GVK + + ListSimple() []*networkingApi.ArangoRoute + GetSimple(name string) (*networkingApi.ArangoRoute, bool) + Filter(filters ...Filter) []*networkingApi.ArangoRoute + Iterate(action Action, filters ...Filter) error + Read() ReadInterface +} + +type Filter func(at *networkingApi.ArangoRoute) bool +type Action func(at *networkingApi.ArangoRoute) error + +func FilterObject(at *networkingApi.ArangoRoute, filters ...Filter) bool { + for _, f := range filters { + if f == nil { + continue + } + + if !f(at) { + return false + } + } + + return true +} diff --git a/pkg/util/k8sutil/inspector/arangoroute/v1alpha1/reader.go b/pkg/util/k8sutil/inspector/arangoroute/v1alpha1/reader.go new file mode 100644 index 000000000..bd51d3ef6 --- /dev/null +++ b/pkg/util/k8sutil/inspector/arangoroute/v1alpha1/reader.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + "context" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" +) + +// ModInterface has methods to work with ArangoTask resources only for creation +type ModInterface interface { + Create(ctx context.Context, arangotask *networkingApi.ArangoRoute, opts meta.CreateOptions) (*networkingApi.ArangoRoute, error) + Update(ctx context.Context, arangotask *networkingApi.ArangoRoute, opts meta.UpdateOptions) (*networkingApi.ArangoRoute, error) + UpdateStatus(ctx context.Context, arangotask *networkingApi.ArangoRoute, opts meta.UpdateOptions) (*networkingApi.ArangoRoute, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result *networkingApi.ArangoRoute, err error) + Delete(ctx context.Context, name string, opts meta.DeleteOptions) error +} + +// Interface has methods to work with ArangoTask resources. +type Interface interface { + ModInterface + ReadInterface +} + +// ReadInterface has methods to work with ArangoTask resources with ReadOnly mode. +type ReadInterface interface { + Get(ctx context.Context, name string, opts meta.GetOptions) (*networkingApi.ArangoRoute, error) +} diff --git a/pkg/util/k8sutil/inspector/constants/ar_constants.go b/pkg/util/k8sutil/inspector/constants/ar_constants.go new file mode 100644 index 000000000..13541bd93 --- /dev/null +++ b/pkg/util/k8sutil/inspector/constants/ar_constants.go @@ -0,0 +1,66 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package constants + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/networking" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" +) + +// ArangoRoute +const ( + ArangoRouteGroup = networking.ArangoNetworkingGroupName + ArangoRouteResource = networking.ArangoRouteResourcePlural + ArangoRouteKind = networking.ArangoRouteResourceKind + ArangoRouteVersionV1Alpha1 = networkingApi.ArangoNetworkingVersion +) + +func ArangoRouteGK() schema.GroupKind { + return schema.GroupKind{ + Group: ArangoRouteGroup, + Kind: ArangoRouteKind, + } +} + +func ArangoRouteGKv1() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: ArangoRouteGroup, + Kind: ArangoRouteKind, + Version: ArangoRouteVersionV1Alpha1, + } +} + +func ArangoRouteGR() schema.GroupResource { + return schema.GroupResource{ + Group: ArangoRouteGroup, + Resource: ArangoRouteResource, + } +} + +func ArangoRouteGRv1() schema.GroupVersionResource { + return schema.GroupVersionResource{ + Group: ArangoRouteGroup, + Resource: ArangoRouteResource, + Version: ArangoRouteVersionV1Alpha1, + } +} diff --git a/pkg/util/k8sutil/inspector/definitions/components.go b/pkg/util/k8sutil/inspector/definitions/components.go index 14974cc8f..af4b8c115 100644 --- a/pkg/util/k8sutil/inspector/definitions/components.go +++ b/pkg/util/k8sutil/inspector/definitions/components.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ const ( ArangoClusterSynchronization Component = "ArangoClusterSynchronization" ArangoMember Component = "ArangoMember" ArangoTask Component = "ArangoTask" + ArangoRoute Component = "ArangoRoute" Node Component = "Node" PersistentVolume Component = "PersistentVolume" PersistentVolumeClaim Component = "PersistentVolumeClaim" @@ -45,6 +46,7 @@ func AllComponents() []Component { ArangoClusterSynchronization, ArangoMember, ArangoTask, + ArangoRoute, Node, PersistentVolume, PersistentVolumeClaim, diff --git a/pkg/util/k8sutil/inspector/inspector.go b/pkg/util/k8sutil/inspector/inspector.go index d799af6c1..763c37643 100644 --- a/pkg/util/k8sutil/inspector/inspector.go +++ b/pkg/util/k8sutil/inspector/inspector.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangodeployment" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/mods" @@ -90,6 +91,7 @@ type Inspector interface { persistentvolume.Inspector arangoclustersynchronization.Inspector arangotask.Inspector + arangoroute.Inspector mods.Mods diff --git a/pkg/util/k8sutil/inspector/mods/mods.go b/pkg/util/k8sutil/inspector/mods/mods.go index b33336967..e5bfc6e23 100644 --- a/pkg/util/k8sutil/inspector/mods/mods.go +++ b/pkg/util/k8sutil/inspector/mods/mods.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ package mods import ( arangoclustersynchronizationv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization/v1" arangomemberv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember/v1" + arangoroutev1alpha1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute/v1alpha1" arangotaskv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask/v1" endpointsv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints/v1" persistentvolumeclaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" @@ -78,6 +79,10 @@ type ArangoClusterSynchronizationMods interface { V1() arangoclustersynchronizationv1.ModInterface } +type ArangoRouteMods interface { + V1Alpha1() arangoroutev1alpha1.ModInterface +} + type Mods interface { PodsModInterface() PodsMods ServiceAccountsModInterface() ServiceAccountsMods @@ -91,4 +96,5 @@ type Mods interface { ArangoMemberModInterface() ArangoMemberMods ArangoTaskModInterface() ArangoTaskMods ArangoClusterSynchronizationModInterface() ArangoClusterSynchronizationMods + ArangoRouteModInterface() ArangoRouteMods } diff --git a/pkg/util/k8sutil/inspector/throttle/throttle.go b/pkg/util/k8sutil/inspector/throttle/throttle.go index 0095355fa..96bacf9f2 100644 --- a/pkg/util/k8sutil/inspector/throttle/throttle.go +++ b/pkg/util/k8sutil/inspector/throttle/throttle.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,14 +32,15 @@ type Inspector interface { } func NewAlwaysThrottleComponents() Components { - return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) } -func NewThrottleComponents(acs, am, at, node, pvc, pod, pv, pdb, secret, service, serviceAccount, sm, endpoints time.Duration) Components { +func NewThrottleComponents(acs, am, at, ar, node, pvc, pod, pv, pdb, secret, service, serviceAccount, sm, endpoints time.Duration) Components { return &throttleComponents{ arangoClusterSynchronization: NewThrottle(acs), arangoMember: NewThrottle(am), arangoTask: NewThrottle(at), + arangoRoute: NewThrottle(ar), node: NewThrottle(node), persistentVolume: NewThrottle(pv), persistentVolumeClaim: NewThrottle(pvc), @@ -57,6 +58,7 @@ type Components interface { ArangoClusterSynchronization() Throttle ArangoMember() Throttle ArangoTask() Throttle + ArangoRoute() Throttle Node() Throttle PersistentVolume() Throttle PersistentVolumeClaim() Throttle @@ -79,6 +81,7 @@ type throttleComponents struct { arangoClusterSynchronization Throttle arangoMember Throttle arangoTask Throttle + arangoRoute Throttle node Throttle persistentVolume Throttle persistentVolumeClaim Throttle @@ -126,6 +129,8 @@ func (t *throttleComponents) Get(c definitions.Component) Throttle { return t.arangoMember case definitions.ArangoTask: return t.arangoTask + case definitions.ArangoRoute: + return t.arangoRoute case definitions.Node: return t.node case definitions.PersistentVolume: @@ -156,6 +161,7 @@ func (t *throttleComponents) Copy() Components { arangoClusterSynchronization: t.arangoClusterSynchronization.Copy(), arangoMember: t.arangoMember.Copy(), arangoTask: t.arangoTask.Copy(), + arangoRoute: t.arangoRoute.Copy(), node: t.node.Copy(), persistentVolume: t.persistentVolume.Copy(), persistentVolumeClaim: t.persistentVolumeClaim.Copy(), @@ -181,6 +187,10 @@ func (t *throttleComponents) ArangoTask() Throttle { return t.arangoTask } +func (t *throttleComponents) ArangoRoute() Throttle { + return t.arangoRoute +} + func (t *throttleComponents) Node() Throttle { return t.node } From ee5ea98638a382bad86c4f40aabed1583adfe7f2 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:53:48 +0300 Subject: [PATCH 03/50] [Feature] ArangoRoute RC (#1690) --- .circleci/continue_config.yml | 2 +- CHANGELOG.md | 1 + Makefile | 2 +- README.md | 3 +- .../templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 ++ .../networking-operator/cluster-role.yaml | 22 + .../networking-operator/role-binding.yaml | 25 ++ .../templates/networking-operator/role.yaml | 68 +++ .../templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 ++ .../networking-operator/cluster-role.yaml | 22 + .../networking-operator/role-binding.yaml | 25 ++ .../templates/networking-operator/role.yaml | 68 +++ .../templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 ++ .../networking-operator/cluster-role.yaml | 22 + .../networking-operator/role-binding.yaml | 25 ++ .../templates/networking-operator/role.yaml | 68 +++ chart/kube-arangodb/templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 ++ .../networking-operator/cluster-role.yaml | 22 + .../networking-operator/role-binding.yaml | 25 ++ .../templates/networking-operator/role.yaml | 68 +++ chart/kube-arangodb/values.yaml | 1 + cmd/cmd.go | 18 +- docs/api/ArangoRoute.V1Alpha1.md | 50 ++- .../generator_pkg_operatorv2_handlers.go.tmpl | 49 ++ internal/generators/generator_test.go | 90 ++++ pkg/apis/networking/v1alpha1/conditions.go | 30 ++ pkg/apis/networking/v1alpha1/route_spec.go | 23 +- .../v1alpha1/route_spec_destination.go | 36 +- .../route_spec_destination_service.go | 18 +- .../v1alpha1/route_spec_destination_tls.go | 10 +- .../networking/v1alpha1/route_spec_route.go | 14 +- pkg/apis/networking/v1alpha1/route_status.go | 11 +- .../v1alpha1/route_status_target.go | 44 ++ .../v1alpha1/route_status_target_tls.go | 36 ++ .../v1alpha1/zz_generated.deepcopy.go | 68 +++ pkg/apis/shared/validate.go | 35 +- .../networking-route.schema.generated.yaml | 2 +- pkg/handlers/networking/route/handler.go | 123 +++++ .../networking/route/handler_deployment.go | 82 ++++ .../route/handler_deployment_test.go | 145 ++++++ .../networking/route/handler_destination.go | 171 +++++++ .../route/handler_destination_test.go | 422 ++++++++++++++++++ pkg/handlers/networking/route/handler_test.go | 59 +++ pkg/handlers/networking/route/local.go | 38 ++ pkg/handlers/networking/route/register.go | 60 +++ pkg/handlers/networking/route/suite_test.go | 61 +++ pkg/operator/operator.go | 40 +- pkg/operatorV2/handle.go | 247 +--------- pkg/operatorV2/handler_p0.generated.go | 70 +++ pkg/operatorV2/handler_p1.generated.go | 70 +++ pkg/operatorV2/handler_p2.generated.go | 70 +++ pkg/operatorV2/handler_p3.generated.go | 70 +++ pkg/operatorV2/handler_p4.generated.go | 70 +++ pkg/operatorV2/handler_p5.generated.go | 70 +++ pkg/operatorV2/handler_p6.generated.go | 70 +++ pkg/operatorV2/handler_p7.generated.go | 70 +++ pkg/operatorV2/handler_p8.generated.go | 70 +++ pkg/operatorV2/handler_p9.generated.go | 70 +++ pkg/operatorV2/update_wraps.go | 5 + pkg/server/server.go | 5 + pkg/util/checksum.go | 20 + pkg/util/constants/constants.go | 1 + pkg/util/dict.go | 10 +- pkg/util/list.go | 38 +- pkg/util/tests/kubernetes.go | 48 ++ pkg/util/tests/kubernetes_test.go | 2 + 70 files changed, 3119 insertions(+), 277 deletions(-) create mode 100644 chart/kube-arangodb-arm64/templates/networking-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb-arm64/templates/networking-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb-arm64/templates/networking-operator/role-binding.yaml create mode 100644 chart/kube-arangodb-arm64/templates/networking-operator/role.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/networking-operator/role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/networking-operator/role.yaml create mode 100644 chart/kube-arangodb/templates/networking-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb/templates/networking-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb/templates/networking-operator/role-binding.yaml create mode 100644 chart/kube-arangodb/templates/networking-operator/role.yaml create mode 100644 internal/generators/generator_pkg_operatorv2_handlers.go.tmpl create mode 100644 internal/generators/generator_test.go create mode 100644 pkg/apis/networking/v1alpha1/conditions.go create mode 100644 pkg/apis/networking/v1alpha1/route_status_target.go create mode 100644 pkg/apis/networking/v1alpha1/route_status_target_tls.go create mode 100644 pkg/handlers/networking/route/handler.go create mode 100644 pkg/handlers/networking/route/handler_deployment.go create mode 100644 pkg/handlers/networking/route/handler_deployment_test.go create mode 100644 pkg/handlers/networking/route/handler_destination.go create mode 100644 pkg/handlers/networking/route/handler_destination_test.go create mode 100644 pkg/handlers/networking/route/handler_test.go create mode 100644 pkg/handlers/networking/route/local.go create mode 100644 pkg/handlers/networking/route/register.go create mode 100644 pkg/handlers/networking/route/suite_test.go create mode 100644 pkg/operatorV2/handler_p0.generated.go create mode 100644 pkg/operatorV2/handler_p1.generated.go create mode 100644 pkg/operatorV2/handler_p2.generated.go create mode 100644 pkg/operatorV2/handler_p3.generated.go create mode 100644 pkg/operatorV2/handler_p4.generated.go create mode 100644 pkg/operatorV2/handler_p5.generated.go create mode 100644 pkg/operatorV2/handler_p6.generated.go create mode 100644 pkg/operatorV2/handler_p7.generated.go create mode 100644 pkg/operatorV2/handler_p8.generated.go create mode 100644 pkg/operatorV2/handler_p9.generated.go diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml index ec51f73e0..0e49e7fff 100644 --- a/.circleci/continue_config.yml +++ b/.circleci/continue_config.yml @@ -84,7 +84,7 @@ jobs: echo "This is not a pull request. Skipping..." exit 0 fi - make tidy update-generated synchronize-v2alpha1-with-v1 generate-internal sync fmt yamlfmt + make tidy update-generated synchronize-v2alpha1-with-v1 generate-internal sync fmt yamlfmt license git checkout -- go.sum # ignore changes in go.sum if [ ! -z "$(git status --porcelain)" ]; then echo "There are uncommited changes!" diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d9770dd..bc318d1d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) - (Feature) ArangoRoute CRD +- (Feature) ArangoRoute Operator ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index b82382f3a..6e9106f98 100644 --- a/Makefile +++ b/Makefile @@ -777,7 +777,7 @@ tools-min: update-vendor .PHONY: tools tools: tools-min @echo ">> Fetching gci" - @GOBIN=$(GOPATH)/bin go install github.com/daixiang0/gci@v0.3.0 + @GOBIN=$(GOPATH)/bin go install github.com/daixiang0/gci@v0.13.4 @echo ">> Fetching yamlfmt" @GOBIN=$(GOPATH)/bin go install github.com/google/yamlfmt/cmd/yamlfmt@v0.10.0 @echo ">> Downloading protobuf compiler..." diff --git a/README.md b/README.md index 634034fa6..ddcded77c 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integrations, k8s-client, monitor, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integrations, k8s-client, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes @@ -192,6 +192,7 @@ Flags: --operator.deployment Enable to run the ArangoDeployment operator --operator.deployment-replication Enable to run the ArangoDeploymentReplication operator --operator.ml Enable to run the ArangoML operator + --operator.networking Enable to run the Networking operator --operator.reconciliation.retry.count int Count of retries during Object Update operations in the Reconciliation loop (default 25) --operator.reconciliation.retry.delay duration Delay between Object Update operations in the Reconciliation loop (default 1s) --operator.storage Enable to run the ArangoLocalStorage operator diff --git a/chart/kube-arangodb-arm64/templates/deployment.yaml b/chart/kube-arangodb-arm64/templates/deployment.yaml index 51b35d9a7..49958189d 100644 --- a/chart/kube-arangodb-arm64/templates/deployment.yaml +++ b/chart/kube-arangodb-arm64/templates/deployment.yaml @@ -117,6 +117,9 @@ spec: {{ if .Values.operator.features.analytics }} - --operator.analytics {{- end }} +{{ if .Values.operator.features.networking }} + - --operator.networking +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb-arm64/templates/networking-operator/cluster-role-binding.yaml b/chart/kube-arangodb-arm64/templates/networking-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..ece410ff9 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/networking-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-arm64/templates/networking-operator/cluster-role.yaml b/chart/kube-arangodb-arm64/templates/networking-operator/cluster-role.yaml new file mode 100644 index 000000000..45840ac01 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/networking-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-arm64/templates/networking-operator/role-binding.yaml b/chart/kube-arangodb-arm64/templates/networking-operator/role-binding.yaml new file mode 100644 index 000000000..29802d1d8 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/networking-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-arm64/templates/networking-operator/role.yaml b/chart/kube-arangodb-arm64/templates/networking-operator/role.yaml new file mode 100644 index 000000000..38339a312 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/networking-operator/role.yaml @@ -0,0 +1,68 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml b/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml index 51b35d9a7..49958189d 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml @@ -117,6 +117,9 @@ spec: {{ if .Values.operator.features.analytics }} - --operator.analytics {{- end }} +{{ if .Values.operator.features.networking }} + - --operator.networking +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role-binding.yaml b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..ece410ff9 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role.yaml new file mode 100644 index 000000000..45840ac01 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role-binding.yaml b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role-binding.yaml new file mode 100644 index 000000000..29802d1d8 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role.yaml new file mode 100644 index 000000000..38339a312 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/networking-operator/role.yaml @@ -0,0 +1,68 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/deployment.yaml b/chart/kube-arangodb-enterprise/templates/deployment.yaml index 51b35d9a7..49958189d 100644 --- a/chart/kube-arangodb-enterprise/templates/deployment.yaml +++ b/chart/kube-arangodb-enterprise/templates/deployment.yaml @@ -117,6 +117,9 @@ spec: {{ if .Values.operator.features.analytics }} - --operator.analytics {{- end }} +{{ if .Values.operator.features.networking }} + - --operator.networking +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role-binding.yaml b/chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..ece410ff9 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role.yaml b/chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role.yaml new file mode 100644 index 000000000..45840ac01 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/networking-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/networking-operator/role-binding.yaml b/chart/kube-arangodb-enterprise/templates/networking-operator/role-binding.yaml new file mode 100644 index 000000000..29802d1d8 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/networking-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/networking-operator/role.yaml b/chart/kube-arangodb-enterprise/templates/networking-operator/role.yaml new file mode 100644 index 000000000..38339a312 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/networking-operator/role.yaml @@ -0,0 +1,68 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/deployment.yaml b/chart/kube-arangodb/templates/deployment.yaml index 51b35d9a7..49958189d 100644 --- a/chart/kube-arangodb/templates/deployment.yaml +++ b/chart/kube-arangodb/templates/deployment.yaml @@ -117,6 +117,9 @@ spec: {{ if .Values.operator.features.analytics }} - --operator.analytics {{- end }} +{{ if .Values.operator.features.networking }} + - --operator.networking +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb/templates/networking-operator/cluster-role-binding.yaml b/chart/kube-arangodb/templates/networking-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..ece410ff9 --- /dev/null +++ b/chart/kube-arangodb/templates/networking-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/networking-operator/cluster-role.yaml b/chart/kube-arangodb/templates/networking-operator/cluster-role.yaml new file mode 100644 index 000000000..45840ac01 --- /dev/null +++ b/chart/kube-arangodb/templates/networking-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-networking + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/networking-operator/role-binding.yaml b/chart/kube-arangodb/templates/networking-operator/role-binding.yaml new file mode 100644 index 000000000..29802d1d8 --- /dev/null +++ b/chart/kube-arangodb/templates/networking-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-networking +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/networking-operator/role.yaml b/chart/kube-arangodb/templates/networking-operator/role.yaml new file mode 100644 index 000000000..38339a312 --- /dev/null +++ b/chart/kube-arangodb/templates/networking-operator/role.yaml @@ -0,0 +1,68 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.networking -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-networking + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/values.yaml b/chart/kube-arangodb/values.yaml index 0ec2b19b7..98ac2e00f 100644 --- a/chart/kube-arangodb/values.yaml +++ b/chart/kube-arangodb/values.yaml @@ -34,6 +34,7 @@ operator: k8sToK8sClusterSync: false ml: false analytics: false + networking: true tolerations: [] rbac: enabled: true diff --git a/cmd/cmd.go b/cmd/cmd.go index b557e5e12..bafe078fa 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -119,6 +119,7 @@ var ( enableApps bool // Run apps operator enableML bool // Run ml operator enableAnalytics bool // Run analytics operator + enableNetworking bool // Run networking operator versionOnly bool // Run only version endpoint, explicitly disabled with other enableK2KClusterSync bool // Run k2kClusterSync operator @@ -184,6 +185,7 @@ var ( appsProbe probe.ReadyProbe mlProbe probe.ReadyProbe analyticsProbe probe.ReadyProbe + networkingProbe probe.ReadyProbe k2KClusterSyncProbe probe.ReadyProbe ) @@ -210,6 +212,7 @@ func init() { f.BoolVar(&operatorOptions.enableApps, "operator.apps", false, "Enable to run the ArangoApps operator") f.BoolVar(&operatorOptions.enableML, "operator.ml", false, "Enable to run the ArangoML operator") f.BoolVar(&operatorOptions.enableAnalytics, "operator.analytics", false, "Enable to run the Analytics operator") + f.BoolVar(&operatorOptions.enableNetworking, "operator.networking", false, "Enable to run the Networking operator") f.BoolVar(&operatorOptions.enableK2KClusterSync, "operator.k2k-cluster-sync", false, "Enable to run the ListSimple operator") f.MarkDeprecated("operator.k2k-cluster-sync", "Enabled within deployment operator") f.BoolVar(&operatorOptions.versionOnly, "operator.version", false, "Enable only version endpoint in Operator") @@ -345,16 +348,17 @@ func executeMain(cmd *cobra.Command, args []string) { // Check operating mode if !operatorOptions.enableDeployment && !operatorOptions.enableDeploymentReplication && !operatorOptions.enableStorage && - !operatorOptions.enableBackup && !operatorOptions.enableApps && !operatorOptions.enableK2KClusterSync && !operatorOptions.enableML && !operatorOptions.enableAnalytics { + !operatorOptions.enableBackup && !operatorOptions.enableApps && !operatorOptions.enableK2KClusterSync && + !operatorOptions.enableML && !operatorOptions.enableAnalytics && !operatorOptions.enableNetworking { if !operatorOptions.versionOnly { if version.GetVersionV1().IsEnterprise() { - logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.ml, --operator.analytics or any combination of these") + logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.ml, --operator.analytics, --operator.networking or any combination of these") } else { - logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync or any combination of these") + logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.networking or any combination of these") } } } else if operatorOptions.versionOnly { - logger.Fatal("Options --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.ml, --operator.analytics cannot be enabled together with --operator.version") + logger.Fatal("Options --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.ml, --operator.analytics, --operator.networking cannot be enabled together with --operator.version") } else if !version.GetVersionV1().IsEnterprise() { if operatorOptions.enableML || operatorOptions.enableAnalytics { logger.Fatal("Options --operator.ml, --operator.analytics can be enabled only on the Enterprise Operator") @@ -492,6 +496,10 @@ func executeMain(cmd *cobra.Command, args []string) { Enabled: cfg.EnableAnalytics, Probe: &analyticsProbe, }, + Networking: server.OperatorDependency{ + Enabled: cfg.EnableNetworking, + Probe: &analyticsProbe, + }, ClusterSync: server.OperatorDependency{ Enabled: cfg.EnableK2KClusterSync, Probe: &k2KClusterSyncProbe, @@ -576,6 +584,7 @@ func newOperatorConfigAndDeps(id, namespace, name string) (operator.Config, oper EnableApps: operatorOptions.enableApps, EnableML: operatorOptions.enableML, EnableAnalytics: operatorOptions.enableAnalytics, + EnableNetworking: operatorOptions.enableNetworking, EnableK2KClusterSync: operatorOptions.enableK2KClusterSync, AllowChaos: chaosOptions.allowed, ScalingIntegrationEnabled: operatorOptions.scalingIntegrationEnabled, @@ -596,6 +605,7 @@ func newOperatorConfigAndDeps(id, namespace, name string) (operator.Config, oper AppsProbe: &appsProbe, MlProbe: &mlProbe, AnalyticsProbe: &analyticsProbe, + NetworkingProbe: &networkingProbe, K2KClusterSyncProbe: &k2KClusterSyncProbe, } diff --git a/docs/api/ArangoRoute.V1Alpha1.md b/docs/api/ArangoRoute.V1Alpha1.md index f0e148992..63e46c1b4 100644 --- a/docs/api/ArangoRoute.V1Alpha1.md +++ b/docs/api/ArangoRoute.V1Alpha1.md @@ -12,7 +12,7 @@ title: ArangoRoute V1Alpha1 Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec.go#L27) -Deployment specifies the ArangoDeployment object name +DeploymentName specifies the ArangoDeployment object name *** @@ -85,7 +85,53 @@ Path specifies the Path route ### .status.conditions -Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status.go#L28) +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status.go#L31) Conditions specific to the entire extension +*** + +### .status.deployment.checksum + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) + +UID keeps the information about object Checksum + +*** + +### .status.deployment.name + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) + +Name of the object + +*** + +### .status.deployment.namespace + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) + +Namespace of the object. Should default to the namespace of the parent object + +*** + +### .status.deployment.uid + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) + +UID keeps the information about object UID + +*** + +### .status.targets\[int\].tls.insecure + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_tls.go#L27) + +Insecure allows Insecure traffic + +*** + +### .status.targets\[int\].url + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L34) + diff --git a/internal/generators/generator_pkg_operatorv2_handlers.go.tmpl b/internal/generators/generator_pkg_operatorv2_handlers.go.tmpl new file mode 100644 index 000000000..2ac7759ea --- /dev/null +++ b/internal/generators/generator_pkg_operatorv2_handlers.go.tmpl @@ -0,0 +1,49 @@ +package operator + +import ( + "context" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP{{ .id }}Func{{ .templateVars }} func(ctx context.Context {{- if .inputVars }}, {{ .inputVars }}{{ end }}) (bool, error) + +type HandleP{{ .id }}ConditionFunc{{ .templateVars }} func(ctx context.Context {{- if .inputVars }}, {{ .inputVars }}{{ end }}) (*Condition, bool, error) + +type HandleP{{ .id }}ConditionExtract{{ .templateVars }} func(ctx context.Context {{- if .inputVars }}, {{ .inputVars }}{{ end }}) *api.ConditionList + +func HandleP{{ .id }}{{ .templateVars }}(ctx context.Context{{- if .inputVars }}, {{ .inputVars }}{{ end }}, handler ...HandleP{{ .id }}Func{{ .templateInputVars }}) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx{{- if .cleanRefs }}, {{ .cleanRefs }}{{ end }}) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP{{ .id }}WithStop{{ .templateVars }}(ctx context.Context{{- if .inputVars }}, {{ .inputVars }}{{ end }}, handler ...HandleP{{ .id }}Func{{ .templateInputVars }}) (bool, error) { + changed, err := HandleP{{ .id }}{{ .templateInputVars }}(ctx {{- if .cleanRefs }}, {{ .cleanRefs }}{{ end }}, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP{{ .id }}WithCondition{{ .templateVars }}(ctx context.Context, conditions *api.ConditionList, condition api.ConditionType{{- if .inputVars }}, {{ .inputVars }}{{ end }}, handler ...HandleP{{ .id }}Func{{ .templateInputVars }}) (bool, error) { + changed, err := HandleP{{ .id }}{{ .templateInputVars }}(ctx{{- if .cleanRefs }}, {{ .cleanRefs }}{{ end }}, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP{{ .id }}Condition{{ .templateVars }}(extract HandleP{{ .id }}ConditionExtract{{ .templateInputVars }}, condition api.ConditionType, handler HandleP{{ .id }}ConditionFunc{{ .templateInputVars }}) HandleP{{ .id }}Func{{ .templateInputVars }} { + return func(ctx context.Context {{- if .inputVars }}, {{ .inputVars }}{{ end }}) (bool, error) { + c, changed, err := handler(ctx{{- if .cleanRefs }}, {{ .cleanRefs }}{{ end }}) + return WithConditionChange(extract(ctx{{- if .cleanRefs }}, {{ .cleanRefs }}{{ end }}), condition, c, changed, err) + } +} diff --git a/internal/generators/generator_test.go b/internal/generators/generator_test.go new file mode 100644 index 000000000..22476f3ce --- /dev/null +++ b/internal/generators/generator_test.go @@ -0,0 +1,90 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package generators + +import ( + _ "embed" + "fmt" + "os" + "path" + "testing" + "text/template" + + "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/strings" +) + +//go:embed generator_pkg_operatorv2_handlers.go.tmpl +var generatorPKGOperatorV2Handlers []byte + +func Test_Generate_PKG_OperatorV2_Handlers(t *testing.T) { + root := os.Getenv("ROOT") + require.NotEmpty(t, root) + + i, err := template.New("metrics").Parse(string(generatorPKGOperatorV2Handlers)) + require.NoError(t, err) + + for id := 0; id < 10; id++ { + t.Run(fmt.Sprintf("%d", id), func(t *testing.T) { + out, err := os.OpenFile(path.Join(root, "pkg/operatorV2", fmt.Sprintf("handler_p%d.generated.go", id)), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) + require.NoError(t, err) + + var params []string + + for z := 0; z < id; z++ { + params = append(params, fmt.Sprintf("P%d", z+1)) + } + + cleanVars := strings.Join(params, ", ") + + cleanRefs := strings.Join(util.FormatList(params, func(a string) string { + return strings.ToLower(a) + }), ", ") + + templateVars := strings.Join(params, ", ") + templateInputVars := strings.Join(params, ", ") + inputVars := strings.Join(util.FormatList(params, func(a string) string { + return fmt.Sprintf("%s %s", strings.ToLower(a), a) + }), ", ") + + if templateVars != "" { + templateVars = fmt.Sprintf("[%s any]", templateVars) + } + + if templateInputVars != "" { + templateInputVars = fmt.Sprintf("[%s]", templateInputVars) + } + + require.NoError(t, i.Execute(out, map[string]interface{}{ + "id": id, + "templateVars": templateVars, + "templateInputVars": templateInputVars, + "inputVars": inputVars, + "cleanVars": cleanVars, + "cleanRefs": cleanRefs, + })) + + require.NoError(t, out.Close()) + }) + } +} diff --git a/pkg/apis/networking/v1alpha1/conditions.go b/pkg/apis/networking/v1alpha1/conditions.go new file mode 100644 index 000000000..12866c304 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/conditions.go @@ -0,0 +1,30 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + +const ( + ReadyCondition api.ConditionType = "Ready" + DeploymentFoundCondition api.ConditionType = "DeploymentFound" + DestinationValidCondition api.ConditionType = "DestinationValid" + SpecValidCondition api.ConditionType = "SpecValid" +) diff --git a/pkg/apis/networking/v1alpha1/route_spec.go b/pkg/apis/networking/v1alpha1/route_spec.go index d98caf3ca..a51f5eba2 100644 --- a/pkg/apis/networking/v1alpha1/route_spec.go +++ b/pkg/apis/networking/v1alpha1/route_spec.go @@ -23,8 +23,8 @@ package v1alpha1 import shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" type ArangoRouteSpec struct { - // Deployment specifies the ArangoDeployment object name - Deployment string `json:"deployment,omitempty"` + // DeploymentName specifies the ArangoDeployment object name + DeploymentName *string `json:"deployment,omitempty"` // Destination defines the route destination Destination *ArangoRouteSpecDestination `json:"destination,omitempty"` @@ -33,15 +33,30 @@ type ArangoRouteSpec struct { Route *ArangoRouteSpecRoute `json:"route,omitempty"` } +func (s *ArangoRouteSpec) GetDestination() *ArangoRouteSpecDestination { + if s == nil || s.Destination == nil { + return nil + } + + return s.Destination +} + +func (s *ArangoRouteSpec) GetRoute() *ArangoRouteSpecRoute { + if s == nil || s.Route == nil { + return nil + } + return s.Route +} + func (s *ArangoRouteSpec) Validate() error { if s == nil { s = &ArangoRouteSpec{} } if err := shared.WithErrors(shared.PrefixResourceErrors("spec", - shared.PrefixResourceError("deployment", shared.ValidateResourceName(s.Deployment)), + shared.PrefixResourceErrors("deployment", shared.ValidateResourceNamePointer(s.DeploymentName)), shared.ValidateRequiredInterfacePath("destination", s.Destination), - shared.ValidateRequiredInterfacePath("route", s.Route), + shared.ValidateOptionalInterfacePath("route", s.Route), )); err != nil { return err } diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination.go b/pkg/apis/networking/v1alpha1/route_spec_destination.go index e491bea21..c8dbb6a74 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination.go @@ -33,15 +33,39 @@ type ArangoRouteSpecDestination struct { TLS *ArangoRouteSpecDestinationTLS `json:"tls,omitempty"` } -func (s *ArangoRouteSpecDestination) Validate() error { - if s == nil { - s = &ArangoRouteSpecDestination{} +func (s *ArangoRouteSpecDestination) GetService() *ArangoRouteSpecDestinationService { + if s == nil || s.Service == nil { + return nil + } + + return s.Service +} + +func (s *ArangoRouteSpecDestination) GetSchema() *ArangoRouteSpecDestinationSchema { + if s == nil || s.Schema == nil { + return nil + } + + return s.Schema +} + +func (s *ArangoRouteSpecDestination) GetTLS() *ArangoRouteSpecDestinationTLS { + if s == nil || s.TLS == nil { + return nil + } + + return s.TLS +} + +func (a *ArangoRouteSpecDestination) Validate() error { + if a == nil { + a = &ArangoRouteSpecDestination{} } if err := shared.WithErrors( - shared.ValidateOptionalInterfacePath("service", s.Service), - shared.ValidateOptionalInterfacePath("schema", s.Schema), - shared.ValidateOptionalInterfacePath("tls", s.TLS), + shared.ValidateOptionalInterfacePath("service", a.Service), + shared.ValidateOptionalInterfacePath("schema", a.Schema), + shared.ValidateOptionalInterfacePath("tls", a.TLS), ); err != nil { return err } diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_service.go b/pkg/apis/networking/v1alpha1/route_spec_destination_service.go index af55e3edc..9b2c0d9f4 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination_service.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_service.go @@ -36,12 +36,22 @@ type ArangoRouteSpecDestinationService struct { Port *intstr.IntOrString `json:"port,omitempty"` } -func (s *ArangoRouteSpecDestinationService) Validate() error { - if s == nil { - s = &ArangoRouteSpecDestinationService{} +func (a *ArangoRouteSpecDestinationService) GetPort() *intstr.IntOrString { + if a == nil || a.Port == nil { + return nil } - if err := shared.WithErrors(s.Object.Validate()); err != nil { + return a.Port +} + +func (a *ArangoRouteSpecDestinationService) Validate() error { + if a == nil { + a = &ArangoRouteSpecDestinationService{} + } + + if err := shared.WithErrors(a.Object.Validate(), shared.ValidateRequiredPath("port", a.Port, func(i intstr.IntOrString) error { + return nil + })); err != nil { return err } diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go b/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go index e5fdb3449..e5b2750f5 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go @@ -25,6 +25,14 @@ type ArangoRouteSpecDestinationTLS struct { Insecure *bool `json:"insecure,omitempty"` } -func (s *ArangoRouteSpecDestinationTLS) Validate() error { +func (a *ArangoRouteSpecDestinationTLS) GetInsecure() bool { + if a == nil || a.Insecure == nil { + return false + } + + return true +} + +func (a *ArangoRouteSpecDestinationTLS) Validate() error { return nil } diff --git a/pkg/apis/networking/v1alpha1/route_spec_route.go b/pkg/apis/networking/v1alpha1/route_spec_route.go index 018396094..9537b6abd 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_route.go +++ b/pkg/apis/networking/v1alpha1/route_spec_route.go @@ -29,21 +29,21 @@ type ArangoRouteSpecRoute struct { Path *string `json:"path,omitempty"` } -func (s *ArangoRouteSpecRoute) GetPath() string { - if s == nil && s.Path == nil { +func (a *ArangoRouteSpecRoute) GetPath() string { + if a == nil || a.Path == nil { return "/" } - return *s.Path + return *a.Path } -func (s *ArangoRouteSpecRoute) Validate() error { - if s == nil { - s = &ArangoRouteSpecRoute{} +func (a *ArangoRouteSpecRoute) Validate() error { + if a == nil { + a = &ArangoRouteSpecRoute{} } if err := shared.WithErrors( - shared.PrefixResourceError("path", shared.ValidateAPIPath(s.GetPath())), + shared.PrefixResourceError("path", shared.ValidateAPIPath(a.GetPath())), ); err != nil { return err } diff --git a/pkg/apis/networking/v1alpha1/route_status.go b/pkg/apis/networking/v1alpha1/route_status.go index 514db9e44..8829c5e11 100644 --- a/pkg/apis/networking/v1alpha1/route_status.go +++ b/pkg/apis/networking/v1alpha1/route_status.go @@ -20,10 +20,19 @@ package v1alpha1 -import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +import ( + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" +) type ArangoRouteStatus struct { // Conditions specific to the entire extension // +doc/type: api.Conditions Conditions api.ConditionList `json:"conditions,omitempty"` + + // Deployment keeps the ArangoDeployment reference + Deployment *sharedApi.Object `json:"deployment,omitempty"` + + // Targets keeps the target details + Targets ArangoRouteStatusTargets `json:"targets,omitempty"` } diff --git a/pkg/apis/networking/v1alpha1/route_status_target.go b/pkg/apis/networking/v1alpha1/route_status_target.go new file mode 100644 index 000000000..bd4b9152a --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_status_target.go @@ -0,0 +1,44 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import "github.com/arangodb/kube-arangodb/pkg/util" + +type ArangoRouteStatusTargets []ArangoRouteStatusTarget + +func (a ArangoRouteStatusTargets) Hash() string { + return util.SHA256FromExtract(func(t ArangoRouteStatusTarget) string { + return t.Hash() + }, a...) +} + +type ArangoRouteStatusTarget struct { + Url string `json:"url,omitempty"` + + TLS ArangoRouteStatusTargetTLS `json:"tls,omitempty"` +} + +func (a *ArangoRouteStatusTarget) Hash() string { + if a == nil { + return "" + } + return util.SHA256FromStringArray(a.Url, a.TLS.Hash()) +} diff --git a/pkg/apis/networking/v1alpha1/route_status_target_tls.go b/pkg/apis/networking/v1alpha1/route_status_target_tls.go new file mode 100644 index 000000000..c813655c1 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_status_target_tls.go @@ -0,0 +1,36 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import "github.com/arangodb/kube-arangodb/pkg/util" + +type ArangoRouteStatusTargetTLS struct { + // Insecure allows Insecure traffic + Insecure bool `json:"insecure"` +} + +func (a *ArangoRouteStatusTargetTLS) Hash() string { + if a == nil { + return "" + } + + return util.SHA256FromStringArray(util.BoolSwitch(a.Insecure, "true", "false")) +} diff --git a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go index 6b2e00ac8..1dfa0daa4 100644 --- a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go @@ -96,6 +96,11 @@ func (in *ArangoRouteList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArangoRouteSpec) DeepCopyInto(out *ArangoRouteSpec) { *out = *in + if in.DeploymentName != nil { + in, out := &in.DeploymentName, &out.DeploymentName + *out = new(string) + **out = **in + } if in.Destination != nil { in, out := &in.Destination, &out.Destination *out = new(ArangoRouteSpecDestination) @@ -228,6 +233,16 @@ func (in *ArangoRouteStatus) DeepCopyInto(out *ArangoRouteStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = new(v1.Object) + (*in).DeepCopyInto(*out) + } + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make(ArangoRouteStatusTargets, len(*in)) + copy(*out, *in) + } return } @@ -240,3 +255,56 @@ func (in *ArangoRouteStatus) DeepCopy() *ArangoRouteStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteStatusTarget) DeepCopyInto(out *ArangoRouteStatusTarget) { + *out = *in + out.TLS = in.TLS + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTarget. +func (in *ArangoRouteStatusTarget) DeepCopy() *ArangoRouteStatusTarget { + if in == nil { + return nil + } + out := new(ArangoRouteStatusTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteStatusTargetTLS) DeepCopyInto(out *ArangoRouteStatusTargetTLS) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargetTLS. +func (in *ArangoRouteStatusTargetTLS) DeepCopy() *ArangoRouteStatusTargetTLS { + if in == nil { + return nil + } + out := new(ArangoRouteStatusTargetTLS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ArangoRouteStatusTargets) DeepCopyInto(out *ArangoRouteStatusTargets) { + { + in := &in + *out = make(ArangoRouteStatusTargets, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargets. +func (in ArangoRouteStatusTargets) DeepCopy() ArangoRouteStatusTargets { + if in == nil { + return nil + } + out := new(ArangoRouteStatusTargets) + in.DeepCopyInto(out) + return *out +} diff --git a/pkg/apis/shared/validate.go b/pkg/apis/shared/validate.go index e415d4fff..47e059533 100644 --- a/pkg/apis/shared/validate.go +++ b/pkg/apis/shared/validate.go @@ -22,6 +22,7 @@ package shared import ( "fmt" + "reflect" "regexp" "github.com/google/uuid" @@ -57,6 +58,15 @@ func ValidateResourceName(name string) error { return errors.WithStack(errors.Errorf("Name '%s' is not a valid resource name", name)) } +// ValidateResourceNamePointer validates a kubernetes resource name. +// If not valid, an error is returned. +func ValidateResourceNamePointer(name *string) error { + if name == nil { + return errors.WithStack(errors.Errorf("Name is nil")) + } + return ValidateResourceName(*name) +} + // ValidateOptionalResourceName validates a kubernetes resource name. // If not empty and not valid, an error is returned. func ValidateOptionalResourceName(name string) error { @@ -98,7 +108,7 @@ func ValidatePullPolicy(in core.PullPolicy) error { return errors.Errorf("Unknown pull policy: '%s'", string(in)) } -func Validate[T interface{}](in T) error { +func Validate[T any](in T) error { res, _ := validate(in) return res } @@ -107,6 +117,9 @@ func validate(in any) (error, bool) { if in == nil { return nil, false } + if reflect.ValueOf(in).IsZero() { + return nil, false + } if v, ok := in.(ValidateInterface); ok { return v.Validate(), true } @@ -114,7 +127,7 @@ func validate(in any) (error, bool) { } // ValidateOptional Validates object if is not nil -func ValidateOptional[T interface{}](in *T, validator func(T) error) error { +func ValidateOptional[T any](in *T, validator func(T) error) error { if in != nil { return validator(*in) } @@ -122,6 +135,11 @@ func ValidateOptional[T interface{}](in *T, validator func(T) error) error { return nil } +// ValidateOptionalPath Validates object if is not nil +func ValidateOptionalPath[T any](path string, in *T, validator func(T) error) error { + return PrefixResourceErrors(path, ValidateOptional(in, validator)) +} + // ValidateOptionalInterface Validates object if is not nil func ValidateOptionalInterface[T ValidateInterface](in T) error { res, _ := validate(in) @@ -130,11 +148,11 @@ func ValidateOptionalInterface[T ValidateInterface](in T) error { // ValidateOptionalInterfacePath Validates object if is not nil with path func ValidateOptionalInterfacePath[T ValidateInterface](path string, in T) error { - return PrefixResourceError(path, ValidateOptionalInterface(in)) + return PrefixResourceErrors(path, ValidateOptionalInterface(in)) } // ValidateRequired Validates object and required not nil value -func ValidateRequired[T interface{}](in *T, validator func(T) error) error { +func ValidateRequired[T any](in *T, validator func(T) error) error { if in != nil { return validator(*in) } @@ -142,6 +160,11 @@ func ValidateRequired[T interface{}](in *T, validator func(T) error) error { return errors.Errorf("should be not nil") } +// ValidateRequiredPath Validates object and required not nil value +func ValidateRequiredPath[T any](path string, in *T, validator func(T) error) error { + return PrefixResourceErrors(path, ValidateRequired(in, validator)) +} + // ValidateRequiredInterface Validates object if is not nil func ValidateRequiredInterface[T ValidateInterface](in T) error { res, ok := validate(in) @@ -153,11 +176,11 @@ func ValidateRequiredInterface[T ValidateInterface](in T) error { // ValidateRequiredInterfacePath Validates object if is not nil with path func ValidateRequiredInterfacePath[T ValidateInterface](path string, in T) error { - return PrefixResourceError(path, ValidateRequiredInterface(in)) + return PrefixResourceErrors(path, ValidateRequiredInterface(in)) } // ValidateList validates all elements on the list -func ValidateList[T interface{}](in []T, validator func(T) error) error { +func ValidateList[T any](in []T, validator func(T) error) error { errors := make([]error, len(in)) for id := range in { diff --git a/pkg/crd/crds/networking-route.schema.generated.yaml b/pkg/crd/crds/networking-route.schema.generated.yaml index ee0df1501..796f3be0a 100644 --- a/pkg/crd/crds/networking-route.schema.generated.yaml +++ b/pkg/crd/crds/networking-route.schema.generated.yaml @@ -4,7 +4,7 @@ v1alpha1: spec: properties: deployment: - description: Deployment specifies the ArangoDeployment object name + description: DeploymentName specifies the ArangoDeployment object name type: string destination: description: Destination defines the route destination diff --git a/pkg/handlers/networking/route/handler.go b/pkg/handlers/networking/route/handler.go new file mode 100644 index 000000000..fc5ea603b --- /dev/null +++ b/pkg/handlers/networking/route/handler.go @@ -0,0 +1,123 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "context" + + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/logging" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +var logger = logging.Global().RegisterAndGetLogger("networking-route-operator", logging.Info) + +type handler struct { + client arangoClientSet.Interface + kubeClient kubernetes.Interface + + eventRecorder event.RecorderInstance + + operator operator.Operator +} + +func (h *handler) Name() string { + return Kind() +} + +func (h *handler) Handle(ctx context.Context, item operation.Item) error { + // Get Backup object. It also covers NotFound case + + object, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.client.NetworkingV1alpha1().ArangoRoutes(item.Namespace).Get, item.Name, meta.GetOptions{}) + if err != nil { + if apiErrors.IsNotFound(err) { + return nil + } + + return err + } + + status := object.Status.DeepCopy() + + changed, reconcileErr := operator.HandleP3WithStop(ctx, item, object, status, h.handle) + if reconcileErr != nil && !operator.IsReconcile(reconcileErr) { + logger.Err(reconcileErr).Warn("Fail for %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + return reconcileErr + } + + if !changed { + return reconcileErr + } + + logger.Debug("Updating %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + if _, err := operator.WithNetworkingArangoRouteUpdateStatusInterfaceRetry(context.Background(), h.client.NetworkingV1alpha1().ArangoRoutes(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { + return err + } + + return reconcileErr +} + +func (h *handler) handle(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus) (bool, error) { + return operator.HandleP3WithCondition(ctx, &status.Conditions, networkingApi.ReadyCondition, item, extension, status, h.HandleSpecValidity, h.HandleArangoDeployment) +} + +func (h *handler) HandleSpecValidity(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus) (bool, error) { + if err := extension.Spec.Validate(); err != nil { + // We have received an error in the spec! + + logger.Err(err).Warn("Invalid Spec on %s", item.String()) + + if status.Conditions.Update(networkingApi.SpecValidCondition, false, "Spec is invalid", "Spec is invalid") { + return true, operator.Stop("Invalid spec") + } + return false, operator.Stop("Invalid spec") + } + + if status.Conditions.Update(networkingApi.SpecValidCondition, true, "Spec is valid", "Spec is valid") { + return true, operator.Reconcile("Conditions updated") + } + + return false, nil +} + +func (h *handler) CanBeHandled(item operation.Item) bool { + return item.Group == Group() && + item.Version == Version() && + item.Kind == Kind() +} + +func (h *handler) init() {} diff --git a/pkg/handlers/networking/route/handler_deployment.go b/pkg/handlers/networking/route/handler_deployment.go new file mode 100644 index 000000000..23e16b7fa --- /dev/null +++ b/pkg/handlers/networking/route/handler_deployment.go @@ -0,0 +1,82 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "context" + + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func (h *handler) HandleArangoDeployment(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus) (bool, error) { + var name = util.WithDefault(extension.Spec.DeploymentName) + + if status.Deployment != nil { + name = status.Deployment.GetName() + } + + deployment, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.client.DatabaseV1().ArangoDeployments(item.Namespace).Get, name, meta.GetOptions{}) + if err != nil { + if apiErrors.IsNotFound(err) { + // Condition for Found should be set to false + if util.Or( + status.Conditions.Update(networkingApi.DeploymentFoundCondition, false, "ArangoDeployment not found", "ArangoDeployment not found"), + ) { + return true, operator.Reconcile("Conditions updated") + } + return false, nil + } + + return false, err + } + + if status.Deployment == nil { + status.Deployment = util.NewType(sharedApi.NewObject(deployment)) + return true, operator.Reconcile("Deployment saved") + } else if !status.Deployment.Equals(deployment) { + if util.Or( + status.Conditions.Update(networkingApi.DeploymentFoundCondition, false, "ArangoDeployment changed", "ArangoDeployment changed"), + ) { + return true, operator.Reconcile("Conditions updated") + } + + return false, operator.Stop("ArangoDeployment Changed") + } + + // Condition for Found should be set to true + + if status.Conditions.Update(networkingApi.DeploymentFoundCondition, true, "ArangoDeployment found", "ArangoDeployment found") { + return true, operator.Reconcile("Conditions updated") + } + + return operator.HandleP4(ctx, item, extension, status, deployment, + operator.HandleP4Condition(func(_ context.Context, _ operation.Item, _ *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, _ *api.ArangoDeployment) *api.ConditionList { + return &status.Conditions + }, networkingApi.DestinationValidCondition, h.HandleArangoDestinationWithTargets), h.HandleDestinationRequired) +} diff --git a/pkg/handlers/networking/route/handler_deployment_test.go b/pkg/handlers/networking/route/handler_deployment_test.go new file mode 100644 index 000000000..53ae7eff5 --- /dev/null +++ b/pkg/handlers/networking/route/handler_deployment_test.go @@ -0,0 +1,145 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "testing" + + "github.com/stretchr/testify/require" + "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/apimachinery/pkg/util/uuid" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Deployment(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DeploymentFoundCondition)) +} + +func Test_Handler_MissingDeployment(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment-missing") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DeploymentFoundCondition)) +} + +func Test_Handler_Deployment_Changed(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DeploymentFoundCondition)) + + deployment.UID = uuid.NewUUID() + + tests.UpdateObjects(t, handler.kubeClient, handler.client, &deployment) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DeploymentFoundCondition)) +} diff --git a/pkg/handlers/networking/route/handler_destination.go b/pkg/handlers/networking/route/handler_destination.go new file mode 100644 index 000000000..0d646a859 --- /dev/null +++ b/pkg/handlers/networking/route/handler_destination.go @@ -0,0 +1,171 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "context" + "fmt" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func (h *handler) HandleArangoDestination(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, _ *api.ArangoDeployment) (*operator.Condition, bool, error) { + if dest := extension.Spec.GetDestination(); dest != nil { + if svc := dest.GetService(); svc != nil { + port := svc.Port + + if port == nil { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: "Missing Port definition", + }, false, nil + } + + s, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.kubeClient.CoreV1().Services(svc.GetNamespace(extension)).Get, svc.GetName(), meta.GetOptions{}) + if err != nil { + if api.IsNotFound(err) { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Service `%s/%s` Not found", svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Unknown error for service `%s/%s`: %s", svc.GetNamespace(extension), svc.GetName(), err.Error()), + }, false, nil + } + + if !svc.Equals(s) { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Service `%s/%s` Changed", svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + var destPort int32 + + if port.Type == intstr.Int { + p, ok := util.PickFromList(s.Spec.Ports, func(v core.ServicePort) bool { + return v.Port == port.IntVal + }) + if !ok { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Port `%d` not defined on Service `%s/%s`", port.IntVal, svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + destPort = p.Port + } else if port.Type == intstr.String && port.StrVal != "" { + p, ok := util.PickFromList(s.Spec.Ports, func(v core.ServicePort) bool { + return v.Name == port.StrVal + }) + if !ok { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Port `%s` not defined on Service `%s/%s`", port.StrVal, svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + destPort = p.Port + } else { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: "Unknown Port definition", + }, false, nil + } + + if destPort == -1 { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Unable to discover port on Service `%s/%s`", svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + var targets = networkingApi.ArangoRouteStatusTargets{ + networkingApi.ArangoRouteStatusTarget{ + Url: fmt.Sprintf("%s://%s.%s.svc:%d%s", dest.GetSchema().String(), s.GetName(), s.GetNamespace(), destPort, extension.Spec.GetRoute().GetPath()), + TLS: networkingApi.ArangoRouteStatusTargetTLS{ + Insecure: extension.Spec.Destination.GetTLS().GetInsecure(), + }, + }, + } + + if status.Targets.Hash() == targets.Hash() { + return &operator.Condition{ + Status: true, + Reason: "Destination Found", + Message: "Destination Found", + Hash: targets.Hash(), + }, false, nil + } + + status.Targets = targets + return &operator.Condition{ + Status: true, + Reason: "Destination Found", + Message: "Destination Found", + Hash: targets.Hash(), + }, true, nil + } + } + + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: "Destination Not Found", + }, false, nil +} + +func (h *handler) HandleArangoDestinationWithTargets(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, depl *api.ArangoDeployment) (*operator.Condition, bool, error) { + c, changed, err := h.HandleArangoDestination(ctx, item, extension, status, depl) + if c == nil && !c.Status && status.Targets != nil { + status.Targets = nil + changed = true + } + + return c, changed, err +} + +func (h *handler) HandleDestinationRequired(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, _ *api.ArangoDeployment) (bool, error) { + if !status.Conditions.IsTrue(networkingApi.DestinationValidCondition) { + return false, operator.Stop("Destination is not ready") + } + + return false, nil +} diff --git a/pkg/handlers/networking/route/handler_destination_test.go b/pkg/handlers/networking/route/handler_destination_test.go new file mode 100644 index 000000000..81ff36452 --- /dev/null +++ b/pkg/handlers/networking/route/handler_destination_test.go @@ -0,0 +1,422 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "testing" + + "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Destination_Service_Missing(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Not Found") + require.EqualValues(t, c.Message, "Unknown error for service `fake/deployment`: services \"deployment\" not found") +} + +func Test_Handler_Destination_Service_Valid(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) +} + +func Test_Handler_Destination_Service_ValidName(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromString("test")), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10241, + Name: "test1", + }, + { + Port: 10244, + Name: "test", + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) +} + +func Test_Handler_Destination_Service_WrongPort(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10245, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Not Found") + require.EqualValues(t, c.Message, "Port `10244` not defined on Service `fake/deployment`") +} + +func Test_Handler_Destination_Service_WrongPortName(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromString("test")), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10245, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Not Found") + require.EqualValues(t, c.Message, "Port `test` not defined on Service `fake/deployment`") +} + +func Test_Handler_Destination_Service_Insecure_Default(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Testcense + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + + require.Len(t, extension.Status.Targets, 1) + require.False(t, extension.Status.Targets[0].TLS.Insecure) +} + +func Test_Handler_Destination_Service_Insecure_Nil(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ + Insecure: nil, + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + + require.Len(t, extension.Status.Targets, 1) + require.False(t, extension.Status.Targets[0].TLS.Insecure) +} + +func Test_Handler_Destination_Service_Insecure_Override(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.DeploymentName = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ + Insecure: util.NewType(true), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + + require.Len(t, extension.Status.Targets, 1) + require.True(t, extension.Status.Targets[0].TLS.Insecure) +} diff --git a/pkg/handlers/networking/route/handler_test.go b/pkg/handlers/networking/route/handler_test.go new file mode 100644 index 000000000..fe0e331a5 --- /dev/null +++ b/pkg/handlers/networking/route/handler_test.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "testing" + + "github.com/stretchr/testify/require" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_ObjectNotFound(t *testing.T) { + // Arrange + handler := newFakeHandler() + + i := newItem(operation.Add, "test", "test") + + actions := map[operation.Operation]bool{ + operation.Add: false, + operation.Update: false, + operation.Delete: false, + } + + // Act + for op, shouldFail := range actions { + t.Run(string(op), func(t *testing.T) { + err := tests.Handle(handler, i) + + // Assert + if shouldFail { + require.Error(t, err) + require.True(t, apiErrors.IsNotFound(err)) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/pkg/handlers/networking/route/local.go b/pkg/handlers/networking/route/local.go new file mode 100644 index 000000000..b11b076ff --- /dev/null +++ b/pkg/handlers/networking/route/local.go @@ -0,0 +1,38 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "github.com/arangodb/kube-arangodb/pkg/apis/networking" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" +) + +func Kind() string { + return networking.ArangoRouteResourceKind +} + +func Group() string { + return networkingApi.SchemeGroupVersion.Group +} + +func Version() string { + return networkingApi.SchemeGroupVersion.Version +} diff --git a/pkg/handlers/networking/route/register.go b/pkg/handlers/networking/route/register.go new file mode 100644 index 000000000..e8b79752f --- /dev/null +++ b/pkg/handlers/networking/route/register.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" +) + +// RegisterInformer into operator +func RegisterInformer(operator operator.Operator, recorder event.Recorder, client arangoClientSet.Interface, + kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) error { + + if err := operator.RegisterInformer(informer.Networking().V1alpha1().ArangoRoutes().Informer(), + Group(), + Version(), + Kind()); err != nil { + return err + } + + h := &handler{ + client: client, + kubeClient: kubeClient, + + eventRecorder: recorder.NewInstance(Group(), Version(), Kind()), + + operator: operator, + } + + h.init() + + if err := operator.RegisterHandler(h); err != nil { + return err + } + + return nil +} diff --git a/pkg/handlers/networking/route/suite_test.go b/pkg/handlers/networking/route/suite_test.go new file mode 100644 index 000000000..dc222725c --- /dev/null +++ b/pkg/handlers/networking/route/suite_test.go @@ -0,0 +1,61 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/apis/analytics" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" +) + +func newFakeHandler() *handler { + f := fakeClientSet.NewSimpleClientset() + k := fake.NewSimpleClientset() + + h := &handler{ + client: f, + kubeClient: k, + eventRecorder: event.NewEventRecorder("mock", k).NewInstance(Group(), Version(), Kind()), + operator: operator.NewOperator("mock", "mock", "mock"), + } + + h.init() + + return h +} + +func newItem(o operation.Operation, namespace, name string) operation.Item { + return operation.Item{ + Group: networkingApi.SchemeGroupVersion.Group, + Version: networkingApi.SchemeGroupVersion.Version, + Kind: analytics.GraphAnalyticsEngineResourceKind, + + Operation: o, + + Namespace: namespace, + Name: name, + } +} diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index c83515751..586f3bcd1 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -37,6 +37,7 @@ import ( backupdef "github.com/arangodb/kube-arangodb/pkg/apis/backup" depldef "github.com/arangodb/kube-arangodb/pkg/apis/deployment" deplapi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/networking" repldef "github.com/arangodb/kube-arangodb/pkg/apis/replication" replapi "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" lsapi "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" @@ -45,6 +46,7 @@ import ( arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" "github.com/arangodb/kube-arangodb/pkg/handlers/backup" "github.com/arangodb/kube-arangodb/pkg/handlers/job" + "github.com/arangodb/kube-arangodb/pkg/handlers/networking/route" "github.com/arangodb/kube-arangodb/pkg/handlers/policy" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/operator/scope" @@ -68,10 +70,11 @@ var logger = logging.Global().RegisterAndGetLogger("operator", logging.Info) type operatorV2type string const ( - backupOperator operatorV2type = "backup" - mlOperator operatorV2type = "ml" - analyticsOperator operatorV2type = "analytics" - appsOperator operatorV2type = "apps" + backupOperator operatorV2type = "backup" + mlOperator operatorV2type = "ml" + analyticsOperator operatorV2type = "analytics" + networkingOperator operatorV2type = "networking" + appsOperator operatorV2type = "apps" ) type Event struct { @@ -102,6 +105,7 @@ type Config struct { EnableStorage bool EnableML bool EnableAnalytics bool + EnableNetworking bool EnableBackup bool EnableApps bool EnableK2KClusterSync bool @@ -124,6 +128,7 @@ type Dependencies struct { BackupProbe *probe.ReadyProbe MlProbe *probe.ReadyProbe AnalyticsProbe *probe.ReadyProbe + NetworkingProbe *probe.ReadyProbe AppsProbe *probe.ReadyProbe K2KClusterSyncProbe *probe.ReadyProbe } @@ -192,6 +197,13 @@ func (o *Operator) Run() { go o.runWithoutLeaderElection("arango-analytics-operator", constants.AnalyticsLabelRole, o.onStartAnalytics, o.Dependencies.AnalyticsProbe) } } + if o.Config.EnableNetworking { + if !o.Config.SingleMode { + go o.runLeaderElection("arango-networking-operator", constants.NetworkingLabelRole, o.onStartNetworking, o.Dependencies.NetworkingProbe) + } else { + go o.runWithoutLeaderElection("arango-networking-operator", constants.NetworkingLabelRole, o.onStartNetworking, o.Dependencies.NetworkingProbe) + } + } if o.Config.EnableK2KClusterSync { // Nothing to do o.log.Warn("K2K Cluster sync is permanently disabled") @@ -262,6 +274,11 @@ func (o *Operator) onStartApps(stop <-chan struct{}) { o.onStartOperatorV2(appsOperator, stop) } +// onStartNetworking starts the operator and run till given channel is closed. +func (o *Operator) onStartNetworking(stop <-chan struct{}) { + o.onStartOperatorV2(networkingOperator, stop) +} + // onStartOperatorV2 run the operatorV2 type func (o *Operator) onStartOperatorV2(operatorType operatorV2type, stop <-chan struct{}) { operatorName := fmt.Sprintf("arangodb-%s-operator", operatorType) @@ -290,6 +307,9 @@ func (o *Operator) onStartOperatorV2(operatorType operatorV2type, stop <-chan st case analyticsOperator: o.onStartOperatorV2Analytics(operator, eventRecorder, o.Client.Arango(), o.Client.Kubernetes(), arangoInformer, kubeInformer) o.Dependencies.AnalyticsProbe.SetReady() + case networkingOperator: + o.onStartOperatorV2Networking(operator, eventRecorder, o.Client.Arango(), o.Client.Kubernetes(), arangoInformer, kubeInformer) + o.Dependencies.NetworkingProbe.SetReady() } if err := operator.RegisterStarter(arangoInformer); err != nil { @@ -321,6 +341,18 @@ func (o *Operator) onStartOperatorV2Apps(operator operatorV2.Operator, recorder } } +func (o *Operator) onStartOperatorV2Networking(operator operatorV2.Operator, recorder event.Recorder, client arangoClientSet.Interface, kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) { + checkFn := func() error { + _, err := o.Client.Arango().NetworkingV1alpha1().ArangoRoutes(o.Namespace).List(context.Background(), meta.ListOptions{}) + return err + } + o.waitForCRD(networking.ArangoRouteCRDName, checkFn) + + if err := route.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { + panic(err) + } +} + func (o *Operator) onStartOperatorV2Backup(operator operatorV2.Operator, recorder event.Recorder, client arangoClientSet.Interface, kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory) { checkFn := func() error { _, err := o.Client.Arango().BackupV1().ArangoBackups(o.Namespace).List(context.Background(), meta.ListOptions{}) diff --git a/pkg/operatorV2/handle.go b/pkg/operatorV2/handle.go index 17b27f214..5e0be594f 100644 --- a/pkg/operatorV2/handle.go +++ b/pkg/operatorV2/handle.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,19 +21,26 @@ package operator import ( - "context" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) +type Condition struct { + Status bool + Reason string + Message string + Hash string +} + func WithCondition(conditions *api.ConditionList, condition api.ConditionType, changed bool, err error) (bool, error) { + var hash string + if changed || err != nil { // Condition should be false - if conditions.Update(condition, false, "Not ready", "Not ready") { + if conditions.UpdateWithHash(condition, false, "Not ready", "Not ready", hash) { changed = true } } else { - if conditions.Update(condition, true, "Ready", "Ready") { + if conditions.UpdateWithHash(condition, true, "Ready", "Ready", hash) { changed = true } } @@ -47,234 +54,26 @@ func WithCondition(conditions *api.ConditionList, condition api.ConditionType, c return changed, err } -type HandleP0Func func(ctx context.Context) (bool, error) - -type HandleP1Func[P1 interface{}] func(ctx context.Context, p1 P1) (bool, error) - -type HandleP2Func[P1, P2 interface{}] func(ctx context.Context, p1 P1, p2 P2) (bool, error) - -type HandleP3Func[P1, P2, P3 interface{}] func(ctx context.Context, p1 P1, p2 P2, p3 P3) (bool, error) - -type HandleP4Func[P1, P2, P3, P4 interface{}] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4) (bool, error) - -type HandleP5Func[P1, P2, P3, P4, P5 interface{}] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5) (bool, error) - -type HandleP6Func[P1, P2, P3, P4, P5, P6 interface{}] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6) (bool, error) - -type HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9 interface{}] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9) (bool, error) - -func HandleP0(ctx context.Context, handler ...HandleP0Func) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx) - if changed { - isChanged = true - } - - if err != nil { - return isChanged, err - } - } - - return isChanged, nil -} - -func HandleP1[P1 interface{}](ctx context.Context, p1 P1, handler ...HandleP1Func[P1]) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx, p1) - if changed { - isChanged = true - } - - if err != nil { - return isChanged, err - } - } - - return isChanged, nil -} - -func HandleP1WithStop[P1 interface{}](ctx context.Context, p1 P1, handler ...HandleP1Func[P1]) (bool, error) { - changed, err := HandleP1[P1](ctx, p1, handler...) - if IsStop(err) { - return changed, nil - } - - return changed, err -} - -func HandleP2[P1, P2 interface{}](ctx context.Context, p1 P1, p2 P2, handler ...HandleP2Func[P1, P2]) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx, p1, p2) - if changed { - isChanged = true - } - - if err != nil { - return isChanged, err - } - } - - return isChanged, nil -} - -func HandleP2WithStop[P1, P2 interface{}](ctx context.Context, p1 P1, p2 P2, handler ...HandleP2Func[P1, P2]) (bool, error) { - changed, err := HandleP2[P1, P2](ctx, p1, p2, handler...) - if IsStop(err) { - return changed, nil - } - - return changed, err -} - -func HandleP3[P1, P2, P3 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, handler ...HandleP3Func[P1, P2, P3]) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx, p1, p2, p3) - if changed { - isChanged = true - } - - if err != nil { - return isChanged, err - } - } - - return isChanged, nil -} - -func HandleP3WithStop[P1, P2, P3 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, handler ...HandleP3Func[P1, P2, P3]) (bool, error) { - changed, err := HandleP3[P1, P2, P3](ctx, p1, p2, p3, handler...) - if IsStop(err) { - return changed, nil - } - - return changed, err -} - -func HandleP3WithCondition[P1, P2, P3 interface{}](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, handler ...HandleP3Func[P1, P2, P3]) (bool, error) { - changed, err := HandleP3[P1, P2, P3](ctx, p1, p2, p3, handler...) - return WithCondition(conditions, condition, changed, err) -} - -func HandleP4[P1, P2, P3, P4 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, handler ...HandleP4Func[P1, P2, P3, P4]) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx, p1, p2, p3, p4) - if changed { - isChanged = true - } - - if err != nil { - return isChanged, err - } - } - - return isChanged, nil -} - -func HandleP4WithStop[P1, P2, P3, P4 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, handler ...HandleP4Func[P1, P2, P3, P4]) (bool, error) { - changed, err := HandleP4[P1, P2, P3, P4](ctx, p1, p2, p3, p4, handler...) - if IsStop(err) { - return changed, nil - } - - return changed, err -} - -func HandleP4WithCondition[P1, P2, P3, P4 interface{}](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, handler ...HandleP4Func[P1, P2, P3, P4]) (bool, error) { - changed, err := HandleP4[P1, P2, P3, P4](ctx, p1, p2, p3, p4, handler...) - return WithCondition(conditions, condition, changed, err) -} - -func HandleP5[P1, P2, P3, P4, P5 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, handler ...HandleP5Func[P1, P2, P3, P4, P5]) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx, p1, p2, p3, p4, p5) - if changed { - isChanged = true - } - - if err != nil { - return isChanged, err - } - } - - return isChanged, nil -} - -func HandleP5WithStop[P1, P2, P3, P4, P5 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, handler ...HandleP5Func[P1, P2, P3, P4, P5]) (bool, error) { - changed, err := HandleP5[P1, P2, P3, P4, P5](ctx, p1, p2, p3, p4, p5, handler...) - if IsStop(err) { - return changed, nil - } - - return changed, err -} - -func HandleP5WithCondition[P1, P2, P3, P4, P5 interface{}](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, handler ...HandleP5Func[P1, P2, P3, P4, P5]) (bool, error) { - changed, err := HandleP5[P1, P2, P3, P4, P5](ctx, p1, p2, p3, p4, p5, handler...) - return WithCondition(conditions, condition, changed, err) -} - -func HandleP6[P1, P2, P3, P4, P5, P6 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, handler ...HandleP6Func[P1, P2, P3, P4, P5, P6]) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx, p1, p2, p3, p4, p5, p6) - if changed { - isChanged = true +func WithConditionChange(conditions *api.ConditionList, condition api.ConditionType, c *Condition, changed bool, err error) (bool, error) { + if c == nil { + if conditions.Remove(condition) { + changed = true } - - if err != nil { - return isChanged, err + } else { + if conditions.UpdateWithHash(condition, c.Status, c.Reason, c.Message, c.Hash) { + changed = true } } - return isChanged, nil -} - -func HandleP6WithStop[P1, P2, P3, P4, P5, P6 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, handler ...HandleP6Func[P1, P2, P3, P4, P5, P6]) (bool, error) { - changed, err := HandleP6[P1, P2, P3, P4, P5, P6](ctx, p1, p2, p3, p4, p5, p6, handler...) - if IsStop(err) { - return changed, nil - } - - return changed, err -} - -func HandleP6WithCondition[P1, P2, P3, P4, P5, P6 interface{}](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, handler ...HandleP6Func[P1, P2, P3, P4, P5, P6]) (bool, error) { - changed, err := HandleP6[P1, P2, P3, P4, P5, P6](ctx, p1, p2, p3, p4, p5, p6, handler...) - return WithCondition(conditions, condition, changed, err) -} - -func HandleP9[P1, P2, P3, P4, P5, P6, P7, P8, P9 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9, handler ...HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9]) (bool, error) { - isChanged := false - for _, h := range handler { - changed, err := h(ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9) + if err == nil || IsStop(err) { if changed { - isChanged = true - } - - if err != nil { - return isChanged, err + err = Reconcile("Condition changed") } } - return isChanged, nil -} - -func HandleP9WithStop[P1, P2, P3, P4, P5, P6, P7, P8, P9 interface{}](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9, handler ...HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9]) (bool, error) { - changed, err := HandleP9[P1, P2, P3, P4, P5, P6, P7, P8, P9](ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9, handler...) - if IsStop(err) { - return changed, nil + if err == nil && changed { + err = Reconcile("Condition changed") } return changed, err } - -func HandleP9WithCondition[P1, P2, P3, P4, P5, P6, P7, P8, P9 interface{}](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9, handler ...HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9]) (bool, error) { - changed, err := HandleP9[P1, P2, P3, P4, P5, P6, P7, P8, P9](ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9, handler...) - return WithCondition(conditions, condition, changed, err) -} diff --git a/pkg/operatorV2/handler_p0.generated.go b/pkg/operatorV2/handler_p0.generated.go new file mode 100644 index 000000000..f29852614 --- /dev/null +++ b/pkg/operatorV2/handler_p0.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP0Func func(ctx context.Context) (bool, error) + +type HandleP0ConditionFunc func(ctx context.Context) (*Condition, bool, error) + +type HandleP0ConditionExtract func(ctx context.Context) *api.ConditionList + +func HandleP0(ctx context.Context, handler ...HandleP0Func) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP0WithStop(ctx context.Context, handler ...HandleP0Func) (bool, error) { + changed, err := HandleP0(ctx, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP0WithCondition(ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, handler ...HandleP0Func) (bool, error) { + changed, err := HandleP0(ctx, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP0Condition(extract HandleP0ConditionExtract, condition api.ConditionType, handler HandleP0ConditionFunc) HandleP0Func { + return func(ctx context.Context) (bool, error) { + c, changed, err := handler(ctx) + return WithConditionChange(extract(ctx), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p1.generated.go b/pkg/operatorV2/handler_p1.generated.go new file mode 100644 index 000000000..381d562d2 --- /dev/null +++ b/pkg/operatorV2/handler_p1.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP1Func[P1 any] func(ctx context.Context, p1 P1) (bool, error) + +type HandleP1ConditionFunc[P1 any] func(ctx context.Context, p1 P1) (*Condition, bool, error) + +type HandleP1ConditionExtract[P1 any] func(ctx context.Context, p1 P1) *api.ConditionList + +func HandleP1[P1 any](ctx context.Context, p1 P1, handler ...HandleP1Func[P1]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP1WithStop[P1 any](ctx context.Context, p1 P1, handler ...HandleP1Func[P1]) (bool, error) { + changed, err := HandleP1[P1](ctx, p1, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP1WithCondition[P1 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, handler ...HandleP1Func[P1]) (bool, error) { + changed, err := HandleP1[P1](ctx, p1, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP1Condition[P1 any](extract HandleP1ConditionExtract[P1], condition api.ConditionType, handler HandleP1ConditionFunc[P1]) HandleP1Func[P1] { + return func(ctx context.Context, p1 P1) (bool, error) { + c, changed, err := handler(ctx, p1) + return WithConditionChange(extract(ctx, p1), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p2.generated.go b/pkg/operatorV2/handler_p2.generated.go new file mode 100644 index 000000000..5176b8cab --- /dev/null +++ b/pkg/operatorV2/handler_p2.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP2Func[P1, P2 any] func(ctx context.Context, p1 P1, p2 P2) (bool, error) + +type HandleP2ConditionFunc[P1, P2 any] func(ctx context.Context, p1 P1, p2 P2) (*Condition, bool, error) + +type HandleP2ConditionExtract[P1, P2 any] func(ctx context.Context, p1 P1, p2 P2) *api.ConditionList + +func HandleP2[P1, P2 any](ctx context.Context, p1 P1, p2 P2, handler ...HandleP2Func[P1, P2]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP2WithStop[P1, P2 any](ctx context.Context, p1 P1, p2 P2, handler ...HandleP2Func[P1, P2]) (bool, error) { + changed, err := HandleP2[P1, P2](ctx, p1, p2, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP2WithCondition[P1, P2 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, handler ...HandleP2Func[P1, P2]) (bool, error) { + changed, err := HandleP2[P1, P2](ctx, p1, p2, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP2Condition[P1, P2 any](extract HandleP2ConditionExtract[P1, P2], condition api.ConditionType, handler HandleP2ConditionFunc[P1, P2]) HandleP2Func[P1, P2] { + return func(ctx context.Context, p1 P1, p2 P2) (bool, error) { + c, changed, err := handler(ctx, p1, p2) + return WithConditionChange(extract(ctx, p1, p2), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p3.generated.go b/pkg/operatorV2/handler_p3.generated.go new file mode 100644 index 000000000..31b05f6b2 --- /dev/null +++ b/pkg/operatorV2/handler_p3.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP3Func[P1, P2, P3 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3) (bool, error) + +type HandleP3ConditionFunc[P1, P2, P3 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3) (*Condition, bool, error) + +type HandleP3ConditionExtract[P1, P2, P3 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3) *api.ConditionList + +func HandleP3[P1, P2, P3 any](ctx context.Context, p1 P1, p2 P2, p3 P3, handler ...HandleP3Func[P1, P2, P3]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2, p3) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP3WithStop[P1, P2, P3 any](ctx context.Context, p1 P1, p2 P2, p3 P3, handler ...HandleP3Func[P1, P2, P3]) (bool, error) { + changed, err := HandleP3[P1, P2, P3](ctx, p1, p2, p3, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP3WithCondition[P1, P2, P3 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, handler ...HandleP3Func[P1, P2, P3]) (bool, error) { + changed, err := HandleP3[P1, P2, P3](ctx, p1, p2, p3, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP3Condition[P1, P2, P3 any](extract HandleP3ConditionExtract[P1, P2, P3], condition api.ConditionType, handler HandleP3ConditionFunc[P1, P2, P3]) HandleP3Func[P1, P2, P3] { + return func(ctx context.Context, p1 P1, p2 P2, p3 P3) (bool, error) { + c, changed, err := handler(ctx, p1, p2, p3) + return WithConditionChange(extract(ctx, p1, p2, p3), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p4.generated.go b/pkg/operatorV2/handler_p4.generated.go new file mode 100644 index 000000000..b1249dcec --- /dev/null +++ b/pkg/operatorV2/handler_p4.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP4Func[P1, P2, P3, P4 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4) (bool, error) + +type HandleP4ConditionFunc[P1, P2, P3, P4 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4) (*Condition, bool, error) + +type HandleP4ConditionExtract[P1, P2, P3, P4 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4) *api.ConditionList + +func HandleP4[P1, P2, P3, P4 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, handler ...HandleP4Func[P1, P2, P3, P4]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2, p3, p4) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP4WithStop[P1, P2, P3, P4 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, handler ...HandleP4Func[P1, P2, P3, P4]) (bool, error) { + changed, err := HandleP4[P1, P2, P3, P4](ctx, p1, p2, p3, p4, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP4WithCondition[P1, P2, P3, P4 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, handler ...HandleP4Func[P1, P2, P3, P4]) (bool, error) { + changed, err := HandleP4[P1, P2, P3, P4](ctx, p1, p2, p3, p4, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP4Condition[P1, P2, P3, P4 any](extract HandleP4ConditionExtract[P1, P2, P3, P4], condition api.ConditionType, handler HandleP4ConditionFunc[P1, P2, P3, P4]) HandleP4Func[P1, P2, P3, P4] { + return func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4) (bool, error) { + c, changed, err := handler(ctx, p1, p2, p3, p4) + return WithConditionChange(extract(ctx, p1, p2, p3, p4), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p5.generated.go b/pkg/operatorV2/handler_p5.generated.go new file mode 100644 index 000000000..b8803f296 --- /dev/null +++ b/pkg/operatorV2/handler_p5.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP5Func[P1, P2, P3, P4, P5 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5) (bool, error) + +type HandleP5ConditionFunc[P1, P2, P3, P4, P5 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5) (*Condition, bool, error) + +type HandleP5ConditionExtract[P1, P2, P3, P4, P5 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5) *api.ConditionList + +func HandleP5[P1, P2, P3, P4, P5 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, handler ...HandleP5Func[P1, P2, P3, P4, P5]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2, p3, p4, p5) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP5WithStop[P1, P2, P3, P4, P5 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, handler ...HandleP5Func[P1, P2, P3, P4, P5]) (bool, error) { + changed, err := HandleP5[P1, P2, P3, P4, P5](ctx, p1, p2, p3, p4, p5, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP5WithCondition[P1, P2, P3, P4, P5 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, handler ...HandleP5Func[P1, P2, P3, P4, P5]) (bool, error) { + changed, err := HandleP5[P1, P2, P3, P4, P5](ctx, p1, p2, p3, p4, p5, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP5Condition[P1, P2, P3, P4, P5 any](extract HandleP5ConditionExtract[P1, P2, P3, P4, P5], condition api.ConditionType, handler HandleP5ConditionFunc[P1, P2, P3, P4, P5]) HandleP5Func[P1, P2, P3, P4, P5] { + return func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5) (bool, error) { + c, changed, err := handler(ctx, p1, p2, p3, p4, p5) + return WithConditionChange(extract(ctx, p1, p2, p3, p4, p5), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p6.generated.go b/pkg/operatorV2/handler_p6.generated.go new file mode 100644 index 000000000..5811317f2 --- /dev/null +++ b/pkg/operatorV2/handler_p6.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP6Func[P1, P2, P3, P4, P5, P6 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6) (bool, error) + +type HandleP6ConditionFunc[P1, P2, P3, P4, P5, P6 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6) (*Condition, bool, error) + +type HandleP6ConditionExtract[P1, P2, P3, P4, P5, P6 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6) *api.ConditionList + +func HandleP6[P1, P2, P3, P4, P5, P6 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, handler ...HandleP6Func[P1, P2, P3, P4, P5, P6]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2, p3, p4, p5, p6) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP6WithStop[P1, P2, P3, P4, P5, P6 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, handler ...HandleP6Func[P1, P2, P3, P4, P5, P6]) (bool, error) { + changed, err := HandleP6[P1, P2, P3, P4, P5, P6](ctx, p1, p2, p3, p4, p5, p6, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP6WithCondition[P1, P2, P3, P4, P5, P6 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, handler ...HandleP6Func[P1, P2, P3, P4, P5, P6]) (bool, error) { + changed, err := HandleP6[P1, P2, P3, P4, P5, P6](ctx, p1, p2, p3, p4, p5, p6, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP6Condition[P1, P2, P3, P4, P5, P6 any](extract HandleP6ConditionExtract[P1, P2, P3, P4, P5, P6], condition api.ConditionType, handler HandleP6ConditionFunc[P1, P2, P3, P4, P5, P6]) HandleP6Func[P1, P2, P3, P4, P5, P6] { + return func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6) (bool, error) { + c, changed, err := handler(ctx, p1, p2, p3, p4, p5, p6) + return WithConditionChange(extract(ctx, p1, p2, p3, p4, p5, p6), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p7.generated.go b/pkg/operatorV2/handler_p7.generated.go new file mode 100644 index 000000000..edd4fe844 --- /dev/null +++ b/pkg/operatorV2/handler_p7.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP7Func[P1, P2, P3, P4, P5, P6, P7 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7) (bool, error) + +type HandleP7ConditionFunc[P1, P2, P3, P4, P5, P6, P7 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7) (*Condition, bool, error) + +type HandleP7ConditionExtract[P1, P2, P3, P4, P5, P6, P7 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7) *api.ConditionList + +func HandleP7[P1, P2, P3, P4, P5, P6, P7 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, handler ...HandleP7Func[P1, P2, P3, P4, P5, P6, P7]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2, p3, p4, p5, p6, p7) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP7WithStop[P1, P2, P3, P4, P5, P6, P7 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, handler ...HandleP7Func[P1, P2, P3, P4, P5, P6, P7]) (bool, error) { + changed, err := HandleP7[P1, P2, P3, P4, P5, P6, P7](ctx, p1, p2, p3, p4, p5, p6, p7, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP7WithCondition[P1, P2, P3, P4, P5, P6, P7 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, handler ...HandleP7Func[P1, P2, P3, P4, P5, P6, P7]) (bool, error) { + changed, err := HandleP7[P1, P2, P3, P4, P5, P6, P7](ctx, p1, p2, p3, p4, p5, p6, p7, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP7Condition[P1, P2, P3, P4, P5, P6, P7 any](extract HandleP7ConditionExtract[P1, P2, P3, P4, P5, P6, P7], condition api.ConditionType, handler HandleP7ConditionFunc[P1, P2, P3, P4, P5, P6, P7]) HandleP7Func[P1, P2, P3, P4, P5, P6, P7] { + return func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7) (bool, error) { + c, changed, err := handler(ctx, p1, p2, p3, p4, p5, p6, p7) + return WithConditionChange(extract(ctx, p1, p2, p3, p4, p5, p6, p7), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p8.generated.go b/pkg/operatorV2/handler_p8.generated.go new file mode 100644 index 000000000..72c210d3e --- /dev/null +++ b/pkg/operatorV2/handler_p8.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP8Func[P1, P2, P3, P4, P5, P6, P7, P8 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8) (bool, error) + +type HandleP8ConditionFunc[P1, P2, P3, P4, P5, P6, P7, P8 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8) (*Condition, bool, error) + +type HandleP8ConditionExtract[P1, P2, P3, P4, P5, P6, P7, P8 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8) *api.ConditionList + +func HandleP8[P1, P2, P3, P4, P5, P6, P7, P8 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, handler ...HandleP8Func[P1, P2, P3, P4, P5, P6, P7, P8]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2, p3, p4, p5, p6, p7, p8) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP8WithStop[P1, P2, P3, P4, P5, P6, P7, P8 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, handler ...HandleP8Func[P1, P2, P3, P4, P5, P6, P7, P8]) (bool, error) { + changed, err := HandleP8[P1, P2, P3, P4, P5, P6, P7, P8](ctx, p1, p2, p3, p4, p5, p6, p7, p8, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP8WithCondition[P1, P2, P3, P4, P5, P6, P7, P8 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, handler ...HandleP8Func[P1, P2, P3, P4, P5, P6, P7, P8]) (bool, error) { + changed, err := HandleP8[P1, P2, P3, P4, P5, P6, P7, P8](ctx, p1, p2, p3, p4, p5, p6, p7, p8, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP8Condition[P1, P2, P3, P4, P5, P6, P7, P8 any](extract HandleP8ConditionExtract[P1, P2, P3, P4, P5, P6, P7, P8], condition api.ConditionType, handler HandleP8ConditionFunc[P1, P2, P3, P4, P5, P6, P7, P8]) HandleP8Func[P1, P2, P3, P4, P5, P6, P7, P8] { + return func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8) (bool, error) { + c, changed, err := handler(ctx, p1, p2, p3, p4, p5, p6, p7, p8) + return WithConditionChange(extract(ctx, p1, p2, p3, p4, p5, p6, p7, p8), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/handler_p9.generated.go b/pkg/operatorV2/handler_p9.generated.go new file mode 100644 index 000000000..d21ed0f0e --- /dev/null +++ b/pkg/operatorV2/handler_p9.generated.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package operator + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9) (bool, error) + +type HandleP9ConditionFunc[P1, P2, P3, P4, P5, P6, P7, P8, P9 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9) (*Condition, bool, error) + +type HandleP9ConditionExtract[P1, P2, P3, P4, P5, P6, P7, P8, P9 any] func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9) *api.ConditionList + +func HandleP9[P1, P2, P3, P4, P5, P6, P7, P8, P9 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9, handler ...HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9]) (bool, error) { + isChanged := false + for _, h := range handler { + changed, err := h(ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9) + if changed { + isChanged = true + } + + if err != nil { + return isChanged, err + } + } + + return isChanged, nil +} + +func HandleP9WithStop[P1, P2, P3, P4, P5, P6, P7, P8, P9 any](ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9, handler ...HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9]) (bool, error) { + changed, err := HandleP9[P1, P2, P3, P4, P5, P6, P7, P8, P9](ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9, handler...) + if IsStop(err) { + return changed, nil + } + + return changed, err +} + +func HandleP9WithCondition[P1, P2, P3, P4, P5, P6, P7, P8, P9 any](ctx context.Context, conditions *api.ConditionList, condition api.ConditionType, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9, handler ...HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9]) (bool, error) { + changed, err := HandleP9[P1, P2, P3, P4, P5, P6, P7, P8, P9](ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9, handler...) + return WithCondition(conditions, condition, changed, err) +} + +func HandleP9Condition[P1, P2, P3, P4, P5, P6, P7, P8, P9 any](extract HandleP9ConditionExtract[P1, P2, P3, P4, P5, P6, P7, P8, P9], condition api.ConditionType, handler HandleP9ConditionFunc[P1, P2, P3, P4, P5, P6, P7, P8, P9]) HandleP9Func[P1, P2, P3, P4, P5, P6, P7, P8, P9] { + return func(ctx context.Context, p1 P1, p2 P2, p3 P3, p4 P4, p5 P5, p6 P6, p7 P7, p8 P8, p9 P9) (bool, error) { + c, changed, err := handler(ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9) + return WithConditionChange(extract(ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9), condition, c, changed, err) + } +} diff --git a/pkg/operatorV2/update_wraps.go b/pkg/operatorV2/update_wraps.go index a936e1e41..acae0b86f 100644 --- a/pkg/operatorV2/update_wraps.go +++ b/pkg/operatorV2/update_wraps.go @@ -29,6 +29,7 @@ import ( backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" ) func WithArangoBackupUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[backupApi.ArangoBackupStatus, *backupApi.ArangoBackup], obj *backupApi.ArangoBackup, status backupApi.ArangoBackupStatus, opts meta.UpdateOptions) (*backupApi.ArangoBackup, error) { @@ -51,6 +52,10 @@ func WithAnalyticsGAEUpdateStatusInterfaceRetry(ctx context.Context, client Upda return WithUpdateStatusInterfaceRetry[analyticsApi.GraphAnalyticsEngineStatus, *analyticsApi.GraphAnalyticsEngine](ctx, client, obj, status, opts) } +func WithNetworkingArangoRouteUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[networkingApi.ArangoRouteStatus, *networkingApi.ArangoRoute], obj *networkingApi.ArangoRoute, status networkingApi.ArangoRouteStatus, opts meta.UpdateOptions) (*networkingApi.ArangoRoute, error) { + return WithUpdateStatusInterfaceRetry[networkingApi.ArangoRouteStatus, *networkingApi.ArangoRoute](ctx, client, obj, status, opts) +} + func WithArangoStorageUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage], obj *mlApi.ArangoMLStorage, status mlApi.ArangoMLStorageStatus, opts meta.UpdateOptions) (*mlApi.ArangoMLStorage, error) { return WithUpdateStatusInterfaceRetry[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage](ctx, client, obj, status, opts) } diff --git a/pkg/server/server.go b/pkg/server/server.go index 0bf9ccac1..940cff618 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -70,6 +70,7 @@ type Dependencies struct { Apps OperatorDependency ML OperatorDependency Analytics OperatorDependency + Networking OperatorDependency ClusterSync OperatorDependency Operators Operators Secrets typedCore.SecretInterface @@ -194,6 +195,10 @@ func NewServer(cli typedCore.CoreV1Interface, cfg Config, deps Dependencies) (*S r.GET("/ready/analytics", gin.WrapF(deps.Analytics.Probe.ReadyHandler)) readyProbes = append(readyProbes, deps.Analytics.Probe) } + if deps.Networking.Enabled { + r.GET("/ready/networking", gin.WrapF(deps.Networking.Probe.ReadyHandler)) + readyProbes = append(readyProbes, deps.Networking.Probe) + } r.GET("/ready", gin.WrapF(ready(readyProbes...))) r.GET("/metrics", gin.WrapF(metrics.Handler())) r.POST("/login", s.auth.handleLogin) diff --git a/pkg/util/checksum.go b/pkg/util/checksum.go index 907516926..41028698e 100644 --- a/pkg/util/checksum.go +++ b/pkg/util/checksum.go @@ -26,8 +26,28 @@ import ( "fmt" "k8s.io/apimachinery/pkg/util/json" + + "github.com/arangodb/kube-arangodb/pkg/util/strings" ) +type Hash interface { + Hash() string +} + +func SHA256FromExtract[T any](extract func(T) string, obj ...T) string { + return SHA256FromStringArray(strings.Join(FormatList(obj, extract), "|")) +} + +func SHA256FromHashArray[T Hash](data []T) string { + return SHA256FromExtract(func(t T) string { + return t.Hash() + }, data...) +} + +func SHA256FromStringArray(data ...string) string { + return SHA256FromString(strings.Join(data, "|")) +} + func SHA256FromString(data string) string { return SHA256([]byte(data)) } diff --git a/pkg/util/constants/constants.go b/pkg/util/constants/constants.go index 245d3ec05..9b603a1f8 100644 --- a/pkg/util/constants/constants.go +++ b/pkg/util/constants/constants.go @@ -73,6 +73,7 @@ const ( BackupLabelRole = "backup/role" MLLabelRole = "ml/role" AnalyticsLabelRole = "analytics/role" + NetworkingLabelRole = "networking/role" AppsLabelRole = "apps/role" ClusterSyncLabelRole = "clustersync/role" LabelRole = "role" diff --git a/pkg/util/dict.go b/pkg/util/dict.go index c356b246a..bf2c775bd 100644 --- a/pkg/util/dict.go +++ b/pkg/util/dict.go @@ -21,6 +21,7 @@ package util import ( + "maps" "reflect" "sort" ) @@ -50,7 +51,7 @@ func CopyFullMap[K comparable, V any](src map[K]V) map[K]V { r := map[K]V{} - CopyMap(r, src) + maps.Copy(r, src) return r } @@ -73,13 +74,6 @@ func MergeMaps[K comparable, V any](override bool, maps ...map[K]V) map[K]V { return r } -func CopyMap[K comparable, V any](dst, src map[K]V) { - // TODO: replace with maps.Copy when switching to go1.21 - for k, v := range src { - dst[k] = v - } -} - func IterateSorted[V any](m map[string]V, cb func(string, V)) { for _, k := range SortKeys(m) { cb(k, m[k]) diff --git a/pkg/util/list.go b/pkg/util/list.go index 208cd8462..d58b2c6dc 100644 --- a/pkg/util/list.go +++ b/pkg/util/list.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ package util import "sort" -type List[T any] []T +type List[T comparable] []T func (l List[T]) Filter(fn func(T) bool) List[T] { if l == nil { @@ -57,6 +57,16 @@ func (l List[T]) Sort(fn func(T, T) bool) List[T] { return clone } +func PickFromList[V any](in []V, q func(v V) bool) (V, bool) { + for _, v := range in { + if q(v) { + return v, true + } + } + + return Default[V](), false +} + func MapList[T, V comparable](in List[T], fn func(T) V) List[V] { if in == nil { return nil @@ -67,3 +77,27 @@ func MapList[T, V comparable](in List[T], fn func(T) V) List[V] { } return result } + +func FormatList[A, B any](in []A, format func(A) B) []B { + var r = make([]B, len(in)) + + for id := range in { + r[id] = format(in[id]) + } + + return r +} + +func FormatListErr[A, B any](in []A, format func(A) (B, error)) ([]B, error) { + var r = make([]B, len(in)) + + for id := range in { + if o, err := format(in[id]); err != nil { + return nil, err + } else { + r[id] = o + } + } + + return r, nil +} diff --git a/pkg/util/tests/kubernetes.go b/pkg/util/tests/kubernetes.go index fe5e30498..066ea95b8 100644 --- a/pkg/util/tests/kubernetes.go +++ b/pkg/util/tests/kubernetes.go @@ -45,6 +45,8 @@ import ( "github.com/arangodb/kube-arangodb/pkg/apis/ml" mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/apis/networking" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" schedulerApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" @@ -243,6 +245,12 @@ func CreateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := arango.AnalyticsV1alpha1().GraphAnalyticsEngines(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) require.NoError(t, err) + case **networkingApi.ArangoRoute: + require.NotNil(t, v) + + vl := *v + _, err := arango.NetworkingV1alpha1().ArangoRoutes(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) default: require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String())) } @@ -397,6 +405,12 @@ func UpdateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := arango.AnalyticsV1alpha1().GraphAnalyticsEngines(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) require.NoError(t, err) + case **networkingApi.ArangoRoute: + require.NotNil(t, v) + + vl := *v + _, err := arango.NetworkingV1alpha1().ArangoRoutes(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) default: require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String())) } @@ -525,6 +539,11 @@ func DeleteObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v require.NoError(t, arango.AnalyticsV1alpha1().GraphAnalyticsEngines(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) + case **networkingApi.ArangoRoute: + require.NotNil(t, v) + + vl := *v + require.NoError(t, arango.NetworkingV1alpha1().ArangoRoutes(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) default: require.Fail(t, fmt.Sprintf("Unable to delete object: %s", reflect.TypeOf(v).String())) } @@ -882,6 +901,21 @@ func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientS } else { *v = vn } + case **networkingApi.ArangoRoute: + require.NotNil(t, v) + + vl := *v + + vn, err := arango.NetworkingV1alpha1().ArangoRoutes(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } default: require.Fail(t, fmt.Sprintf("Unable to get object: %s", reflect.TypeOf(v).String())) } @@ -1054,6 +1088,14 @@ func SetMetaBasedOnType(t *testing.T, object meta.Object) { analytics.GraphAnalyticsEngineResourcePlural, object.GetNamespace(), object.GetName())) + case *networkingApi.ArangoRoute: + v.Kind = networking.ArangoRouteResourceKind + v.APIVersion = networkingApi.SchemeGroupVersion.String() + v.SetSelfLink(fmt.Sprintf("/api/%s/%s/%s/%s", + networkingApi.SchemeGroupVersion.String(), + networking.ArangoRouteResourcePlural, + object.GetNamespace(), + object.GetName())) default: require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String())) } @@ -1230,6 +1272,12 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind { Version: analyticsApi.ArangoAnalyticsVersion, Kind: analytics.GraphAnalyticsEngineResourceKind, } + case *networkingApi.ArangoRoute: + return schema.GroupVersionKind{ + Group: networking.ArangoNetworkingGroupName, + Version: networkingApi.ArangoNetworkingVersion, + Kind: networking.ArangoRouteResourceKind, + } default: require.Fail(t, fmt.Sprintf("Unable to create object: %s", reflect.TypeOf(v).String())) return schema.GroupVersionKind{} diff --git a/pkg/util/tests/kubernetes_test.go b/pkg/util/tests/kubernetes_test.go index d5e2716ce..57061255d 100644 --- a/pkg/util/tests/kubernetes_test.go +++ b/pkg/util/tests/kubernetes_test.go @@ -36,6 +36,7 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" "github.com/arangodb/kube-arangodb/pkg/util/kclient" @@ -87,4 +88,5 @@ func Test_NewMetaObject(t *testing.T) { NewMetaObjectRun[*mlApiv1alpha1.ArangoMLCronJob](t) NewMetaObjectRun[*schedulerApi.ArangoProfile](t) NewMetaObjectRun[*analyticsApi.GraphAnalyticsEngine](t) + NewMetaObjectRun[*networkingApi.ArangoRoute](t) } From e1eee03554127a334f61b8156a2d6361de62053a Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Fri, 2 Aug 2024 00:03:37 +0200 Subject: [PATCH 04/50] OAS-9926 Fix README (#1691) --- scripts/patch_readme.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/patch_readme.sh b/scripts/patch_readme.sh index e81541df4..ca77aee70 100755 --- a/scripts/patch_readme.sh +++ b/scripts/patch_readme.sh @@ -33,4 +33,5 @@ replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/ku replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/enterprise-storage.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/enterprise-storage.yaml@g" ${f} replaceInFile "s@https://github\.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-crd-[[:digit:]].*\.tgz@https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-crd-${VERSION}.tgz@g" ${f} +replaceInFile "s@https://github\.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-enterprise-[[:digit:]].*\.tgz@https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-enterprise-${VERSION}.tgz@g" ${f} replaceInFile "s@https://github\.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-[[:digit:]].*\.tgz@https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-${VERSION}.tgz@g" ${f} From a456ef606ac3a1eff104535a4f307312e604f344 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:14:02 +0300 Subject: [PATCH 05/50] [Feature] Add Services for Group (#1693) --- .circleci/continue_config.yml | 8 +-- CHANGELOG.md | 1 + Makefile | 5 ++ pkg/apis/deployment/v1/server_group.go | 29 +++++++++ pkg/apis/deployment/v2alpha1/server_group.go | 29 +++++++++ pkg/deployment/resources/pod_leader.go | 4 +- pkg/deployment/resources/services.go | 66 ++++++++++++++++++-- 7 files changed, 128 insertions(+), 14 deletions(-) diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml index 0e49e7fff..47b5c0c67 100644 --- a/.circleci/continue_config.yml +++ b/.circleci/continue_config.yml @@ -84,13 +84,7 @@ jobs: echo "This is not a pull request. Skipping..." exit 0 fi - make tidy update-generated synchronize-v2alpha1-with-v1 generate-internal sync fmt yamlfmt license - git checkout -- go.sum # ignore changes in go.sum - if [ ! -z "$(git status --porcelain)" ]; then - echo "There are uncommited changes!" - git status - exit 1 - fi + make ci-check environment: GO111MODULES: off diff --git a/CHANGELOG.md b/CHANGELOG.md index bc318d1d9..1cc7238d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) - (Feature) ArangoRoute CRD - (Feature) ArangoRoute Operator +- (Feature) Add Kubernetes Services for Group ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index 6e9106f98..80f18aa20 100644 --- a/Makefile +++ b/Makefile @@ -919,3 +919,8 @@ sync-charts: @(cd "$(ROOT)/chart/kube-arangodb"; find . -type f -not -name values.yaml -not -name Chart.yaml -exec cp "$(ROOT)/chart/kube-arangodb/{}" "$(ROOT)/chart/kube-arangodb-arm64/{}" \;) sync: sync-charts + +ci-check: + @$(MAKE) tidy vendor update-generated synchronize-v2alpha1-with-v1 generate-internal sync fmt yamlfmt license + @git checkout -- go.sum # ignore changes in go.sum + @if [ ! -z "$(git status --porcelain)" ]; then echo "There are uncommited changes!"; git status; exit 1; fi \ No newline at end of file diff --git a/pkg/apis/deployment/v1/server_group.go b/pkg/apis/deployment/v1/server_group.go index 87f0ab8aa..32c01f65f 100644 --- a/pkg/apis/deployment/v1/server_group.go +++ b/pkg/apis/deployment/v1/server_group.go @@ -144,6 +144,35 @@ func (g ServerGroup) AsRole() string { } } +// Enabled checks if group is enabled for a mode +func (g ServerGroup) Enabled(mode DeploymentMode) bool { + switch mode { + case DeploymentModeSingle: + switch g { + case ServerGroupSingle: + return true + default: + return false + } + case DeploymentModeActiveFailover: + switch g { + case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: + return true + default: + return false + } + case DeploymentModeCluster: + switch g { + case ServerGroupSingle, ServerGroupAgents: + return true + default: + return false + } + default: + return false + } +} + // AsRoleAbbreviated returns the abbreviation of the "role" value for the given group. func (g ServerGroup) AsRoleAbbreviated() string { switch g { diff --git a/pkg/apis/deployment/v2alpha1/server_group.go b/pkg/apis/deployment/v2alpha1/server_group.go index e0de530a5..32c00159c 100644 --- a/pkg/apis/deployment/v2alpha1/server_group.go +++ b/pkg/apis/deployment/v2alpha1/server_group.go @@ -144,6 +144,35 @@ func (g ServerGroup) AsRole() string { } } +// Enabled checks if group is enabled for a mode +func (g ServerGroup) Enabled(mode DeploymentMode) bool { + switch mode { + case DeploymentModeSingle: + switch g { + case ServerGroupSingle: + return true + default: + return false + } + case DeploymentModeActiveFailover: + switch g { + case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: + return true + default: + return false + } + case DeploymentModeCluster: + switch g { + case ServerGroupSingle, ServerGroupAgents: + return true + default: + return false + } + default: + return false + } +} + // AsRoleAbbreviated returns the abbreviation of the "role" value for the given group. func (g ServerGroup) AsRoleAbbreviated() string { switch g { diff --git a/pkg/deployment/resources/pod_leader.go b/pkg/deployment/resources/pod_leader.go index d4d6f885f..6be14bd8a 100644 --- a/pkg/deployment/resources/pod_leader.go +++ b/pkg/deployment/resources/pod_leader.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -136,7 +136,7 @@ func (r *Resources) EnsureLeader(ctx context.Context, cachedStatus inspectorInte } } - s := r.createService(leaderAgentSvcName, r.context.GetNamespace(), "", core.ServiceTypeClusterIP, r.context.GetAPIObject().AsOwner(), ports, selector) + s := r.createService(leaderAgentSvcName, r.context.GetNamespace(), "", core.ServiceTypeClusterIP, true, r.context.GetAPIObject().AsOwner(), ports, selector) err := globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { _, err := cachedStatus.ServicesModInterface().V1().Create(ctxChild, s, meta.CreateOptions{}) return err diff --git a/pkg/deployment/resources/services.go b/pkg/deployment/resources/services.go index c3e4920aa..45fef63b7 100644 --- a/pkg/deployment/resources/services.go +++ b/pkg/deployment/resources/services.go @@ -22,6 +22,7 @@ package resources import ( "context" + "fmt" "strings" "time" @@ -49,9 +50,7 @@ var ( ) // createService returns service's object. -func (r *Resources) createService(name, namespace, clusterIP string, serviceType core.ServiceType, owner meta.OwnerReference, ports []core.ServicePort, - selector map[string]string) *core.Service { - +func (r *Resources) createService(name, namespace, clusterIP string, serviceType core.ServiceType, publishNotReadyAddresses bool, owner meta.OwnerReference, ports []core.ServicePort, selector map[string]string) *core.Service { return &core.Service{ ObjectMeta: meta.ObjectMeta{ Name: name, @@ -64,7 +63,7 @@ func (r *Resources) createService(name, namespace, clusterIP string, serviceType Type: serviceType, ClusterIP: clusterIP, Ports: ports, - PublishNotReadyAddresses: true, + PublishNotReadyAddresses: publishNotReadyAddresses, Selector: selector, }, } @@ -101,7 +100,7 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn ports := CreateServerServicePortsWithSidecars(amInspector, e.Member.ArangoMemberName(deploymentName, e.Group)) selector := k8sutil.LabelsForActiveMember(deploymentName, e.Group.AsRole(), e.Member.ID) if s, ok := cachedStatus.Service().V1().GetSimple(member.GetName()); !ok { - s := r.createService(member.GetName(), member.GetNamespace(), spec.CommunicationMethod.ServiceClusterIP(), spec.CommunicationMethod.ServiceType(), member.AsOwner(), ports, selector) + s := r.createService(member.GetName(), member.GetNamespace(), spec.CommunicationMethod.ServiceClusterIP(), spec.CommunicationMethod.ServiceType(), true, member.AsOwner(), ports, selector) err := globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { _, err := svcs.Create(ctxChild, s, meta.CreateOptions{}) @@ -129,6 +128,63 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn } } + // Group Services + for _, group := range api.AllServerGroups { + if !group.Enabled(spec.GetMode()) { + continue + } + + name := fmt.Sprintf("%s-%s", deploymentName, group.AsRole()) + s, ok := cachedStatus.Service().V1().GetSimple(name) + + details := spec.GetServerGroupSpec(group) + if details.GetCount() == 0 { + if !ok { + // We do not expect service and it is gone + continue + } + + if err := globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { + return svcs.Delete(ctxChild, s.GetName(), meta.DeleteOptions{}) + }); err != nil { + if !kerrors.IsNotFound(err) { + return err + } + reconcileRequired.Required() + } + } else { + selector := k8sutil.LabelsForDeployment(deploymentName, group.AsRole()) + ports := []core.ServicePort{CreateServerServicePort()} + // Service should exists + if !ok { + s := r.createService(name, apiObject.GetNamespace(), spec.CommunicationMethod.ServiceClusterIP(), spec.CommunicationMethod.ServiceType(), false, apiObject.AsOwner(), ports, selector) + + err := globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { + _, err := svcs.Create(ctxChild, s, meta.CreateOptions{}) + return err + }) + if err != nil { + if !kerrors.IsConflict(err) { + return err + } + } + + reconcileRequired.Required() + continue + } else { + if changed, err := patcher.ServicePatcher(ctx, svcs, s, meta.PatchOptions{}, + patcher.PatchServicePorts(ports), + patcher.PatchServiceSelector(selector), + patcher.PatchServicePublishNotReadyAddresses(false), + patcher.PatchServiceType(spec.CommunicationMethod.ServiceType())); err != nil { + return err + } else if changed { + reconcileRequired.Required() + } + } + } + } + // Headless service counterMetric.Inc() headlessPorts, headlessSelector := k8sutil.HeadlessServiceDetails(deploymentName) From 37522ee616b3d33adb656da23db766707c95f376 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:08:46 +0300 Subject: [PATCH 06/50] [Bugfix] Fix Networking Client (#1695) --- CHANGELOG.md | 1 + pkg/apis/networking/v1alpha1/register.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cc7238d9..1ef130963 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - (Feature) ArangoRoute CRD - (Feature) ArangoRoute Operator - (Feature) Add Kubernetes Services for Group +- (Bugfix) Fix Networking Client ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/apis/networking/v1alpha1/register.go b/pkg/apis/networking/v1alpha1/register.go index af7697c9f..c4ba9767c 100644 --- a/pkg/apis/networking/v1alpha1/register.go +++ b/pkg/apis/networking/v1alpha1/register.go @@ -46,7 +46,10 @@ func Resource(resource string) schema.GroupResource { // addKnownTypes adds the set of types defined in this package to the supplied scheme. func addKnownTypes(s *runtime.Scheme) error { - s.AddKnownTypes(SchemeGroupVersion) + s.AddKnownTypes(SchemeGroupVersion, + &ArangoRoute{}, + &ArangoRouteList{}, + ) meta.AddToGroupVersion(s, SchemeGroupVersion) return nil } From 65ada1d111c4d1193bb0e1d41066baed6be0ac76 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:15:47 +0300 Subject: [PATCH 07/50] [Feature] ConfigMap Inspector (#1696) --- CHANGELOG.md | 1 + .../resources/inspector/configmaps.go | 196 ++++++++++++++++++ .../inspector/configmaps_anonymous.go | 46 ++++ .../resources/inspector/configmaps_gvk.go | 43 ++++ .../resources/inspector/configmaps_mod.go | 49 +++++ .../resources/inspector/configmaps_v1.go | 118 +++++++++++ .../resources/inspector/inspector.go | 13 ++ .../resources/inspector/inspector_test.go | 4 +- .../resources/inspector/pdbs_version_test.go | 2 +- .../resources/inspector/services_v1.go | 9 - .../resources/inspector/throttles.go | 1 + .../k8sutil/inspector/configmap/definition.go | 44 ++++ .../k8sutil/inspector/configmap/v1/loader.go | 40 ++++ .../k8sutil/inspector/configmap/v1/reader.go | 48 +++++ .../constants/configmaps_constants.go | 64 ++++++ .../inspector/definitions/components.go | 2 + pkg/util/k8sutil/inspector/inspector.go | 2 + pkg/util/k8sutil/inspector/mods/mods.go | 6 + .../k8sutil/inspector/throttle/throttle.go | 14 +- pkg/util/tests/kubernetes.go | 44 ++++ pkg/util/tests/kubernetes_test.go | 1 + 21 files changed, 733 insertions(+), 14 deletions(-) create mode 100644 pkg/deployment/resources/inspector/configmaps.go create mode 100644 pkg/deployment/resources/inspector/configmaps_anonymous.go create mode 100644 pkg/deployment/resources/inspector/configmaps_gvk.go create mode 100644 pkg/deployment/resources/inspector/configmaps_mod.go create mode 100644 pkg/deployment/resources/inspector/configmaps_v1.go create mode 100644 pkg/util/k8sutil/inspector/configmap/definition.go create mode 100644 pkg/util/k8sutil/inspector/configmap/v1/loader.go create mode 100644 pkg/util/k8sutil/inspector/configmap/v1/reader.go create mode 100644 pkg/util/k8sutil/inspector/constants/configmaps_constants.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ef130963..ea37e288b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - (Feature) ArangoRoute Operator - (Feature) Add Kubernetes Services for Group - (Bugfix) Fix Networking Client +- (Feature) ConfigMap Inspector ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/deployment/resources/inspector/configmaps.go b/pkg/deployment/resources/inspector/configmaps.go new file mode 100644 index 000000000..bc235e162 --- /dev/null +++ b/pkg/deployment/resources/inspector/configmaps.go @@ -0,0 +1,196 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "context" + "time" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version" +) + +func init() { + requireRegisterInspectorLoader(configMapsInspectorLoaderObj) +} + +var configMapsInspectorLoaderObj = configMapsInspectorLoader{} + +type configMapsInspectorLoader struct { +} + +func (p configMapsInspectorLoader) Component() definitions.Component { + return definitions.ConfigMap +} + +func (p configMapsInspectorLoader) Load(ctx context.Context, i *inspectorState) { + var q configMapsInspector + p.loadV1(ctx, i, &q) + i.configMaps = &q + q.state = i + q.last = time.Now() +} + +func (p configMapsInspectorLoader) loadV1(ctx context.Context, i *inspectorState, q *configMapsInspector) { + var z configMapsInspectorV1 + + z.configMapInspector = q + + z.configMaps, z.err = p.getV1ConfigMaps(ctx, i) + + q.v1 = &z +} + +func (p configMapsInspectorLoader) getV1ConfigMaps(ctx context.Context, i *inspectorState) (map[string]*core.ConfigMap, error) { + objs, err := p.getV1ConfigMapsList(ctx, i) + if err != nil { + return nil, err + } + + r := make(map[string]*core.ConfigMap, len(objs)) + + for id := range objs { + r[objs[id].GetName()] = objs[id] + } + + return r, nil +} + +func (p configMapsInspectorLoader) getV1ConfigMapsList(ctx context.Context, i *inspectorState) ([]*core.ConfigMap, error) { + ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) + defer cancel() + obj, err := i.client.Kubernetes().CoreV1().ConfigMaps(i.namespace).List(ctxChild, meta.ListOptions{ + Limit: globals.GetGlobals().Kubernetes().RequestBatchSize().Get(), + }) + + if err != nil { + return nil, err + } + + items := obj.Items + cont := obj.Continue + var s = int64(len(items)) + + if z := obj.RemainingItemCount; z != nil { + s += *z + } + + ptrs := make([]*core.ConfigMap, 0, s) + + for { + for id := range items { + ptrs = append(ptrs, &items[id]) + } + + if cont == "" { + break + } + + items, cont, err = p.getV1ConfigMapsListRequest(ctx, i, cont) + + if err != nil { + return nil, err + } + } + + return ptrs, nil +} + +func (p configMapsInspectorLoader) getV1ConfigMapsListRequest(ctx context.Context, i *inspectorState, cont string) ([]core.ConfigMap, string, error) { + ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) + defer cancel() + obj, err := i.client.Kubernetes().CoreV1().ConfigMaps(i.namespace).List(ctxChild, meta.ListOptions{ + Limit: globals.GetGlobals().Kubernetes().RequestBatchSize().Get(), + Continue: cont, + }) + + if err != nil { + return nil, "", err + } + + return obj.Items, obj.Continue, err +} + +func (p configMapsInspectorLoader) Verify(i *inspectorState) error { + if err := i.configMaps.v1.err; err != nil { + return err + } + + return nil +} + +func (p configMapsInspectorLoader) Copy(from, to *inspectorState, override bool) { + if to.configMaps != nil { + if !override { + return + } + } + + to.configMaps = from.configMaps + to.configMaps.state = to +} + +func (p configMapsInspectorLoader) Name() string { + return "configMaps" +} + +type configMapsInspector struct { + state *inspectorState + + last time.Time + + v1 *configMapsInspectorV1 +} + +func (p *configMapsInspector) LastRefresh() time.Time { + return p.last +} + +func (p *configMapsInspector) Refresh(ctx context.Context) error { + p.Throttle(p.state.throttles).Invalidate() + return p.state.refresh(ctx, configMapsInspectorLoaderObj) +} + +func (p *configMapsInspector) Version() version.Version { + return version.V1 +} + +func (p *configMapsInspector) Throttle(c throttle.Components) throttle.Throttle { + return c.ConfigMap() +} + +func (p *configMapsInspector) validate() error { + if p == nil { + return errors.Errorf("ConfigMapInspector is nil") + } + + if p.state == nil { + return errors.Errorf("Parent is nil") + } + + return p.v1.validate() +} diff --git a/pkg/deployment/resources/inspector/configmaps_anonymous.go b/pkg/deployment/resources/inspector/configmaps_anonymous.go new file mode 100644 index 000000000..2a027d220 --- /dev/null +++ b/pkg/deployment/resources/inspector/configmaps_anonymous.go @@ -0,0 +1,46 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" +) + +func (p *configMapsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { + g := constants.ConfigMapGKv1() + + if g.Kind == gvk.Kind && g.Group == gvk.Group { + switch gvk.Version { + case constants.ConfigMapVersionV1, DefaultVersion: + if p.v1 == nil || p.v1.err != nil { + return nil, false + } + return anonymous.NewAnonymous[*core.ConfigMap](g, p.state.configMaps.v1, generic.WithModStatus[*core.ConfigMap](g, p.state.ConfigMapsModInterface().V1())), true + } + } + + return nil, false +} diff --git a/pkg/deployment/resources/inspector/configmaps_gvk.go b/pkg/deployment/resources/inspector/configmaps_gvk.go new file mode 100644 index 000000000..053a96549 --- /dev/null +++ b/pkg/deployment/resources/inspector/configmaps_gvk.go @@ -0,0 +1,43 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *configMapsInspectorV1) GroupVersionKind() schema.GroupVersionKind { + return constants.ConfigMapGKv1() +} + +func (p *configMapsInspectorV1) GroupVersionResource() schema.GroupVersionResource { + return constants.ConfigMapGRv1() +} + +func (p *configMapsInspector) GroupKind() schema.GroupKind { + return constants.ConfigMapGK() +} + +func (p *configMapsInspector) GroupResource() schema.GroupResource { + return constants.ConfigMapGR() +} diff --git a/pkg/deployment/resources/inspector/configmaps_mod.go b/pkg/deployment/resources/inspector/configmaps_mod.go new file mode 100644 index 000000000..3791df565 --- /dev/null +++ b/pkg/deployment/resources/inspector/configmaps_mod.go @@ -0,0 +1,49 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + core "k8s.io/api/core/v1" + + configMapv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/mods" +) + +func (i *inspectorState) ConfigMapsModInterface() mods.ConfigMapsMods { + return configMapsMod{ + i: i, + } +} + +type configMapsMod struct { + i *inspectorState +} + +func (p configMapsMod) V1() configMapv1.ModInterface { + return wrapMod[*core.ConfigMap](definitions.ConfigMap, p.i.GetThrottles, generic.WithModStatusGetter[*core.ConfigMap](constants.ConfigMapGKv1(), p.clientv1)) +} + +func (p configMapsMod) clientv1() generic.ModClient[*core.ConfigMap] { + return p.i.Client().Kubernetes().CoreV1().ConfigMaps(p.i.Namespace()) +} diff --git a/pkg/deployment/resources/inspector/configmaps_v1.go b/pkg/deployment/resources/inspector/configmaps_v1.go new file mode 100644 index 000000000..b7a2f90fb --- /dev/null +++ b/pkg/deployment/resources/inspector/configmaps_v1.go @@ -0,0 +1,118 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "context" + + core "k8s.io/api/core/v1" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *configMapsInspector) V1() ins.Inspector { + return p.v1 +} + +type configMapsInspectorV1 struct { + configMapInspector *configMapsInspector + + configMaps map[string]*core.ConfigMap + err error +} + +func (p *configMapsInspectorV1) validate() error { + if p == nil { + return errors.Errorf("ConfigMapsV1Inspector is nil") + } + + if p.configMapInspector == nil { + return errors.Errorf("Parent is nil") + } + + if p.configMaps == nil { + return errors.Errorf("ConfigMaps or err should be not nil") + } + + if p.err != nil { + return errors.Errorf("ConfigMaps or err cannot be not nil together") + } + + return nil +} + +func (p *configMapsInspectorV1) ListSimple() []*core.ConfigMap { + var r []*core.ConfigMap + for _, configMap := range p.configMaps { + r = append(r, configMap) + } + + return r +} + +func (p *configMapsInspectorV1) GetSimple(name string) (*core.ConfigMap, bool) { + configMap, ok := p.configMaps[name] + if !ok { + return nil, false + } + + return configMap, true +} + +func (p *configMapsInspectorV1) Iterate(action ins.Action, filters ...ins.Filter) error { + for _, configMap := range p.configMaps { + if err := p.iterateConfigMap(configMap, action, filters...); err != nil { + return err + } + } + + return nil +} + +func (p *configMapsInspectorV1) iterateConfigMap(configMap *core.ConfigMap, action ins.Action, filters ...ins.Filter) error { + for _, f := range filters { + if f == nil { + continue + } + + if !f(configMap) { + return nil + } + } + + return action(configMap) +} + +func (p *configMapsInspectorV1) Read() ins.ReadInterface { + return p +} + +func (p *configMapsInspectorV1) Get(ctx context.Context, name string, opts meta.GetOptions) (*core.ConfigMap, error) { + if s, ok := p.GetSimple(name); !ok { + return nil, apiErrors.NewNotFound(constants.ConfigMapGR(), name) + } else { + return s, nil + } +} diff --git a/pkg/deployment/resources/inspector/inspector.go b/pkg/deployment/resources/inspector/inspector.go index d28fae726..8ed7bd964 100644 --- a/pkg/deployment/resources/inspector/inspector.go +++ b/pkg/deployment/resources/inspector/inspector.go @@ -44,6 +44,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/node" @@ -126,6 +127,7 @@ type inspectorState struct { pods *podsInspector secrets *secretsInspector + configMaps *configMapsInspector persistentVolumeClaims *persistentVolumeClaimsInspector services *servicesInspector serviceAccounts *serviceAccountsInspector @@ -158,6 +160,7 @@ func (i *inspectorState) RegisterInformers(k8s informers.SharedInformerFactory, k8s.Core().V1().Pods().Informer().AddEventHandler(i.eventHandler(definitions.Pod)) k8s.Core().V1().Secrets().Informer().AddEventHandler(i.eventHandler(definitions.Secret)) + k8s.Core().V1().ConfigMaps().Informer().AddEventHandler(i.eventHandler(definitions.ConfigMap)) k8s.Core().V1().Services().Informer().AddEventHandler(i.eventHandler(definitions.Service)) k8s.Core().V1().ServiceAccounts().Informer().AddEventHandler(i.eventHandler(definitions.ServiceAccount)) k8s.Core().V1().Endpoints().Informer().AddEventHandler(i.eventHandler(definitions.Endpoints)) @@ -222,6 +225,7 @@ func (i *inspectorState) AnonymousObjects() []anonymous.Impl { return []anonymous.Impl{ i.pods, i.secrets, + i.configMaps, i.persistentVolumeClaims, i.services, i.serviceAccounts, @@ -280,6 +284,10 @@ func (i *inspectorState) Secret() secret.Definition { return i.secrets } +func (i *inspectorState) ConfigMap() configmap.Definition { + return i.configMaps +} + func (i *inspectorState) PersistentVolumeClaim() persistentvolumeclaim.Definition { return i.persistentVolumeClaims } @@ -443,6 +451,10 @@ func (i *inspectorState) validate() error { return err } + if err := i.configMaps.validate(); err != nil { + return err + } + if err := i.serviceAccounts.validate(); err != nil { return err } @@ -501,6 +513,7 @@ func (i *inspectorState) copyCore() *inspectorState { client: i.client, pods: i.pods, secrets: i.secrets, + configMaps: i.configMaps, persistentVolumeClaims: i.persistentVolumeClaims, services: i.services, serviceAccounts: i.serviceAccounts, diff --git a/pkg/deployment/resources/inspector/inspector_test.go b/pkg/deployment/resources/inspector/inspector_test.go index 848a92189..262fd519a 100644 --- a/pkg/deployment/resources/inspector/inspector_test.go +++ b/pkg/deployment/resources/inspector/inspector_test.go @@ -142,7 +142,7 @@ func getAllTypes() []string { func Test_Inspector_RefreshMatrix(t *testing.T) { c := kclient.NewFakeClient() - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") @@ -302,7 +302,7 @@ func Test_Inspector_Load(t *testing.T) { func Test_Inspector_Invalidate(t *testing.T) { c := kclient.NewFakeClient() - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") diff --git a/pkg/deployment/resources/inspector/pdbs_version_test.go b/pkg/deployment/resources/inspector/pdbs_version_test.go index cea38d963..d0e96460f 100644 --- a/pkg/deployment/resources/inspector/pdbs_version_test.go +++ b/pkg/deployment/resources/inspector/pdbs_version_test.go @@ -52,7 +52,7 @@ func Test_PDB_Versions(t *testing.T) { GitVersion: v, }) - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") require.NoError(t, i.Refresh(context.Background())) diff --git a/pkg/deployment/resources/inspector/services_v1.go b/pkg/deployment/resources/inspector/services_v1.go index 0cfd4384f..b7ad1b28a 100644 --- a/pkg/deployment/resources/inspector/services_v1.go +++ b/pkg/deployment/resources/inspector/services_v1.go @@ -63,15 +63,6 @@ func (p *servicesInspectorV1) validate() error { return nil } -func (p *servicesInspectorV1) Services() []*core.Service { - var r []*core.Service - for _, service := range p.services { - r = append(r, service) - } - - return r -} - func (p *servicesInspectorV1) GetSimple(name string) (*core.Service, bool) { service, ok := p.services[name] if !ok { diff --git a/pkg/deployment/resources/inspector/throttles.go b/pkg/deployment/resources/inspector/throttles.go index 39cf020b1..26baaa36a 100644 --- a/pkg/deployment/resources/inspector/throttles.go +++ b/pkg/deployment/resources/inspector/throttles.go @@ -38,6 +38,7 @@ func NewDefaultThrottle() throttle.Components { time.Second, // Pod 30*time.Second, // PDB 10*time.Second, // Secret + 30*time.Second, // ConfigMap 10*time.Second, // Service 30*time.Second, // SA 30*time.Second, // ServiceMonitor diff --git a/pkg/util/k8sutil/inspector/configmap/definition.go b/pkg/util/k8sutil/inspector/configmap/definition.go new file mode 100644 index 000000000..bc5e23a71 --- /dev/null +++ b/pkg/util/k8sutil/inspector/configmap/definition.go @@ -0,0 +1,44 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package configmap + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" + v1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/refresh" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version" +) + +type Inspector interface { + ConfigMap() Definition +} + +type Definition interface { + refresh.Inspector + + gvk.GK + anonymous.Impl + + Version() version.Version + + V1() v1.Inspector +} diff --git a/pkg/util/k8sutil/inspector/configmap/v1/loader.go b/pkg/util/k8sutil/inspector/configmap/v1/loader.go new file mode 100644 index 000000000..72902ce96 --- /dev/null +++ b/pkg/util/k8sutil/inspector/configmap/v1/loader.go @@ -0,0 +1,40 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" +) + +// Inspector for configmaps +type Inspector interface { + gvk.GVK + + ListSimple() []*core.ConfigMap + GetSimple(name string) (*core.ConfigMap, bool) + Iterate(action Action, filters ...Filter) error + Read() ReadInterface +} + +type Filter func(pod *core.ConfigMap) bool +type Action func(pod *core.ConfigMap) error diff --git a/pkg/util/k8sutil/inspector/configmap/v1/reader.go b/pkg/util/k8sutil/inspector/configmap/v1/reader.go new file mode 100644 index 000000000..b2262fefd --- /dev/null +++ b/pkg/util/k8sutil/inspector/configmap/v1/reader.go @@ -0,0 +1,48 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +// ModInterface has methods to work with ConfigMap resources only for creation +type ModInterface interface { + Create(ctx context.Context, configmap *core.ConfigMap, opts meta.CreateOptions) (*core.ConfigMap, error) + Update(ctx context.Context, configmap *core.ConfigMap, opts meta.UpdateOptions) (*core.ConfigMap, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result *core.ConfigMap, err error) + Delete(ctx context.Context, name string, opts meta.DeleteOptions) error +} + +// Interface has methods to work with ConfigMap resources. +type Interface interface { + ModInterface + ReadInterface +} + +// ReadInterface has methods to work with ConfigMap resources with ReadOnly mode. +type ReadInterface interface { + Get(ctx context.Context, name string, opts meta.GetOptions) (*core.ConfigMap, error) +} diff --git a/pkg/util/k8sutil/inspector/constants/configmaps_constants.go b/pkg/util/k8sutil/inspector/constants/configmaps_constants.go new file mode 100644 index 000000000..8ed8844d2 --- /dev/null +++ b/pkg/util/k8sutil/inspector/constants/configmaps_constants.go @@ -0,0 +1,64 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package constants + +import ( + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// ConfigMap +const ( + ConfigMapGroup = core.GroupName + ConfigMapResource = "configmaps" + ConfigMapKind = "ConfigMap" + ConfigMapVersionV1 = "v1" +) + +func ConfigMapGK() schema.GroupKind { + return schema.GroupKind{ + Group: ConfigMapGroup, + Kind: ConfigMapKind, + } +} + +func ConfigMapGKv1() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: ConfigMapGroup, + Kind: ConfigMapKind, + Version: ConfigMapVersionV1, + } +} + +func ConfigMapGR() schema.GroupResource { + return schema.GroupResource{ + Group: ConfigMapGroup, + Resource: ConfigMapResource, + } +} + +func ConfigMapGRv1() schema.GroupVersionResource { + return schema.GroupVersionResource{ + Group: ConfigMapGroup, + Resource: ConfigMapResource, + Version: ConfigMapVersionV1, + } +} diff --git a/pkg/util/k8sutil/inspector/definitions/components.go b/pkg/util/k8sutil/inspector/definitions/components.go index af4b8c115..e78759c2a 100644 --- a/pkg/util/k8sutil/inspector/definitions/components.go +++ b/pkg/util/k8sutil/inspector/definitions/components.go @@ -35,6 +35,7 @@ const ( Pod Component = "Pod" PodDisruptionBudget Component = "PodDisruptionBudget" Secret Component = "Secret" + ConfigMap Component = "ConfigMap" Service Component = "Service" ServiceAccount Component = "ServiceAccount" ServiceMonitor Component = "ServiceMonitor" @@ -53,6 +54,7 @@ func AllComponents() []Component { Pod, PodDisruptionBudget, Secret, + ConfigMap, Service, ServiceAccount, ServiceMonitor, diff --git a/pkg/util/k8sutil/inspector/inspector.go b/pkg/util/k8sutil/inspector/inspector.go index 763c37643..6064b7e0a 100644 --- a/pkg/util/k8sutil/inspector/inspector.go +++ b/pkg/util/k8sutil/inspector/inspector.go @@ -34,6 +34,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/mods" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/node" @@ -76,6 +77,7 @@ type Inspector interface { pod.Inspector secret.Inspector + configmap.Inspector persistentvolumeclaim.Inspector service.Inspector poddisruptionbudget.Inspector diff --git a/pkg/util/k8sutil/inspector/mods/mods.go b/pkg/util/k8sutil/inspector/mods/mods.go index e5bfc6e23..3f1e2761c 100644 --- a/pkg/util/k8sutil/inspector/mods/mods.go +++ b/pkg/util/k8sutil/inspector/mods/mods.go @@ -25,6 +25,7 @@ import ( arangomemberv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember/v1" arangoroutev1alpha1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute/v1alpha1" arangotaskv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask/v1" + configMapv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" endpointsv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints/v1" persistentvolumeclaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" @@ -47,6 +48,10 @@ type SecretsMods interface { V1() secretv1.ModInterface } +type ConfigMapsMods interface { + V1() configMapv1.ModInterface +} + type PersistentVolumeClaimsMods interface { V1() persistentvolumeclaimv1.ModInterface } @@ -87,6 +92,7 @@ type Mods interface { PodsModInterface() PodsMods ServiceAccountsModInterface() ServiceAccountsMods SecretsModInterface() SecretsMods + ConfigMapsModInterface() ConfigMapsMods PersistentVolumeClaimsModInterface() PersistentVolumeClaimsMods ServicesModInterface() ServicesMods EndpointsModInterface() EndpointsMods diff --git a/pkg/util/k8sutil/inspector/throttle/throttle.go b/pkg/util/k8sutil/inspector/throttle/throttle.go index 96bacf9f2..0fe1afde6 100644 --- a/pkg/util/k8sutil/inspector/throttle/throttle.go +++ b/pkg/util/k8sutil/inspector/throttle/throttle.go @@ -32,10 +32,10 @@ type Inspector interface { } func NewAlwaysThrottleComponents() Components { - return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) } -func NewThrottleComponents(acs, am, at, ar, node, pvc, pod, pv, pdb, secret, service, serviceAccount, sm, endpoints time.Duration) Components { +func NewThrottleComponents(acs, am, at, ar, node, pvc, pod, pv, pdb, secret, cm, service, serviceAccount, sm, endpoints time.Duration) Components { return &throttleComponents{ arangoClusterSynchronization: NewThrottle(acs), arangoMember: NewThrottle(am), @@ -47,6 +47,7 @@ func NewThrottleComponents(acs, am, at, ar, node, pvc, pod, pv, pdb, secret, ser pod: NewThrottle(pod), podDisruptionBudget: NewThrottle(pdb), secret: NewThrottle(secret), + configMap: NewThrottle(cm), service: NewThrottle(service), serviceAccount: NewThrottle(serviceAccount), serviceMonitor: NewThrottle(sm), @@ -65,6 +66,7 @@ type Components interface { Pod() Throttle PodDisruptionBudget() Throttle Secret() Throttle + ConfigMap() Throttle Service() Throttle ServiceAccount() Throttle ServiceMonitor() Throttle @@ -88,12 +90,17 @@ type throttleComponents struct { pod Throttle podDisruptionBudget Throttle secret Throttle + configMap Throttle service Throttle serviceAccount Throttle serviceMonitor Throttle endpoints Throttle } +func (t *throttleComponents) ConfigMap() Throttle { + return t.configMap +} + func (t *throttleComponents) PersistentVolume() Throttle { return t.persistentVolume } @@ -143,6 +150,8 @@ func (t *throttleComponents) Get(c definitions.Component) Throttle { return t.podDisruptionBudget case definitions.Secret: return t.secret + case definitions.ConfigMap: + return t.configMap case definitions.Service: return t.service case definitions.ServiceAccount: @@ -168,6 +177,7 @@ func (t *throttleComponents) Copy() Components { pod: t.pod.Copy(), podDisruptionBudget: t.podDisruptionBudget.Copy(), secret: t.secret.Copy(), + configMap: t.configMap.Copy(), service: t.service.Copy(), serviceAccount: t.serviceAccount.Copy(), serviceMonitor: t.serviceMonitor.Copy(), diff --git a/pkg/util/tests/kubernetes.go b/pkg/util/tests/kubernetes.go index 066ea95b8..5731a783a 100644 --- a/pkg/util/tests/kubernetes.go +++ b/pkg/util/tests/kubernetes.go @@ -131,6 +131,12 @@ func CreateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := k8s.CoreV1().Secrets(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) require.NoError(t, err) + case **core.ConfigMap: + require.NotNil(t, v) + + vl := *v + _, err := k8s.CoreV1().ConfigMaps(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) case **core.Service: require.NotNil(t, v) @@ -292,6 +298,12 @@ func UpdateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := k8s.CoreV1().Secrets(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) require.NoError(t, err) + case **core.ConfigMap: + require.NotNil(t, v) + + vl := *v + _, err := k8s.CoreV1().ConfigMaps(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) case **core.Service: require.NotNil(t, v) @@ -444,6 +456,11 @@ func DeleteObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v require.NoError(t, k8s.CoreV1().Secrets(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) + case **core.ConfigMap: + require.NotNil(t, v) + + vl := *v + require.NoError(t, k8s.CoreV1().ConfigMaps(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) case **core.Service: require.NotNil(t, v) @@ -617,6 +634,21 @@ func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientS } else { *v = vn } + case **core.ConfigMap: + require.NotNil(t, v) + + vl := *v + + vn, err := k8s.CoreV1().ConfigMaps(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } case **core.Service: require.NotNil(t, v) @@ -950,6 +982,12 @@ func SetMetaBasedOnType(t *testing.T, object meta.Object) { v.SetSelfLink(fmt.Sprintf("/api/v1/secrets/%s/%s", object.GetNamespace(), object.GetName())) + case *core.ConfigMap: + v.Kind = "ConfigMap" + v.APIVersion = "v1" + v.SetSelfLink(fmt.Sprintf("/api/v1/configmaps/%s/%s", + object.GetNamespace(), + object.GetName())) case *core.Service: v.Kind = "Service" v.APIVersion = "v1" @@ -1164,6 +1202,12 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind { Version: "v1", Kind: "Secret", } + case *core.ConfigMap: + return schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ConfigMap", + } case *core.Service: return schema.GroupVersionKind{ Group: "", diff --git a/pkg/util/tests/kubernetes_test.go b/pkg/util/tests/kubernetes_test.go index 57061255d..f20f6da01 100644 --- a/pkg/util/tests/kubernetes_test.go +++ b/pkg/util/tests/kubernetes_test.go @@ -70,6 +70,7 @@ func Test_NewMetaObject(t *testing.T) { NewMetaObjectRun[*batch.Job](t) NewMetaObjectRun[*core.Pod](t) NewMetaObjectRun[*core.Secret](t) + NewMetaObjectRun[*core.ConfigMap](t) NewMetaObjectRun[*core.ServiceAccount](t) NewMetaObjectRun[*core.Service](t) NewMetaObjectRun[*apps.StatefulSet](t) From e9670b3ece639002ecfc761398d67ddfda3949bd Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:24:40 +0300 Subject: [PATCH 08/50] [Bugfix] Fix Enabled Mode Condition (#1697) --- pkg/apis/deployment/v1/server_group.go | 4 ++-- pkg/apis/deployment/v2alpha1/server_group.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/apis/deployment/v1/server_group.go b/pkg/apis/deployment/v1/server_group.go index 32c01f65f..38df8a5f3 100644 --- a/pkg/apis/deployment/v1/server_group.go +++ b/pkg/apis/deployment/v1/server_group.go @@ -154,14 +154,14 @@ func (g ServerGroup) Enabled(mode DeploymentMode) bool { default: return false } - case DeploymentModeActiveFailover: + case DeploymentModeCluster: switch g { case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: return true default: return false } - case DeploymentModeCluster: + case DeploymentModeActiveFailover: switch g { case ServerGroupSingle, ServerGroupAgents: return true diff --git a/pkg/apis/deployment/v2alpha1/server_group.go b/pkg/apis/deployment/v2alpha1/server_group.go index 32c00159c..be7f1aca6 100644 --- a/pkg/apis/deployment/v2alpha1/server_group.go +++ b/pkg/apis/deployment/v2alpha1/server_group.go @@ -154,14 +154,14 @@ func (g ServerGroup) Enabled(mode DeploymentMode) bool { default: return false } - case DeploymentModeActiveFailover: + case DeploymentModeCluster: switch g { case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: return true default: return false } - case DeploymentModeCluster: + case DeploymentModeActiveFailover: switch g { case ServerGroupSingle, ServerGroupAgents: return true From e84f860c4fa8d831d57edc6c8c387e39e571abed Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:15:27 +0300 Subject: [PATCH 09/50] [Feature] Envoy Image Layer (#1698) --- CHANGELOG.md | 1 + Dockerfile | 15 +++++++++++++-- Dockerfile.ubi | 30 ++++++++++++++++++++++++++++-- Makefile | 12 +++++++++--- 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea37e288b..d7dfeadb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - (Feature) Add Kubernetes Services for Group - (Bugfix) Fix Networking Client - (Feature) ConfigMap Inspector +- (Feature) Envoy Image Layer ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Dockerfile b/Dockerfile index 095e7c5fe..dc08f9e1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,15 @@ -ARG IMAGE=scratch -FROM ${IMAGE} +ARG IMAGE=alpine:3.17 +ARG ENVOY_IMAGE=envoyproxy/envoy:v1.31.0 + +# Build Steps + +FROM ${ENVOY_IMAGE} AS envoy + +FROM ${IMAGE} AS base + +RUN apk upgrade --no-cache + +FROM base ARG VERSION LABEL name="kube-arangodb" \ @@ -15,5 +25,6 @@ ADD ./LICENSE /licenses/LICENSE ARG RELEASE_MODE=community ARG TARGETARCH ADD bin/${RELEASE_MODE}/linux/${TARGETARCH}/arangodb_operator /usr/bin/arangodb_operator +COPY --from=envoy /usr/local/bin/envoy /usr/local/bin/envoy ENTRYPOINT [ "/usr/bin/arangodb_operator" ] diff --git a/Dockerfile.ubi b/Dockerfile.ubi index 868d7339b..e10bbaa3e 100644 --- a/Dockerfile.ubi +++ b/Dockerfile.ubi @@ -1,4 +1,30 @@ ARG IMAGE=registry.access.redhat.com/ubi8/ubi-minimal:8.4 -FROM ${IMAGE} +ARG ENVOY_IMAGE=envoyproxy/envoy:v1.31.0 -RUN microdnf update && microdnf clean all \ No newline at end of file +# Build Steps + +FROM ${ENVOY_IMAGE} AS envoy + +FROM ${IMAGE} AS base + +RUN microdnf update && microdnf clean all + +FROM base + +ARG VERSION +LABEL name="kube-arangodb" \ + vendor="ArangoDB" \ + version="${VERSION}" \ + release="${VERSION}" \ + summary="ArangoDB Kubernetes Oparator" \ + description="ArangoDB Kubernetes Operator" \ + maintainer="redhat@arangodb.com" + +ADD ./LICENSE /licenses/LICENSE + +ARG RELEASE_MODE=community +ARG TARGETARCH +ADD bin/${RELEASE_MODE}/linux/${TARGETARCH}/arangodb_operator /usr/bin/arangodb_operator +COPY --from=envoy /usr/local/bin/envoy /usr/local/bin/envoy + +ENTRYPOINT [ "/usr/bin/arangodb_operator" ] diff --git a/Makefile b/Makefile index 80f18aa20..62c999662 100644 --- a/Makefile +++ b/Makefile @@ -488,10 +488,16 @@ endif .PHONY: docker-ubi docker-ubi: check-vars $(VBIN_LINUX_AMD64) - docker build --no-cache -f "$(DOCKERFILE).ubi" --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "IMAGE=$(BASEUBIIMAGE)" -t $(OPERATORUBIIMAGE)-local-only-build . - docker build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "TARGETARCH=amd64" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "IMAGE=$(OPERATORUBIIMAGE)-local-only-build" -t $(OPERATORUBIIMAGE) . ifdef PUSHIMAGES - docker push $(OPERATORUBIIMAGE) + docker buildx build --no-cache -f "$(DOCKERFILE).ubi" --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \ + --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \ + --build-arg "IMAGE=$(BASEUBIIMAGE)" \ + --platform linux/amd64 --push -t $(OPERATORUBIIMAGE) . +else + docker buildx build --no-cache -f "$(DOCKERFILE).ubi" --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \ + --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \ + --build-arg "IMAGE=$(BASEUBIIMAGE)" \ + --platform linux/amd64 -t $(OPERATORUBIIMAGE) . endif # Manifests From 5772914840773713e23804aa326ab96376e382aa Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:02:36 +0200 Subject: [PATCH 10/50] [Feature] Add ArangoDeployment ServerGroupType (#1699) --- CHANGELOG.md | 1 + pkg/apis/deployment/v1/server_group.go | 14 ++++ pkg/apis/deployment/v1/server_group_spec.go | 5 +- pkg/apis/deployment/v1/server_group_test.go | 13 +++- pkg/apis/deployment/v1/server_group_type.go | 30 ++++++++ pkg/apis/deployment/v2alpha1/server_group.go | 14 ++++ .../deployment/v2alpha1/server_group_spec.go | 5 +- .../deployment/v2alpha1/server_group_test.go | 13 +++- .../deployment/v2alpha1/server_group_type.go | 30 ++++++++ pkg/deployment/deployment_suite_test.go | 75 ++++++++++--------- pkg/deployment/member/state.go | 40 ++++++---- pkg/deployment/pod/utils.go | 8 +- .../reconcile/action_wait_for_member_up.go | 36 +++++---- pkg/deployment/reconcile/helper_shutdown.go | 13 +++- pkg/deployment/reconcile/plan_builder_tls.go | 71 +++++++++++------- pkg/deployment/resources/pod_creator.go | 17 +++-- .../resources/pod_creator_arangod.go | 2 +- pkg/deployment/resources/secrets.go | 56 +++++++------- pkg/util/assertion/assert.go | 19 +++-- 19 files changed, 316 insertions(+), 146 deletions(-) create mode 100644 pkg/apis/deployment/v1/server_group_type.go create mode 100644 pkg/apis/deployment/v2alpha1/server_group_type.go diff --git a/CHANGELOG.md b/CHANGELOG.md index d7dfeadb7..80ddc7d55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - (Bugfix) Fix Networking Client - (Feature) ConfigMap Inspector - (Feature) Envoy Image Layer +- (Feature) Add ArangoDeployment ServerGroupType ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/apis/deployment/v1/server_group.go b/pkg/apis/deployment/v1/server_group.go index 38df8a5f3..b504f1cd9 100644 --- a/pkg/apis/deployment/v1/server_group.go +++ b/pkg/apis/deployment/v1/server_group.go @@ -122,6 +122,20 @@ var ( } ) +// Type returns the Group Type +func (g ServerGroup) Type() ServerGroupType { + switch g { + case ServerGroupAgents, ServerGroupSingle, ServerGroupDBServers, ServerGroupCoordinators: + return ServerGroupTypeArangoD + case ServerGroupImageDiscovery: + return ServerGroupTypeID + case ServerGroupSyncMasters, ServerGroupSyncWorkers: + return ServerGroupTypeArangoSync + default: + return ServerGroupTypeUnknown + } +} + // AsRole returns the "role" value for the given group. func (g ServerGroup) AsRole() string { switch g { diff --git a/pkg/apis/deployment/v1/server_group_spec.go b/pkg/apis/deployment/v1/server_group_spec.go index 2436465af..3442bb731 100644 --- a/pkg/apis/deployment/v1/server_group_spec.go +++ b/pkg/apis/deployment/v1/server_group_spec.go @@ -514,11 +514,12 @@ func (s ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentM for _, arg := range s.Args { parts := strings.Split(arg, "=") optionKey := strings.TrimSpace(parts[0]) - if group.IsArangod() { + switch group.Type() { + case ServerGroupTypeArangoD: if arangodOptions.IsCriticalOption(optionKey) { return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey)) } - } else if group.IsArangosync() { + case ServerGroupTypeArangoSync: if arangosyncOptions.IsCriticalOption(optionKey) { return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey)) } diff --git a/pkg/apis/deployment/v1/server_group_test.go b/pkg/apis/deployment/v1/server_group_test.go index 9a7743992..ef2ddc8d9 100644 --- a/pkg/apis/deployment/v1/server_group_test.go +++ b/pkg/apis/deployment/v1/server_group_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -61,3 +61,14 @@ func TestServerGroupIsArangosync(t *testing.T) { assert.True(t, ServerGroupSyncMasters.IsArangosync()) assert.True(t, ServerGroupSyncWorkers.IsArangosync()) } + +func TestServerGroupType(t *testing.T) { + assert.Equal(t, ServerGroupTypeUnknown, ServerGroupUnknown.Type()) + assert.Equal(t, ServerGroupTypeID, ServerGroupImageDiscovery.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupSingle.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupAgents.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupDBServers.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupCoordinators.Type()) + assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncMasters.Type()) + assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncWorkers.Type()) +} diff --git a/pkg/apis/deployment/v1/server_group_type.go b/pkg/apis/deployment/v1/server_group_type.go new file mode 100644 index 000000000..1c3c24f5d --- /dev/null +++ b/pkg/apis/deployment/v1/server_group_type.go @@ -0,0 +1,30 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +type ServerGroupType int + +const ( + ServerGroupTypeUnknown ServerGroupType = iota + ServerGroupTypeArangoD + ServerGroupTypeArangoSync + ServerGroupTypeID +) diff --git a/pkg/apis/deployment/v2alpha1/server_group.go b/pkg/apis/deployment/v2alpha1/server_group.go index be7f1aca6..bc3c2be6c 100644 --- a/pkg/apis/deployment/v2alpha1/server_group.go +++ b/pkg/apis/deployment/v2alpha1/server_group.go @@ -122,6 +122,20 @@ var ( } ) +// Type returns the Group Type +func (g ServerGroup) Type() ServerGroupType { + switch g { + case ServerGroupAgents, ServerGroupSingle, ServerGroupDBServers, ServerGroupCoordinators: + return ServerGroupTypeArangoD + case ServerGroupImageDiscovery: + return ServerGroupTypeID + case ServerGroupSyncMasters, ServerGroupSyncWorkers: + return ServerGroupTypeArangoSync + default: + return ServerGroupTypeUnknown + } +} + // AsRole returns the "role" value for the given group. func (g ServerGroup) AsRole() string { switch g { diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec.go b/pkg/apis/deployment/v2alpha1/server_group_spec.go index 0f62fcfe5..8579e051c 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_spec.go +++ b/pkg/apis/deployment/v2alpha1/server_group_spec.go @@ -514,11 +514,12 @@ func (s ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentM for _, arg := range s.Args { parts := strings.Split(arg, "=") optionKey := strings.TrimSpace(parts[0]) - if group.IsArangod() { + switch group.Type() { + case ServerGroupTypeArangoD: if arangodOptions.IsCriticalOption(optionKey) { return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey)) } - } else if group.IsArangosync() { + case ServerGroupTypeArangoSync: if arangosyncOptions.IsCriticalOption(optionKey) { return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey)) } diff --git a/pkg/apis/deployment/v2alpha1/server_group_test.go b/pkg/apis/deployment/v2alpha1/server_group_test.go index b3e370b53..03eae5314 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_test.go +++ b/pkg/apis/deployment/v2alpha1/server_group_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -61,3 +61,14 @@ func TestServerGroupIsArangosync(t *testing.T) { assert.True(t, ServerGroupSyncMasters.IsArangosync()) assert.True(t, ServerGroupSyncWorkers.IsArangosync()) } + +func TestServerGroupType(t *testing.T) { + assert.Equal(t, ServerGroupTypeUnknown, ServerGroupUnknown.Type()) + assert.Equal(t, ServerGroupTypeID, ServerGroupImageDiscovery.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupSingle.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupAgents.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupDBServers.Type()) + assert.Equal(t, ServerGroupTypeArangoD, ServerGroupCoordinators.Type()) + assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncMasters.Type()) + assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncWorkers.Type()) +} diff --git a/pkg/apis/deployment/v2alpha1/server_group_type.go b/pkg/apis/deployment/v2alpha1/server_group_type.go new file mode 100644 index 000000000..4b7c6c559 --- /dev/null +++ b/pkg/apis/deployment/v2alpha1/server_group_type.go @@ -0,0 +1,30 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v2alpha1 + +type ServerGroupType int + +const ( + ServerGroupTypeUnknown ServerGroupType = iota + ServerGroupTypeArangoD + ServerGroupTypeArangoSync + ServerGroupTypeID +) diff --git a/pkg/deployment/deployment_suite_test.go b/pkg/deployment/deployment_suite_test.go index 3c1ad9c1a..940280b27 100644 --- a/pkg/deployment/deployment_suite_test.go +++ b/pkg/deployment/deployment_suite_test.go @@ -107,12 +107,14 @@ func createTestTLSVolume(serverGroupString, ID string) core.Volume { } func createTestLifecycle(group api.ServerGroup) *core.Lifecycle { - if group.IsArangosync() { + switch group.Type() { + case api.ServerGroupTypeArangoSync: lifecycle, _ := k8sutil.NewLifecycleFinalizers() return lifecycle + default: + lifecycle, _ := k8sutil.NewLifecyclePort() + return lifecycle } - lifecycle, _ := k8sutil.NewLifecyclePort() - return lifecycle } func createTestToken(deployment *Deployment, testCase *testCaseStruct, paths []string) (string, error) { @@ -864,52 +866,51 @@ func podDataSort() func(t *testing.T, p *core.Pod) { func addLifecycle(name string, uuidRequired bool, license string, group api.ServerGroup) func(t *testing.T, p *core.Pod) { return func(t *testing.T, p *core.Pod) { - if group.IsArangosync() { - return - } + switch group.Type() { + case api.ServerGroupTypeArangoD: + if len(p.Spec.Containers) > 0 { + p.Spec.Containers[0].Env = append(k8sutil.GetLifecycleEnv(), p.Spec.Containers[0].Env...) + if license != "" { + p.Spec.Containers[0].Env = append([]core.EnvVar{ + k8sutil.CreateEnvSecretKeySelector(constants.EnvArangoLicenseKey, + license, constants.SecretKeyToken)}, p.Spec.Containers[0].Env...) + } + } - if len(p.Spec.Containers) > 0 { - p.Spec.Containers[0].Env = append(k8sutil.GetLifecycleEnv(), p.Spec.Containers[0].Env...) - if license != "" { - p.Spec.Containers[0].Env = append([]core.EnvVar{ - k8sutil.CreateEnvSecretKeySelector(constants.EnvArangoLicenseKey, - license, constants.SecretKeyToken)}, p.Spec.Containers[0].Env...) + if _, ok := k8sutil.GetAnyVolumeByName(p.Spec.Volumes, shared.LifecycleVolumeName); !ok { + p.Spec.Volumes = append([]core.Volume{k8sutil.LifecycleVolume()}, p.Spec.Volumes...) + } + if _, ok := k8sutil.GetAnyVolumeByName(p.Spec.Volumes, "arangod-data"); !ok { + p.Spec.Volumes = append([]core.Volume{k8sutil.LifecycleVolume()}, p.Spec.Volumes...) } - } - if _, ok := k8sutil.GetAnyVolumeByName(p.Spec.Volumes, shared.LifecycleVolumeName); !ok { - p.Spec.Volumes = append([]core.Volume{k8sutil.LifecycleVolume()}, p.Spec.Volumes...) - } - if _, ok := k8sutil.GetAnyVolumeByName(p.Spec.Volumes, "arangod-data"); !ok { - p.Spec.Volumes = append([]core.Volume{k8sutil.LifecycleVolume()}, p.Spec.Volumes...) - } + if len(p.Spec.Containers) > 0 { + p.Spec.Containers[0].Lifecycle = createTestLifecycle(api.ServerGroupAgents) + } - if len(p.Spec.Containers) > 0 { - p.Spec.Containers[0].Lifecycle = createTestLifecycle(api.ServerGroupAgents) - } + if len(p.Spec.Containers) > 0 { + if _, ok := k8sutil.GetAnyVolumeMountByName(p.Spec.Containers[0].VolumeMounts, "lifecycle"); !ok { + p.Spec.Containers[0].VolumeMounts = append(p.Spec.Containers[0].VolumeMounts, k8sutil.LifecycleVolumeMount()) + } - if len(p.Spec.Containers) > 0 { - if _, ok := k8sutil.GetAnyVolumeMountByName(p.Spec.Containers[0].VolumeMounts, "lifecycle"); !ok { - p.Spec.Containers[0].VolumeMounts = append(p.Spec.Containers[0].VolumeMounts, k8sutil.LifecycleVolumeMount()) + if _, ok := kresources.GetAnyContainerByName(p.Spec.InitContainers, "init-lifecycle"); !ok { + p.Spec.InitContainers = append( + []core.Container{createTestLifecycleContainer(emptyResources)}, + p.Spec.InitContainers..., + ) + } } - if _, ok := kresources.GetAnyContainerByName(p.Spec.InitContainers, "init-lifecycle"); !ok { + if _, ok := kresources.GetAnyContainerByName(p.Spec.InitContainers, "uuid"); !ok { + binaryPath, _ := os.Executable() p.Spec.InitContainers = append( - []core.Container{createTestLifecycleContainer(emptyResources)}, + []core.Container{ + k8sutil.ArangodInitContainer("uuid", name, "rocksdb", binaryPath, testImageOperator, uuidRequired, securityContext.NewSecurityContext()), + }, p.Spec.InitContainers..., ) } } - - if _, ok := kresources.GetAnyContainerByName(p.Spec.InitContainers, "uuid"); !ok { - binaryPath, _ := os.Executable() - p.Spec.InitContainers = append( - []core.Container{ - k8sutil.ArangodInitContainer("uuid", name, "rocksdb", binaryPath, testImageOperator, uuidRequired, securityContext.NewSecurityContext()), - }, - p.Spec.InitContainers..., - ) - } } } diff --git a/pkg/deployment/member/state.go b/pkg/deployment/member/state.go index 9bba04e97..0738a9441 100644 --- a/pkg/deployment/member/state.go +++ b/pkg/deployment/member/state.go @@ -34,6 +34,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/arangod" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" ) @@ -123,13 +124,20 @@ func (s *stateInspector) RefreshState(ctx context.Context, members api.Deploymen ctxChild, cancel := globals.GetGlobalTimeouts().ArangoDCheck().WithTimeout(ctx) defer cancel() - if members[id].Group.IsArangosync() { + switch members[id].Group.Type() { + case api.ServerGroupTypeArangoSync: results[id] = s.fetchArangosyncMemberState(ctxChild, members[id]) - } else { + case api.ServerGroupTypeArangoD: results[id] = s.fetchServerMemberState(ctxChild, members[id], servingGroup) if results[id].IsServing() { client = results[id].client } + default: + assertion.InvalidGroupKey.Assert(true, "Unable to fetch Health for an unknown group: %s", members[id].Group.AsRole()) + results[id] = State{ + IsClusterHealthy: false, + serving: false, + } } }) @@ -155,22 +163,26 @@ func (s *stateInspector) RefreshState(ctx context.Context, members api.Deploymen continue } - if members[i].Group.IsArangosync() { + switch members[i].Group.Type() { + case api.ServerGroupTypeArangoD: + if v, ok := h.Members[driver.ServerID(m.Member.ID)]; ok { + results[i].IsClusterHealthy = v.Status == driver.ServerStatusGood + if results[i].IsServing() && v.SyncStatus == driver.ServerSyncStatusServing { + if cs.client == nil || util.Rand().Intn(100) > 50 { + // Set client from nil or take next client with 50% probability. + cs.client = results[i].client + cs.Version = results[i].Version + } + } + } + case api.ServerGroupTypeArangoSync: // ArangoSync is considered as healthy when it is possible to fetch version. results[i].IsClusterHealthy = true - continue + default: + assertion.InvalidGroupKey.Assert(true, "Unable to fetch Health for an unknown group: %s", members[i].Group.AsRole()) + results[i].IsClusterHealthy = false } - if v, ok := h.Members[driver.ServerID(m.Member.ID)]; ok { - results[i].IsClusterHealthy = v.Status == driver.ServerStatusGood - if results[i].IsServing() && v.SyncStatus == driver.ServerSyncStatusServing { - if cs.client == nil || util.Rand().Intn(100) > 50 { - // Set client from nil or take next client with 50% probability. - cs.client = results[i].client - cs.Version = results[i].Version - } - } - } } return nil diff --git a/pkg/deployment/pod/utils.go b/pkg/deployment/pod/utils.go index da5b7fd7d..3ffa5ffa4 100644 --- a/pkg/deployment/pod/utils.go +++ b/pkg/deployment/pod/utils.go @@ -25,6 +25,7 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" @@ -41,7 +42,8 @@ func GenerateMemberEndpoint(services service.Inspector, apiObject meta.Object, s } func GenerateMemberEndpointFromService(svc *core.Service, apiObject meta.Object, spec api.DeploymentSpec, group api.ServerGroup, member api.MemberStatus) (string, error) { - if group.IsArangod() { + switch group.Type() { + case api.ServerGroupTypeArangoD: switch method := spec.CommunicationMethod.Get(); method { case api.DeploymentCommunicationMethodDNS, api.DeploymentCommunicationMethodHeadlessDNS: return k8sutil.CreateServiceDNSNameWithDomain(svc, spec.ClusterDomain), nil @@ -60,7 +62,9 @@ func GenerateMemberEndpointFromService(svc *core.Service, apiObject meta.Object, default: return k8sutil.CreatePodDNSNameWithDomain(apiObject, spec.ClusterDomain, group.AsRole(), member.ID), nil } - } else { + case api.ServerGroupTypeArangoSync: return k8sutil.CreateSyncMasterClientServiceDNSNameWithDomain(apiObject, spec.ClusterDomain), nil + default: + return "", assertion.InvalidGroupKey.Assert(true, "Unable to create Endpoint for an unknown group: %s", group.AsRole()) } } diff --git a/pkg/deployment/reconcile/action_wait_for_member_up.go b/pkg/deployment/reconcile/action_wait_for_member_up.go index e38d6fe1c..9b4b525c7 100644 --- a/pkg/deployment/reconcile/action_wait_for_member_up.go +++ b/pkg/deployment/reconcile/action_wait_for_member_up.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/client" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" ) @@ -72,22 +73,27 @@ func (a *actionWaitForMemberUp) CheckProgress(ctx context.Context) (bool, bool, ctxChild, cancel := globals.GetGlobalTimeouts().ArangoD().WithTimeout(ctx) defer cancel() - if a.action.Group.IsArangosync() { - return a.checkProgressArangoSync(ctxChild) - } - switch a.actionCtx.GetMode() { - case api.DeploymentModeSingle: - return a.checkProgressSingle(ctxChild) - case api.DeploymentModeActiveFailover: - if a.action.Group == api.ServerGroupAgents { - return a.checkProgressAgent() + switch a.action.Group.Type() { + case api.ServerGroupTypeArangoD: + switch a.actionCtx.GetMode() { + case api.DeploymentModeSingle: + return a.checkProgressSingle(ctxChild) + case api.DeploymentModeActiveFailover: + if a.action.Group == api.ServerGroupAgents { + return a.checkProgressAgent() + } + return a.checkProgressSingleInActiveFailover(ctxChild) + default: + if a.action.Group == api.ServerGroupAgents { + return a.checkProgressAgent() + } + return a.checkProgressCluster(ctx) } - return a.checkProgressSingleInActiveFailover(ctxChild) + case api.ServerGroupTypeArangoSync: + return a.checkProgressArangoSync(ctxChild) default: - if a.action.Group == api.ServerGroupAgents { - return a.checkProgressAgent() - } - return a.checkProgressCluster(ctx) + assertion.InvalidGroupKey.Assert(true, "Unable to execute action WaitForMemberUp for an unknown group: %s", a.action.Group.AsRole()) + return true, false, nil } } diff --git a/pkg/deployment/reconcile/helper_shutdown.go b/pkg/deployment/reconcile/helper_shutdown.go index fa2c9d550..d90b818d7 100644 --- a/pkg/deployment/reconcile/helper_shutdown.go +++ b/pkg/deployment/reconcile/helper_shutdown.go @@ -31,6 +31,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/client" "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" @@ -157,7 +158,8 @@ func (s shutdownHelperAPI) Start(ctx context.Context) (bool, error) { } } - if group.IsArangod() { + switch group.Type() { + case api.ServerGroupTypeArangoD: // Invoke shutdown endpoint c, err := s.actionCtx.GetMembersState().GetMemberClient(s.action.MemberID) if err != nil { @@ -177,14 +179,17 @@ func (s shutdownHelperAPI) Start(ctx context.Context) (bool, error) { s.log.Err(err).Debug("Failed to shutdown member") return false, errors.WithStack(err) } - } else if group.IsArangosync() { + return false, nil + case api.ServerGroupTypeArangoSync: // Terminate pod if err := cache.Client().Kubernetes().CoreV1().Pods(cache.Namespace()).Delete(ctx, podName, meta.DeleteOptions{}); err != nil { return false, errors.WithStack(err) } + return false, nil + default: + assertion.InvalidGroupKey.Assert(true, "Unable to execute ShutdownAction for an unknown group: %s", group.AsRole()) + return false, nil } - - return false, nil } // CheckProgress returns true when pod is terminated. diff --git a/pkg/deployment/reconcile/plan_builder_tls.go b/pkg/deployment/reconcile/plan_builder_tls.go index 17566f284..766716b53 100644 --- a/pkg/deployment/reconcile/plan_builder_tls.go +++ b/pkg/deployment/reconcile/plan_builder_tls.go @@ -41,6 +41,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/crypto" operatorHTTP "github.com/arangodb/kube-arangodb/pkg/util/http" @@ -542,10 +543,15 @@ func (r *Reconciler) keyfileRenewalRequired(ctx context.Context, apiObject k8sut // Verify AltNames var altNames memberTls.KeyfileInput - if group.IsArangosync() { - altNames, err = memberTls.GetSyncAltNames(apiObject, spec, tlsSpec, group, member) - } else { + + switch group.Type() { + case api.ServerGroupTypeArangoD: altNames, err = memberTls.GetServerAltNames(apiObject, spec, tlsSpec, service, group, member) + case api.ServerGroupTypeArangoSync: + altNames, err = memberTls.GetSyncAltNames(apiObject, spec, tlsSpec, group, member) + default: + assertion.InvalidGroupKey.Assert(true, "Unable to check TLS Key Renewal for an unknown group: %s", group.AsRole()) + return false, false } if err != nil { @@ -568,37 +574,44 @@ func (r *Reconciler) keyfileRenewalRequired(ctx context.Context, apiObject k8sut } // Ensure secret is propagated only on 3.7.0+ enterprise and inplace mode - if mode == api.TLSRotateModeInPlace && group.IsArangod() { - conn, err := context.GetMembersState().GetMemberClient(member.ID) - if err != nil { - r.planLogger.Err(err).Warn("Unable to get client") - return false, false - } + if mode == api.TLSRotateModeInPlace { + switch group.Type() { + case api.ServerGroupTypeArangoD: + conn, err := context.GetMembersState().GetMemberClient(member.ID) + if err != nil { + r.planLogger.Err(err).Warn("Unable to get client") + return false, false + } - s, exists := cachedStatus.Secret().V1().GetSimple(k8sutil.CreateTLSKeyfileSecretName(apiObject.GetName(), group.AsRole(), member.ID)) - if !exists { - r.planLogger.Warn("Keyfile secret is missing") - return false, false - } + s, exists := cachedStatus.Secret().V1().GetSimple(k8sutil.CreateTLSKeyfileSecretName(apiObject.GetName(), group.AsRole(), member.ID)) + if !exists { + r.planLogger.Warn("Keyfile secret is missing") + return false, false + } - c := client.NewClient(conn.Connection(), r.log) - tls, err := c.GetTLS(ctx) - if err != nil { - r.planLogger.Err(err).Warn("Unable to get tls details") - return false, false - } + c := client.NewClient(conn.Connection(), r.log) + tls, err := c.GetTLS(ctx) + if err != nil { + r.planLogger.Err(err).Warn("Unable to get tls details") + return false, false + } - keyfile, ok := s.Data[constants.SecretTLSKeyfile] - if !ok { - r.planLogger.Warn("Keyfile secret is invalid") - return false, false - } + keyfile, ok := s.Data[constants.SecretTLSKeyfile] + if !ok { + r.planLogger.Warn("Keyfile secret is invalid") + return false, false + } - keyfileSha := util.SHA256(keyfile) + keyfileSha := util.SHA256(keyfile) - if tls.Result.KeyFile.GetSHA().Checksum() != keyfileSha { - r.planLogger.Str("current", tls.Result.KeyFile.GetSHA().Checksum()).Str("desired", keyfileSha).Debug("Unable to get tls details") - return true, false + if tls.Result.KeyFile.GetSHA().Checksum() != keyfileSha { + r.planLogger.Str("current", tls.Result.KeyFile.GetSHA().Checksum()).Str("desired", keyfileSha).Debug("Unable to get tls details") + return true, false + } + case api.ServerGroupTypeArangoSync: + break + default: + assertion.InvalidGroupKey.Assert(true, "Unable to check TLS Key Renewal for an unknown group: %s", group.AsRole()) } } diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index 4656a364d..5befe8a2c 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -42,6 +42,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/deployment/reconciler" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" @@ -335,7 +336,8 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec podName := k8sutil.CreatePodName(apiObject.GetName(), roleAbbr, m.ID, CreatePodSuffix(spec)) var podCreator interfaces.PodCreator - if group.IsArangod() { + switch group.Type() { + case api.ServerGroupTypeArangoD: // Prepare arguments autoUpgrade := m.Conditions.IsTrue(api.ConditionTypeAutoUpgrade) || spec.Upgrade.Get().AutoUpgrade @@ -353,7 +355,7 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec arangoMember: *member, cachedStatus: cache, } - } else if group.IsArangosync() { + case api.ServerGroupTypeArangoSync: // Check image if !imageInfo.Enterprise { log.Str("image", spec.GetImage()).Debug("Image is not an enterprise image") @@ -377,8 +379,8 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec memberStatus: m, cachedStatus: cache, } - } else { - return nil, errors.Errorf("unable to render Pod") + default: + return nil, assertion.InvalidGroupKey.Assert(true, "Unable to render pod for an unknown group: %s", group.AsRole()) } pod, err := RenderArangoPod(ctx, cache, apiObject, role, m.ID, podName, podCreator) @@ -468,7 +470,8 @@ func (r *Resources) createPodForMember(ctx context.Context, cachedStatus inspect newPhase := api.MemberPhaseCreated // Create pod - if group.IsArangod() { + switch group.Type() { + case api.ServerGroupTypeArangoD: // Prepare arguments autoUpgrade := m.Conditions.IsTrue(api.ConditionTypeAutoUpgrade) if autoUpgrade { @@ -507,7 +510,7 @@ func (r *Resources) createPodForMember(ctx context.Context, cachedStatus inspect } else { log.Str("pod-name", pod.Name).Debug("Created pod with predefined image") } - } else if group.IsArangosync() { + case api.ServerGroupTypeArangoSync: // Check monitoring token secret if group == api.ServerGroupSyncMasters { // Create TLS secret @@ -545,6 +548,8 @@ func (r *Resources) createPodForMember(ctx context.Context, cachedStatus inspect m.Pod.Propagate(&m) log.Str("pod-name", pod.Name).Debug("Created pod") + default: + return assertion.InvalidGroupKey.Assert(true, "Unable to create pod for an unknown group: %s", group.AsRole()) } member.GetPhaseExecutor().Execute(r.context.GetAPIObject(), spec, group, &m, api.Action{}, newPhase) diff --git a/pkg/deployment/resources/pod_creator_arangod.go b/pkg/deployment/resources/pod_creator_arangod.go index 01667d39e..092a53d14 100644 --- a/pkg/deployment/resources/pod_creator_arangod.go +++ b/pkg/deployment/resources/pod_creator_arangod.go @@ -598,7 +598,7 @@ func (m *MemberArangoDPod) Annotations() map[string]string { func (m *MemberArangoDPod) Labels() map[string]string { l := collection.ReservedLabels().Filter(collection.MergeAnnotations(m.spec.Labels, m.groupSpec.Labels)) - if m.group.IsArangod() && m.status.Topology != nil && m.deploymentStatus.Topology.Enabled() && m.deploymentStatus.Topology.ID == m.status.Topology.ID { + if m.status.Topology != nil && m.deploymentStatus.Topology.Enabled() && m.deploymentStatus.Topology.ID == m.status.Topology.ID { if l == nil { l = map[string]string{} } diff --git a/pkg/deployment/resources/secrets.go b/pkg/deployment/resources/secrets.go index 63983c46e..f79a7f136 100644 --- a/pkg/deployment/resources/secrets.go +++ b/pkg/deployment/resources/secrets.go @@ -41,6 +41,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/metrics" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" @@ -129,36 +130,41 @@ func (r *Resources) EnsureSecrets(ctx context.Context, cachedStatus inspectorInt } if err := reconcileRequired.ParallelAll(len(members), func(id int) error { - if !members[id].Group.IsArangod() { - return nil - } + switch members[id].Group.Type() { + case api.ServerGroupTypeArangoD: + memberName := members[id].Member.ArangoMemberName(r.context.GetAPIObject().GetName(), members[id].Group) - memberName := members[id].Member.ArangoMemberName(r.context.GetAPIObject().GetName(), members[id].Group) - - member, ok := cachedStatus.ArangoMember().V1().GetSimple(memberName) - if !ok { - return errors.Errorf("Member %s not found", memberName) - } - - service, ok := cachedStatus.Service().V1().GetSimple(memberName) - if !ok { - return errors.Errorf("Service of member %s not found", memberName) - } + member, ok := cachedStatus.ArangoMember().V1().GetSimple(memberName) + if !ok { + return errors.Errorf("Member %s not found", memberName) + } - tlsKeyfileSecretName := k8sutil.AppendTLSKeyfileSecretPostfix(member.GetName()) - if _, exists := cachedStatus.Secret().V1().GetSimple(tlsKeyfileSecretName); !exists { - serverNames, err := tls.GetServerAltNames(apiObject, spec, spec.TLS, service, members[id].Group, members[id].Member) - if err != nil { - return errors.WithStack(errors.Wrapf(err, "Failed to render alt names")) + service, ok := cachedStatus.Service().V1().GetSimple(memberName) + if !ok { + return errors.Errorf("Service of member %s not found", memberName) } - owner := member.AsOwner() - if created, err := createTLSServerCertificate(ctx, log, cachedStatus, secrets, serverNames, spec.TLS, tlsKeyfileSecretName, &owner); err != nil && !kerrors.IsAlreadyExists(err) { - return errors.WithStack(errors.Wrapf(err, "Failed to create TLS keyfile secret")) - } else if created { - reconcileRequired.Required() + + tlsKeyfileSecretName := k8sutil.AppendTLSKeyfileSecretPostfix(member.GetName()) + if _, exists := cachedStatus.Secret().V1().GetSimple(tlsKeyfileSecretName); !exists { + serverNames, err := tls.GetServerAltNames(apiObject, spec, spec.TLS, service, members[id].Group, members[id].Member) + if err != nil { + return errors.WithStack(errors.Wrapf(err, "Failed to render alt names")) + } + owner := member.AsOwner() + if created, err := createTLSServerCertificate(ctx, log, cachedStatus, secrets, serverNames, spec.TLS, tlsKeyfileSecretName, &owner); err != nil && !kerrors.IsAlreadyExists(err) { + return errors.WithStack(errors.Wrapf(err, "Failed to create TLS keyfile secret")) + } else if created { + reconcileRequired.Required() + } } + return nil + case api.ServerGroupTypeArangoSync: + // Nothing to do + return nil + default: + assertion.InvalidGroupKey.Assert(true, "Unable to create TLS Secret an unknown group: %s", members[id].Group.AsRole()) + return nil } - return nil }); err != nil { return errors.Section(err, "TLS TrustStore") } diff --git a/pkg/util/assertion/assert.go b/pkg/util/assertion/assert.go index aa79e4a76..05acb6237 100644 --- a/pkg/util/assertion/assert.go +++ b/pkg/util/assertion/assert.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,8 @@ package assertion import ( "fmt" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) type Key string @@ -30,19 +32,20 @@ const ( KeyUnknown Key = "" DeprecatedActionKey Key = "DeprecatedAction" CommunityLicenseCheckKey Key = "CommunityLicenseCheck" + InvalidGroupKey Key = "InvalidGroup" ) -func (k Key) Assert(condition bool, msg string, args ...interface{}) { - assert(2, condition, k, msg, args...) +func (k Key) Assert(condition bool, msg string, args ...interface{}) error { + return assert(2, condition, k, msg, args...) } -func Assert(condition bool, key Key, msg string, args ...interface{}) { - assert(2, condition, key, msg, args...) +func Assert(condition bool, key Key, msg string, args ...interface{}) error { + return assert(2, condition, key, msg, args...) } -func assert(skip int, condition bool, key Key, msg string, args ...interface{}) { +func assert(skip int, condition bool, key Key, msg string, args ...interface{}) error { if !condition { - return + return nil } metricsObject.incKeyMetric(key) @@ -50,4 +53,6 @@ func assert(skip int, condition bool, key Key, msg string, args ...interface{}) frames := frames(skip) _assert(frames, fmt.Sprintf(msg, args...)) + + return errors.WithStack(errors.Errorf("Error Assertion `%s`: %s", key, fmt.Sprintf(msg, args...))) } From b516e7993fff3aabe53d67dec606ee2c99befa1e Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:14:14 +0200 Subject: [PATCH 11/50] [Feature] ServerGroup Pointer (#1700) --- CHANGELOG.md | 1 + docs/api/ArangoDeployment.V1.md | 720 +++++++++--------- pkg/apis/deployment/v1/server_group_spec.go | 309 ++++---- .../deployment/v1/server_group_spec_probe.go | 139 ++++ .../v1/server_group_spec_shutdown_method.go | 50 ++ .../deployment/v1/server_group_spec_test.go | 150 ++-- .../deployment/v2alpha1/server_group_spec.go | 309 ++++---- .../v2alpha1/server_group_spec_probe.go | 139 ++++ .../server_group_spec_shutdown_method.go | 50 ++ .../v2alpha1/server_group_spec_test.go | 150 ++-- pkg/deployment/cluster_scaling_integration.go | 6 +- pkg/deployment/resources/pdbs.go | 10 +- 12 files changed, 1187 insertions(+), 846 deletions(-) create mode 100644 pkg/apis/deployment/v1/server_group_spec_probe.go create mode 100644 pkg/apis/deployment/v1/server_group_spec_shutdown_method.go create mode 100644 pkg/apis/deployment/v2alpha1/server_group_spec_probe.go create mode 100644 pkg/apis/deployment/v2alpha1/server_group_spec_shutdown_method.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 80ddc7d55..b9264bdf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - (Feature) ConfigMap Inspector - (Feature) Envoy Image Layer - (Feature) Add ArangoDeployment ServerGroupType +- (Feature) ServerGroup Pointer ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index c5f32b545..cb4436d8e 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -10,7 +10,7 @@ title: ArangoDeployment V1 ### .spec.agents.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -21,7 +21,7 @@ Links: ### .spec.agents.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -32,7 +32,7 @@ This setting changes the member recreation logic based on group: ### .spec.agents.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -41,7 +41,7 @@ Annotations are merged with `spec.annotations`. ### .spec.agents.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -49,7 +49,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.agents.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -57,7 +57,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.agents.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -68,7 +68,7 @@ Links: ### .spec.agents.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -78,7 +78,7 @@ Default Value: `[]` ### .spec.agents.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -91,7 +91,7 @@ as for the `dbservers` group. ### .spec.agents.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -133,7 +133,7 @@ Links: ### .spec.agents.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -141,7 +141,7 @@ ExporterPort define Port used by exporter ### .spec.agents.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -149,7 +149,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.agents.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -157,7 +157,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.agents.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -188,7 +188,7 @@ Mode keep container replace mode ### .spec.agents.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -196,7 +196,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.agents.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -204,7 +204,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.agents.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -212,7 +212,7 @@ Labels specified the labels added to Pods in this group. ### .spec.agents.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -220,7 +220,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.agents.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -228,7 +228,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.agents.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -236,7 +236,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.agents.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -251,7 +251,7 @@ Default Value: `0` ### .spec.agents.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -259,7 +259,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.agents.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -270,7 +270,7 @@ Links: ### .spec.agents.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -311,7 +311,7 @@ Default Value: `/usr/bin/numactl` ### .spec.agents.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -328,7 +328,7 @@ Default Value: `true` ### .spec.agents.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -357,7 +357,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.agents.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -365,7 +365,7 @@ Port define Port used by member ### .spec.agents.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -377,7 +377,7 @@ Links: ### .spec.agents.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -387,7 +387,7 @@ Default Value: `false` ### .spec.agents.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -399,7 +399,7 @@ Default Value: `3` ### .spec.agents.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -410,7 +410,7 @@ Default Value: `2` ### .spec.agents.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -421,7 +421,7 @@ Default Value: `10` ### .spec.agents.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -432,7 +432,7 @@ Default Value: `1` ### .spec.agents.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -443,7 +443,7 @@ Default Value: `2` ### .spec.agents.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -456,7 +456,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.agents.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -464,7 +464,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.agents.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -476,7 +476,7 @@ Default Value: `3` ### .spec.agents.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -487,7 +487,7 @@ Default Value: `2` ### .spec.agents.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -498,7 +498,7 @@ Default Value: `10` ### .spec.agents.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -509,7 +509,7 @@ Default Value: `1` ### .spec.agents.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -520,7 +520,7 @@ Default Value: `2` ### .spec.agents.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -528,7 +528,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.agents.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -540,7 +540,7 @@ Default Value: `3` ### .spec.agents.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -551,7 +551,7 @@ Default Value: `2` ### .spec.agents.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -562,7 +562,7 @@ Default Value: `10` ### .spec.agents.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -573,7 +573,7 @@ Default Value: `1` ### .spec.agents.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -584,7 +584,7 @@ Default Value: `2` ### .spec.agents.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -596,7 +596,7 @@ Possible Values: ### .spec.agents.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -607,7 +607,7 @@ Links: ### .spec.agents.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -745,7 +745,7 @@ sysctls: ### .spec.agents.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -760,7 +760,7 @@ to that service account. ### .spec.agents.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -768,7 +768,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.agents.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -776,7 +776,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.agents.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -785,7 +785,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.agents.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -796,7 +796,7 @@ Links: ### .spec.agents.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -809,7 +809,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.agents.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -817,7 +817,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.agents.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -833,7 +833,7 @@ Links: ### .spec.agents.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -846,7 +846,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.agents.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -862,7 +862,7 @@ Links: ### .spec.agents.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -1076,7 +1076,7 @@ Possible Values: ### .spec.coordinators.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -1087,7 +1087,7 @@ Links: ### .spec.coordinators.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -1098,7 +1098,7 @@ This setting changes the member recreation logic based on group: ### .spec.coordinators.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -1107,7 +1107,7 @@ Annotations are merged with `spec.annotations`. ### .spec.coordinators.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -1115,7 +1115,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.coordinators.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -1123,7 +1123,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.coordinators.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -1134,7 +1134,7 @@ Links: ### .spec.coordinators.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -1144,7 +1144,7 @@ Default Value: `[]` ### .spec.coordinators.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -1157,7 +1157,7 @@ as for the `dbservers` group. ### .spec.coordinators.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -1199,7 +1199,7 @@ Links: ### .spec.coordinators.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -1207,7 +1207,7 @@ ExporterPort define Port used by exporter ### .spec.coordinators.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -1215,7 +1215,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.coordinators.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -1223,7 +1223,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.coordinators.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -1254,7 +1254,7 @@ Mode keep container replace mode ### .spec.coordinators.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -1262,7 +1262,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.coordinators.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -1270,7 +1270,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.coordinators.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -1278,7 +1278,7 @@ Labels specified the labels added to Pods in this group. ### .spec.coordinators.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -1286,7 +1286,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.coordinators.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -1294,7 +1294,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.coordinators.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -1302,7 +1302,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.coordinators.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -1317,7 +1317,7 @@ Default Value: `0` ### .spec.coordinators.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -1325,7 +1325,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.coordinators.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -1336,7 +1336,7 @@ Links: ### .spec.coordinators.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -1377,7 +1377,7 @@ Default Value: `/usr/bin/numactl` ### .spec.coordinators.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -1394,7 +1394,7 @@ Default Value: `true` ### .spec.coordinators.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -1423,7 +1423,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.coordinators.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -1431,7 +1431,7 @@ Port define Port used by member ### .spec.coordinators.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -1443,7 +1443,7 @@ Links: ### .spec.coordinators.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -1453,7 +1453,7 @@ Default Value: `false` ### .spec.coordinators.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -1465,7 +1465,7 @@ Default Value: `3` ### .spec.coordinators.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -1476,7 +1476,7 @@ Default Value: `2` ### .spec.coordinators.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -1487,7 +1487,7 @@ Default Value: `10` ### .spec.coordinators.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -1498,7 +1498,7 @@ Default Value: `1` ### .spec.coordinators.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -1509,7 +1509,7 @@ Default Value: `2` ### .spec.coordinators.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -1522,7 +1522,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.coordinators.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -1530,7 +1530,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.coordinators.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -1542,7 +1542,7 @@ Default Value: `3` ### .spec.coordinators.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -1553,7 +1553,7 @@ Default Value: `2` ### .spec.coordinators.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -1564,7 +1564,7 @@ Default Value: `10` ### .spec.coordinators.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -1575,7 +1575,7 @@ Default Value: `1` ### .spec.coordinators.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -1586,7 +1586,7 @@ Default Value: `2` ### .spec.coordinators.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -1594,7 +1594,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.coordinators.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -1606,7 +1606,7 @@ Default Value: `3` ### .spec.coordinators.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -1617,7 +1617,7 @@ Default Value: `2` ### .spec.coordinators.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -1628,7 +1628,7 @@ Default Value: `10` ### .spec.coordinators.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -1639,7 +1639,7 @@ Default Value: `1` ### .spec.coordinators.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -1650,7 +1650,7 @@ Default Value: `2` ### .spec.coordinators.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -1662,7 +1662,7 @@ Possible Values: ### .spec.coordinators.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -1673,7 +1673,7 @@ Links: ### .spec.coordinators.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -1811,7 +1811,7 @@ sysctls: ### .spec.coordinators.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -1826,7 +1826,7 @@ to that service account. ### .spec.coordinators.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -1834,7 +1834,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.coordinators.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -1842,7 +1842,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.coordinators.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -1851,7 +1851,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.coordinators.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -1862,7 +1862,7 @@ Links: ### .spec.coordinators.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -1875,7 +1875,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.coordinators.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -1883,7 +1883,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.coordinators.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -1899,7 +1899,7 @@ Links: ### .spec.coordinators.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -1912,7 +1912,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.coordinators.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -1928,7 +1928,7 @@ Links: ### .spec.coordinators.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -2010,7 +2010,7 @@ Maintenance manage maintenance mode on Cluster side. Requires maintenance featur ### .spec.dbservers.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -2021,7 +2021,7 @@ Links: ### .spec.dbservers.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -2032,7 +2032,7 @@ This setting changes the member recreation logic based on group: ### .spec.dbservers.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -2041,7 +2041,7 @@ Annotations are merged with `spec.annotations`. ### .spec.dbservers.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -2049,7 +2049,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.dbservers.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -2057,7 +2057,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.dbservers.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -2068,7 +2068,7 @@ Links: ### .spec.dbservers.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -2078,7 +2078,7 @@ Default Value: `[]` ### .spec.dbservers.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -2091,7 +2091,7 @@ as for the `dbservers` group. ### .spec.dbservers.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -2133,7 +2133,7 @@ Links: ### .spec.dbservers.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -2141,7 +2141,7 @@ ExporterPort define Port used by exporter ### .spec.dbservers.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -2149,7 +2149,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.dbservers.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -2157,7 +2157,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.dbservers.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -2188,7 +2188,7 @@ Mode keep container replace mode ### .spec.dbservers.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -2196,7 +2196,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.dbservers.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -2204,7 +2204,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.dbservers.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -2212,7 +2212,7 @@ Labels specified the labels added to Pods in this group. ### .spec.dbservers.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -2220,7 +2220,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.dbservers.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -2228,7 +2228,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.dbservers.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -2236,7 +2236,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.dbservers.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -2251,7 +2251,7 @@ Default Value: `0` ### .spec.dbservers.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -2259,7 +2259,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.dbservers.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -2270,7 +2270,7 @@ Links: ### .spec.dbservers.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -2311,7 +2311,7 @@ Default Value: `/usr/bin/numactl` ### .spec.dbservers.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -2328,7 +2328,7 @@ Default Value: `true` ### .spec.dbservers.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -2357,7 +2357,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.dbservers.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -2365,7 +2365,7 @@ Port define Port used by member ### .spec.dbservers.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -2377,7 +2377,7 @@ Links: ### .spec.dbservers.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -2387,7 +2387,7 @@ Default Value: `false` ### .spec.dbservers.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -2399,7 +2399,7 @@ Default Value: `3` ### .spec.dbservers.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -2410,7 +2410,7 @@ Default Value: `2` ### .spec.dbservers.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -2421,7 +2421,7 @@ Default Value: `10` ### .spec.dbservers.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -2432,7 +2432,7 @@ Default Value: `1` ### .spec.dbservers.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -2443,7 +2443,7 @@ Default Value: `2` ### .spec.dbservers.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -2456,7 +2456,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.dbservers.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -2464,7 +2464,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.dbservers.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -2476,7 +2476,7 @@ Default Value: `3` ### .spec.dbservers.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -2487,7 +2487,7 @@ Default Value: `2` ### .spec.dbservers.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -2498,7 +2498,7 @@ Default Value: `10` ### .spec.dbservers.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -2509,7 +2509,7 @@ Default Value: `1` ### .spec.dbservers.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -2520,7 +2520,7 @@ Default Value: `2` ### .spec.dbservers.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -2528,7 +2528,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.dbservers.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -2540,7 +2540,7 @@ Default Value: `3` ### .spec.dbservers.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -2551,7 +2551,7 @@ Default Value: `2` ### .spec.dbservers.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -2562,7 +2562,7 @@ Default Value: `10` ### .spec.dbservers.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -2573,7 +2573,7 @@ Default Value: `1` ### .spec.dbservers.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -2584,7 +2584,7 @@ Default Value: `2` ### .spec.dbservers.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -2596,7 +2596,7 @@ Possible Values: ### .spec.dbservers.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -2607,7 +2607,7 @@ Links: ### .spec.dbservers.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -2745,7 +2745,7 @@ sysctls: ### .spec.dbservers.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -2760,7 +2760,7 @@ to that service account. ### .spec.dbservers.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -2768,7 +2768,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.dbservers.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -2776,7 +2776,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.dbservers.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -2785,7 +2785,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.dbservers.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -2796,7 +2796,7 @@ Links: ### .spec.dbservers.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -2809,7 +2809,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.dbservers.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -2817,7 +2817,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.dbservers.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -2833,7 +2833,7 @@ Links: ### .spec.dbservers.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -2846,7 +2846,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.dbservers.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -2862,7 +2862,7 @@ Links: ### .spec.dbservers.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -3592,7 +3592,7 @@ The secret specified by this setting, must have a data field named 'key' contain ### .spec.single.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -3603,7 +3603,7 @@ Links: ### .spec.single.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -3614,7 +3614,7 @@ This setting changes the member recreation logic based on group: ### .spec.single.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -3623,7 +3623,7 @@ Annotations are merged with `spec.annotations`. ### .spec.single.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -3631,7 +3631,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.single.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -3639,7 +3639,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.single.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -3650,7 +3650,7 @@ Links: ### .spec.single.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -3660,7 +3660,7 @@ Default Value: `[]` ### .spec.single.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -3673,7 +3673,7 @@ as for the `dbservers` group. ### .spec.single.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -3715,7 +3715,7 @@ Links: ### .spec.single.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -3723,7 +3723,7 @@ ExporterPort define Port used by exporter ### .spec.single.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -3731,7 +3731,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.single.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -3739,7 +3739,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.single.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -3770,7 +3770,7 @@ Mode keep container replace mode ### .spec.single.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3778,7 +3778,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.single.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3786,7 +3786,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.single.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -3794,7 +3794,7 @@ Labels specified the labels added to Pods in this group. ### .spec.single.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -3802,7 +3802,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.single.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -3810,7 +3810,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.single.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -3818,7 +3818,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.single.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -3833,7 +3833,7 @@ Default Value: `0` ### .spec.single.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -3841,7 +3841,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.single.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -3852,7 +3852,7 @@ Links: ### .spec.single.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -3893,7 +3893,7 @@ Default Value: `/usr/bin/numactl` ### .spec.single.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -3910,7 +3910,7 @@ Default Value: `true` ### .spec.single.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -3939,7 +3939,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.single.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -3947,7 +3947,7 @@ Port define Port used by member ### .spec.single.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -3959,7 +3959,7 @@ Links: ### .spec.single.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -3969,7 +3969,7 @@ Default Value: `false` ### .spec.single.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3981,7 +3981,7 @@ Default Value: `3` ### .spec.single.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3992,7 +3992,7 @@ Default Value: `2` ### .spec.single.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -4003,7 +4003,7 @@ Default Value: `10` ### .spec.single.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -4014,7 +4014,7 @@ Default Value: `1` ### .spec.single.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -4025,7 +4025,7 @@ Default Value: `2` ### .spec.single.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -4038,7 +4038,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.single.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -4046,7 +4046,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.single.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -4058,7 +4058,7 @@ Default Value: `3` ### .spec.single.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -4069,7 +4069,7 @@ Default Value: `2` ### .spec.single.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -4080,7 +4080,7 @@ Default Value: `10` ### .spec.single.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -4091,7 +4091,7 @@ Default Value: `1` ### .spec.single.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -4102,7 +4102,7 @@ Default Value: `2` ### .spec.single.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -4110,7 +4110,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.single.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -4122,7 +4122,7 @@ Default Value: `3` ### .spec.single.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -4133,7 +4133,7 @@ Default Value: `2` ### .spec.single.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -4144,7 +4144,7 @@ Default Value: `10` ### .spec.single.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -4155,7 +4155,7 @@ Default Value: `1` ### .spec.single.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -4166,7 +4166,7 @@ Default Value: `2` ### .spec.single.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -4178,7 +4178,7 @@ Possible Values: ### .spec.single.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -4189,7 +4189,7 @@ Links: ### .spec.single.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -4327,7 +4327,7 @@ sysctls: ### .spec.single.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -4342,7 +4342,7 @@ to that service account. ### .spec.single.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -4350,7 +4350,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.single.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -4358,7 +4358,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.single.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -4367,7 +4367,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.single.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -4378,7 +4378,7 @@ Links: ### .spec.single.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -4391,7 +4391,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.single.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -4399,7 +4399,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.single.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -4415,7 +4415,7 @@ Links: ### .spec.single.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -4428,7 +4428,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.single.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -4444,7 +4444,7 @@ Links: ### .spec.single.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -4727,7 +4727,7 @@ Default Value: `"2160h" (about 3 months)` ### .spec.syncmasters.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -4738,7 +4738,7 @@ Links: ### .spec.syncmasters.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -4749,7 +4749,7 @@ This setting changes the member recreation logic based on group: ### .spec.syncmasters.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -4758,7 +4758,7 @@ Annotations are merged with `spec.annotations`. ### .spec.syncmasters.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -4766,7 +4766,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.syncmasters.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -4774,7 +4774,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.syncmasters.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -4785,7 +4785,7 @@ Links: ### .spec.syncmasters.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -4795,7 +4795,7 @@ Default Value: `[]` ### .spec.syncmasters.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -4808,7 +4808,7 @@ as for the `dbservers` group. ### .spec.syncmasters.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -4850,7 +4850,7 @@ Links: ### .spec.syncmasters.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -4858,7 +4858,7 @@ ExporterPort define Port used by exporter ### .spec.syncmasters.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -4866,7 +4866,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.syncmasters.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -4874,7 +4874,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.syncmasters.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -4905,7 +4905,7 @@ Mode keep container replace mode ### .spec.syncmasters.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -4913,7 +4913,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.syncmasters.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -4921,7 +4921,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.syncmasters.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -4929,7 +4929,7 @@ Labels specified the labels added to Pods in this group. ### .spec.syncmasters.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -4937,7 +4937,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.syncmasters.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -4945,7 +4945,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.syncmasters.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -4953,7 +4953,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.syncmasters.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -4968,7 +4968,7 @@ Default Value: `0` ### .spec.syncmasters.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -4976,7 +4976,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.syncmasters.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -4987,7 +4987,7 @@ Links: ### .spec.syncmasters.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -5028,7 +5028,7 @@ Default Value: `/usr/bin/numactl` ### .spec.syncmasters.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -5045,7 +5045,7 @@ Default Value: `true` ### .spec.syncmasters.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -5074,7 +5074,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.syncmasters.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -5082,7 +5082,7 @@ Port define Port used by member ### .spec.syncmasters.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -5094,7 +5094,7 @@ Links: ### .spec.syncmasters.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -5104,7 +5104,7 @@ Default Value: `false` ### .spec.syncmasters.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -5116,7 +5116,7 @@ Default Value: `3` ### .spec.syncmasters.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -5127,7 +5127,7 @@ Default Value: `2` ### .spec.syncmasters.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -5138,7 +5138,7 @@ Default Value: `10` ### .spec.syncmasters.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -5149,7 +5149,7 @@ Default Value: `1` ### .spec.syncmasters.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -5160,7 +5160,7 @@ Default Value: `2` ### .spec.syncmasters.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -5173,7 +5173,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.syncmasters.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -5181,7 +5181,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.syncmasters.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -5193,7 +5193,7 @@ Default Value: `3` ### .spec.syncmasters.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -5204,7 +5204,7 @@ Default Value: `2` ### .spec.syncmasters.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -5215,7 +5215,7 @@ Default Value: `10` ### .spec.syncmasters.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -5226,7 +5226,7 @@ Default Value: `1` ### .spec.syncmasters.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -5237,7 +5237,7 @@ Default Value: `2` ### .spec.syncmasters.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -5245,7 +5245,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.syncmasters.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -5257,7 +5257,7 @@ Default Value: `3` ### .spec.syncmasters.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -5268,7 +5268,7 @@ Default Value: `2` ### .spec.syncmasters.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -5279,7 +5279,7 @@ Default Value: `10` ### .spec.syncmasters.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -5290,7 +5290,7 @@ Default Value: `1` ### .spec.syncmasters.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -5301,7 +5301,7 @@ Default Value: `2` ### .spec.syncmasters.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -5313,7 +5313,7 @@ Possible Values: ### .spec.syncmasters.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -5324,7 +5324,7 @@ Links: ### .spec.syncmasters.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -5462,7 +5462,7 @@ sysctls: ### .spec.syncmasters.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -5477,7 +5477,7 @@ to that service account. ### .spec.syncmasters.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -5485,7 +5485,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.syncmasters.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -5493,7 +5493,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.syncmasters.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -5502,7 +5502,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.syncmasters.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -5513,7 +5513,7 @@ Links: ### .spec.syncmasters.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -5526,7 +5526,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.syncmasters.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -5534,7 +5534,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.syncmasters.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -5550,7 +5550,7 @@ Links: ### .spec.syncmasters.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -5563,7 +5563,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.syncmasters.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -5579,7 +5579,7 @@ Links: ### .spec.syncmasters.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -5653,7 +5653,7 @@ Links: ### .spec.syncworkers.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -5664,7 +5664,7 @@ Links: ### .spec.syncworkers.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -5675,7 +5675,7 @@ This setting changes the member recreation logic based on group: ### .spec.syncworkers.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -5684,7 +5684,7 @@ Annotations are merged with `spec.annotations`. ### .spec.syncworkers.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -5692,7 +5692,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.syncworkers.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -5700,7 +5700,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.syncworkers.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -5711,7 +5711,7 @@ Links: ### .spec.syncworkers.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -5721,7 +5721,7 @@ Default Value: `[]` ### .spec.syncworkers.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -5734,7 +5734,7 @@ as for the `dbservers` group. ### .spec.syncworkers.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -5776,7 +5776,7 @@ Links: ### .spec.syncworkers.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -5784,7 +5784,7 @@ ExporterPort define Port used by exporter ### .spec.syncworkers.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -5792,7 +5792,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.syncworkers.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -5800,7 +5800,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.syncworkers.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -5831,7 +5831,7 @@ Mode keep container replace mode ### .spec.syncworkers.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -5839,7 +5839,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.syncworkers.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -5847,7 +5847,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.syncworkers.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -5855,7 +5855,7 @@ Labels specified the labels added to Pods in this group. ### .spec.syncworkers.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -5863,7 +5863,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.syncworkers.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -5871,7 +5871,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.syncworkers.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -5879,7 +5879,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.syncworkers.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -5894,7 +5894,7 @@ Default Value: `0` ### .spec.syncworkers.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -5902,7 +5902,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.syncworkers.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -5913,7 +5913,7 @@ Links: ### .spec.syncworkers.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -5954,7 +5954,7 @@ Default Value: `/usr/bin/numactl` ### .spec.syncworkers.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -5971,7 +5971,7 @@ Default Value: `true` ### .spec.syncworkers.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -6000,7 +6000,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.syncworkers.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -6008,7 +6008,7 @@ Port define Port used by member ### .spec.syncworkers.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -6020,7 +6020,7 @@ Links: ### .spec.syncworkers.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -6030,7 +6030,7 @@ Default Value: `false` ### .spec.syncworkers.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -6042,7 +6042,7 @@ Default Value: `3` ### .spec.syncworkers.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -6053,7 +6053,7 @@ Default Value: `2` ### .spec.syncworkers.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -6064,7 +6064,7 @@ Default Value: `10` ### .spec.syncworkers.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -6075,7 +6075,7 @@ Default Value: `1` ### .spec.syncworkers.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -6086,7 +6086,7 @@ Default Value: `2` ### .spec.syncworkers.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -6099,7 +6099,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.syncworkers.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -6107,7 +6107,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.syncworkers.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -6119,7 +6119,7 @@ Default Value: `3` ### .spec.syncworkers.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -6130,7 +6130,7 @@ Default Value: `2` ### .spec.syncworkers.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -6141,7 +6141,7 @@ Default Value: `10` ### .spec.syncworkers.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -6152,7 +6152,7 @@ Default Value: `1` ### .spec.syncworkers.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -6163,7 +6163,7 @@ Default Value: `2` ### .spec.syncworkers.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -6171,7 +6171,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.syncworkers.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -6183,7 +6183,7 @@ Default Value: `3` ### .spec.syncworkers.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -6194,7 +6194,7 @@ Default Value: `2` ### .spec.syncworkers.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -6205,7 +6205,7 @@ Default Value: `10` ### .spec.syncworkers.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -6216,7 +6216,7 @@ Default Value: `1` ### .spec.syncworkers.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -6227,7 +6227,7 @@ Default Value: `2` ### .spec.syncworkers.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -6239,7 +6239,7 @@ Possible Values: ### .spec.syncworkers.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -6250,7 +6250,7 @@ Links: ### .spec.syncworkers.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -6388,7 +6388,7 @@ sysctls: ### .spec.syncworkers.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -6403,7 +6403,7 @@ to that service account. ### .spec.syncworkers.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -6411,7 +6411,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.syncworkers.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -6419,7 +6419,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.syncworkers.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -6428,7 +6428,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.syncworkers.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -6439,7 +6439,7 @@ Links: ### .spec.syncworkers.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -6452,7 +6452,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.syncworkers.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -6460,7 +6460,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.syncworkers.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -6476,7 +6476,7 @@ Links: ### .spec.syncworkers.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -6489,7 +6489,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.syncworkers.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -6505,7 +6505,7 @@ Links: ### .spec.syncworkers.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container diff --git a/pkg/apis/deployment/v1/server_group_spec.go b/pkg/apis/deployment/v1/server_group_spec.go index 3442bb731..c00e26dae 100644 --- a/pkg/apis/deployment/v1/server_group_spec.go +++ b/pkg/apis/deployment/v1/server_group_spec.go @@ -36,35 +36,6 @@ import ( kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" ) -// ServerGroupShutdownMethod enum of possible shutdown methods -type ServerGroupShutdownMethod string - -// Default return default value for ServerGroupShutdownMethod -func (s *ServerGroupShutdownMethod) Default() ServerGroupShutdownMethod { - return ServerGroupShutdownMethodAPI -} - -// Get return current or default value of ServerGroupShutdownMethod -func (s *ServerGroupShutdownMethod) Get() ServerGroupShutdownMethod { - if s == nil { - return s.Default() - } - - switch t := *s; t { - case ServerGroupShutdownMethodAPI, ServerGroupShutdownMethodDelete: - return t - default: - return s.Default() - } -} - -const ( - // ServerGroupShutdownMethodAPI API Shutdown method - ServerGroupShutdownMethodAPI ServerGroupShutdownMethod = "api" - // ServerGroupShutdownMethodDelete Pod Delete shutdown method - ServerGroupShutdownMethodDelete ServerGroupShutdownMethod = "delete" -) - // ServerGroupSpec contains the specification for all servers in a specific group (e.g. all agents) type ServerGroupSpec struct { group ServerGroup `json:"-"` @@ -243,171 +214,104 @@ type ServerGroupSpec struct { Numactl *ServerGroupSpecNumactl `json:"numactl,omitempty"` } -// ServerGroupProbesSpec contains specification for probes for pods of the server group -type ServerGroupProbesSpec struct { - // LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - // +doc/default: false - LivenessProbeDisabled *bool `json:"livenessProbeDisabled,omitempty"` - // LivenessProbeSpec override liveness probe configuration - LivenessProbeSpec *ServerGroupProbeSpec `json:"livenessProbeSpec,omitempty"` - - // OldReadinessProbeDisabled if true readinessProbes are disabled - // - // Deprecated: This field is deprecated, kept only for backward compatibility. - OldReadinessProbeDisabled *bool `json:"ReadinessProbeDisabled,omitempty"` - // ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - ReadinessProbeDisabled *bool `json:"readinessProbeDisabled,omitempty"` - // ReadinessProbeSpec override readiness probe configuration - ReadinessProbeSpec *ServerGroupProbeSpec `json:"readinessProbeSpec,omitempty"` - - // StartupProbeDisabled if true startupProbes are disabled - StartupProbeDisabled *bool `json:"startupProbeDisabled,omitempty"` - // StartupProbeSpec override startup probe configuration - StartupProbeSpec *ServerGroupProbeSpec `json:"startupProbeSpec,omitempty"` -} - -// GetReadinessProbeDisabled returns in proper manner readiness probe flag with backward compatibility. -func (s ServerGroupProbesSpec) GetReadinessProbeDisabled() *bool { - if s.OldReadinessProbeDisabled != nil { - return s.OldReadinessProbeDisabled - } - - return s.ReadinessProbeDisabled -} - -// ServerGroupProbeSpec -type ServerGroupProbeSpec struct { - // InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - // Minimum value is 0. - // +doc/default: 2 - InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` - // PeriodSeconds How often (in seconds) to perform the probe. - // Minimum value is 1. - // +doc/default: 10 - PeriodSeconds *int32 `json:"periodSeconds,omitempty"` - // TimeoutSeconds specifies number of seconds after which the probe times out - // Minimum value is 1. - // +doc/default: 2 - TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` - // SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - // Minimum value is 1. - // +doc/default: 1 - SuccessThreshold *int32 `json:"successThreshold,omitempty"` - // FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - // Giving up means restarting the container. - // Minimum value is 1. - // +doc/default: 3 - FailureThreshold *int32 `json:"failureThreshold,omitempty"` -} - -// GetInitialDelaySeconds return InitialDelaySeconds valid value. In case if InitialDelaySeconds is nil default is returned. -func (s *ServerGroupProbeSpec) GetInitialDelaySeconds(d int32) int32 { - if s == nil || s.InitialDelaySeconds == nil { - return d // Default Kubernetes value - } - - return *s.InitialDelaySeconds -} - -// GetPeriodSeconds return PeriodSeconds valid value. In case if PeriodSeconds is nil default is returned. -func (s *ServerGroupProbeSpec) GetPeriodSeconds(d int32) int32 { - if s == nil || s.PeriodSeconds == nil { - return d - } - - if *s.PeriodSeconds <= 0 { - return 1 // Value 0 is not allowed - } - - return *s.PeriodSeconds -} - -// GetTimeoutSeconds return TimeoutSeconds valid value. In case if TimeoutSeconds is nil default is returned. -func (s *ServerGroupProbeSpec) GetTimeoutSeconds(d int32) int32 { - if s == nil || s.TimeoutSeconds == nil { - return d - } - - if *s.TimeoutSeconds <= 0 { - return 1 // Value 0 is not allowed +func (s *ServerGroupSpec) Get() ServerGroupSpec { + if s != nil { + return *s } - return *s.TimeoutSeconds + return ServerGroupSpec{} } -// GetSuccessThreshold return SuccessThreshold valid value. In case if SuccessThreshold is nil default is returned. -func (s *ServerGroupProbeSpec) GetSuccessThreshold(d int32) int32 { - if s == nil || s.SuccessThreshold == nil { - return d - } - - if *s.SuccessThreshold <= 0 { - return 1 // Value 0 is not allowed - } - - return *s.SuccessThreshold +func (s ServerGroupSpec) New() *ServerGroupSpec { + return &s } -// GetFailureThreshold return FailureThreshold valid value. In case if FailureThreshold is nil default is returned. -func (s *ServerGroupProbeSpec) GetFailureThreshold(d int32) int32 { - if s == nil || s.FailureThreshold == nil { - return d - } - - if *s.FailureThreshold <= 0 { - return 1 // Value 0 is not allowed +// GetNumactl returns ServerGroupSpecNumactl +func (s *ServerGroupSpec) GetNumactl() *ServerGroupSpecNumactl { + if s == nil { + return nil } - return *s.FailureThreshold + return s.Numactl } // GetSidecars returns a list of sidecars the use wish to add -func (s ServerGroupSpec) GetSidecars() []core.Container { +func (s *ServerGroupSpec) GetSidecars() []core.Container { + if s == nil { + return nil + } return s.Sidecars } // HasVolumeClaimTemplate returns whether there is a volumeClaimTemplate or not -func (s ServerGroupSpec) HasVolumeClaimTemplate() bool { +func (s *ServerGroupSpec) HasVolumeClaimTemplate() bool { + if s == nil { + return false + } return s.VolumeClaimTemplate != nil } // GetVolumeClaimTemplate returns a pointer to a volume claim template or nil if none is specified -func (s ServerGroupSpec) GetVolumeClaimTemplate() *core.PersistentVolumeClaim { +func (s *ServerGroupSpec) GetVolumeClaimTemplate() *core.PersistentVolumeClaim { + if s == nil { + return nil + } return s.VolumeClaimTemplate } // GetCount returns the value of count. -func (s ServerGroupSpec) GetCount() int { +func (s *ServerGroupSpec) GetCount() int { + if s == nil { + return 0 + } return util.TypeOrDefault[int](s.Count) } // GetMinCount returns MinCount or 1 if not set -func (s ServerGroupSpec) GetMinCount() int { +func (s *ServerGroupSpec) GetMinCount() int { + if s == nil { + return 0 + } return util.TypeOrDefault[int](s.MinCount, 1) } // GetMaxCount returns MaxCount or -func (s ServerGroupSpec) GetMaxCount() int { +func (s *ServerGroupSpec) GetMaxCount() int { + if s == nil { + return math.MaxInt32 + } return util.TypeOrDefault[int](s.MaxCount, math.MaxInt32) } // GetNodeSelector returns the selectors for nodes of this group -func (s ServerGroupSpec) GetNodeSelector() map[string]string { +func (s *ServerGroupSpec) GetNodeSelector() map[string]string { + if s == nil { + return nil + } return s.NodeSelector } // GetAnnotations returns the annotations of this group -func (s ServerGroupSpec) GetAnnotations() map[string]string { +func (s *ServerGroupSpec) GetAnnotations() map[string]string { + if s == nil { + return nil + } return s.Annotations } // GetArgs returns the value of args. -func (s ServerGroupSpec) GetArgs() []string { +func (s *ServerGroupSpec) GetArgs() []string { + if s == nil { + return nil + } return s.Args } // GetStorageClassName returns the value of storageClassName. -func (s ServerGroupSpec) GetStorageClassName() string { +func (s *ServerGroupSpec) GetStorageClassName() string { + if s == nil { + return "" + } if pvc := s.GetVolumeClaimTemplate(); pvc != nil { return util.TypeOrDefault[string](pvc.Spec.StorageClassName) } @@ -415,22 +319,34 @@ func (s ServerGroupSpec) GetStorageClassName() string { } // GetTolerations returns the value of tolerations. -func (s ServerGroupSpec) GetTolerations() []core.Toleration { +func (s *ServerGroupSpec) GetTolerations() []core.Toleration { + if s == nil { + return nil + } return s.Tolerations } // GetServiceAccountName returns the value of serviceAccountName. -func (s ServerGroupSpec) GetServiceAccountName() string { +func (s *ServerGroupSpec) GetServiceAccountName() string { + if s == nil { + return "" + } return util.TypeOrDefault[string](s.ServiceAccountName) } // HasProbesSpec returns true if Probes is non nil -func (s ServerGroupSpec) HasProbesSpec() bool { +func (s *ServerGroupSpec) HasProbesSpec() bool { + if s == nil { + return false + } return s.Probes != nil } // GetProbesSpec returns the Probes spec or the nil value if not set -func (s ServerGroupSpec) GetProbesSpec() ServerGroupProbesSpec { +func (s *ServerGroupSpec) GetProbesSpec() ServerGroupProbesSpec { + if s == nil { + return ServerGroupProbesSpec{} + } if s.HasProbesSpec() { return *s.Probes } @@ -438,7 +354,11 @@ func (s ServerGroupSpec) GetProbesSpec() ServerGroupProbesSpec { } // GetOverrideDetectedTotalMemory returns OverrideDetectedTotalMemory with default value (false) -func (s ServerGroupSpec) GetOverrideDetectedTotalMemory() bool { +func (s *ServerGroupSpec) GetOverrideDetectedTotalMemory() bool { + if s == nil { + return true + } + if s.OverrideDetectedTotalMemory == nil { return true } @@ -447,7 +367,10 @@ func (s ServerGroupSpec) GetOverrideDetectedTotalMemory() bool { } // GetOverrideDetectedNumberOfCores returns OverrideDetectedNumberOfCores with default value (false) -func (s ServerGroupSpec) GetOverrideDetectedNumberOfCores() bool { +func (s *ServerGroupSpec) GetOverrideDetectedNumberOfCores() bool { + if s == nil { + return true + } if s.OverrideDetectedNumberOfCores == nil { return true } @@ -456,7 +379,11 @@ func (s ServerGroupSpec) GetOverrideDetectedNumberOfCores() bool { } // Validate the given group spec -func (s ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentMode, env Environment) error { +func (s *ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentMode, env Environment) error { + if s == nil { + return errors.WithStack(errors.Wrapf(ValidationError, "Validation is not allowed on nil group")) + } + if s.group != group { return errors.WithStack(errors.Wrapf(ValidationError, "Group is not set")) } @@ -559,6 +486,10 @@ func (s *ServerGroupSpec) validate() error { } func (s *ServerGroupSpec) validateVolumes() error { + if s == nil { + return nil + } + volumes := map[string]bool{} for _, volume := range s.Volumes { @@ -593,16 +524,24 @@ func (s *ServerGroupSpec) validateVolumes() error { } // WithGroup copy deployment with missing group -func (s ServerGroupSpec) WithGroup(group ServerGroup) ServerGroupSpec { - s.group = group - return s +func (s *ServerGroupSpec) WithGroup(group ServerGroup) ServerGroupSpec { + if s == nil { + return ServerGroupSpec{ + group: group, + } + } + + var q ServerGroupSpec + s.DeepCopyInto(&q) + q.group = group + return q } // WithDefaults copy deployment with missing defaults -func (s ServerGroupSpec) WithDefaults(group ServerGroup, used bool, mode DeploymentMode) ServerGroupSpec { +func (s *ServerGroupSpec) WithDefaults(group ServerGroup, used bool, mode DeploymentMode) *ServerGroupSpec { q := s.DeepCopy() q.SetDefaults(group, used, mode) - return *q + return q } // SetDefaults fills in missing defaults @@ -668,6 +607,10 @@ func setStorageDefaultsFromResourceList(s *core.ResourceList, source core.Resour // SetDefaultsFrom fills unspecified fields with a value from given source spec. func (s *ServerGroupSpec) SetDefaultsFrom(source ServerGroupSpec) { + if s == nil { + return + } + if s.Count == nil { s.Count = util.NewTypeOrNil[int](source.Count) } @@ -701,7 +644,13 @@ func (s *ServerGroupSpec) SetDefaultsFrom(source ServerGroupSpec) { // ResetImmutableFields replaces all immutable fields in the given target with values from the source spec. // It returns a list of fields that have been reset. -func (s ServerGroupSpec) ResetImmutableFields(group ServerGroup, fieldPrefix string, target *ServerGroupSpec) []string { +func (s *ServerGroupSpec) ResetImmutableFields(group ServerGroup, fieldPrefix string, target *ServerGroupSpec) []string { + if s == nil { + return []string{ + fieldPrefix, + } + } + var resetFields []string if group == ServerGroupAgents { if s.GetCount() != target.GetCount() { @@ -717,7 +666,11 @@ func (s ServerGroupSpec) ResetImmutableFields(group ServerGroup, fieldPrefix str } // Deprecated: GetVolumeAllowShrink returns true when it is possible to shrink the volume. -func (s ServerGroupSpec) GetVolumeAllowShrink() bool { +func (s *ServerGroupSpec) GetVolumeAllowShrink() bool { + if s == nil { + return false + } + if s.VolumeAllowShrink == nil { return false // Default value } @@ -734,7 +687,11 @@ func (s *ServerGroupSpec) GetEntrypoint(defaultEntrypoint string) string { } // GetShutdownDelay returns defined or default Group ShutdownDelay in seconds -func (s ServerGroupSpec) GetShutdownDelay(group ServerGroup) int { +func (s *ServerGroupSpec) GetShutdownDelay(group ServerGroup) int { + if s == nil { + return 0 + } + if s.ShutdownDelay == nil { switch group { case ServerGroupCoordinators: @@ -747,7 +704,11 @@ func (s ServerGroupSpec) GetShutdownDelay(group ServerGroup) int { } // GetTerminationGracePeriod returns termination grace period as Duration -func (s ServerGroupSpec) GetTerminationGracePeriod(group ServerGroup) time.Duration { +func (s *ServerGroupSpec) GetTerminationGracePeriod(group ServerGroup) time.Duration { + if s == nil { + return ServerGroupUnknown.DefaultTerminationGracePeriod() + } + if v := s.TerminationGracePeriodSeconds; v == nil { return group.DefaultTerminationGracePeriod() } else { @@ -756,7 +717,11 @@ func (s ServerGroupSpec) GetTerminationGracePeriod(group ServerGroup) time.Durat } // GetExternalPortEnabled returns value of ExternalPortEnabled. If ExternalPortEnabled is nil true is returned -func (s ServerGroupSpec) GetExternalPortEnabled() bool { +func (s *ServerGroupSpec) GetExternalPortEnabled() bool { + if s == nil { + return true + } + if v := s.ExternalPortEnabled; v == nil { return true } else { @@ -773,6 +738,10 @@ func (s *ServerGroupSpec) Group() ServerGroup { } func (s *ServerGroupSpec) GetPort() uint16 { + if s == nil { + return shared.ArangoPort + } + if s != nil { if p := s.Port; p != nil { return *p @@ -790,6 +759,10 @@ func (s *ServerGroupSpec) GetPort() uint16 { } func (s *ServerGroupSpec) GetExporterPort() uint16 { + if s == nil { + return shared.ArangoExporterPort + } + if s != nil { if p := s.ExporterPort; p != nil { return *p @@ -800,6 +773,10 @@ func (s *ServerGroupSpec) GetExporterPort() uint16 { } func (s *ServerGroupSpec) GetMemoryReservation() int64 { + if s == nil { + return 0 + } + if s != nil { if v := s.MemoryReservation; v != nil { if q := *v; q < 0 { @@ -816,6 +793,10 @@ func (s *ServerGroupSpec) GetMemoryReservation() int64 { } func (s *ServerGroupSpec) CalculateMemoryReservation(memory int64) int64 { + if s == nil { + return memory + } + if r := s.GetMemoryReservation(); r > 0 { return int64((float64(memory)) * (float64(100-r) / 100)) } diff --git a/pkg/apis/deployment/v1/server_group_spec_probe.go b/pkg/apis/deployment/v1/server_group_spec_probe.go new file mode 100644 index 000000000..e27916f3e --- /dev/null +++ b/pkg/apis/deployment/v1/server_group_spec_probe.go @@ -0,0 +1,139 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +// ServerGroupProbesSpec contains specification for probes for pods of the server group +type ServerGroupProbesSpec struct { + // LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + // +doc/default: false + LivenessProbeDisabled *bool `json:"livenessProbeDisabled,omitempty"` + // LivenessProbeSpec override liveness probe configuration + LivenessProbeSpec *ServerGroupProbeSpec `json:"livenessProbeSpec,omitempty"` + + // OldReadinessProbeDisabled if true readinessProbes are disabled + // + // Deprecated: This field is deprecated, kept only for backward compatibility. + OldReadinessProbeDisabled *bool `json:"ReadinessProbeDisabled,omitempty"` + // ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + ReadinessProbeDisabled *bool `json:"readinessProbeDisabled,omitempty"` + // ReadinessProbeSpec override readiness probe configuration + ReadinessProbeSpec *ServerGroupProbeSpec `json:"readinessProbeSpec,omitempty"` + + // StartupProbeDisabled if true startupProbes are disabled + StartupProbeDisabled *bool `json:"startupProbeDisabled,omitempty"` + // StartupProbeSpec override startup probe configuration + StartupProbeSpec *ServerGroupProbeSpec `json:"startupProbeSpec,omitempty"` +} + +// GetReadinessProbeDisabled returns in proper manner readiness probe flag with backward compatibility. +func (s ServerGroupProbesSpec) GetReadinessProbeDisabled() *bool { + if s.OldReadinessProbeDisabled != nil { + return s.OldReadinessProbeDisabled + } + + return s.ReadinessProbeDisabled +} + +// ServerGroupProbeSpec +type ServerGroupProbeSpec struct { + // InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + // Minimum value is 0. + // +doc/default: 2 + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` + // PeriodSeconds How often (in seconds) to perform the probe. + // Minimum value is 1. + // +doc/default: 10 + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + // TimeoutSeconds specifies number of seconds after which the probe times out + // Minimum value is 1. + // +doc/default: 2 + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` + // SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + // Minimum value is 1. + // +doc/default: 1 + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + // FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + // Giving up means restarting the container. + // Minimum value is 1. + // +doc/default: 3 + FailureThreshold *int32 `json:"failureThreshold,omitempty"` +} + +// GetInitialDelaySeconds return InitialDelaySeconds valid value. In case if InitialDelaySeconds is nil default is returned. +func (s *ServerGroupProbeSpec) GetInitialDelaySeconds(d int32) int32 { + if s == nil || s.InitialDelaySeconds == nil { + return d // Default Kubernetes value + } + + return *s.InitialDelaySeconds +} + +// GetPeriodSeconds return PeriodSeconds valid value. In case if PeriodSeconds is nil default is returned. +func (s *ServerGroupProbeSpec) GetPeriodSeconds(d int32) int32 { + if s == nil || s.PeriodSeconds == nil { + return d + } + + if *s.PeriodSeconds <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.PeriodSeconds +} + +// GetTimeoutSeconds return TimeoutSeconds valid value. In case if TimeoutSeconds is nil default is returned. +func (s *ServerGroupProbeSpec) GetTimeoutSeconds(d int32) int32 { + if s == nil || s.TimeoutSeconds == nil { + return d + } + + if *s.TimeoutSeconds <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.TimeoutSeconds +} + +// GetSuccessThreshold return SuccessThreshold valid value. In case if SuccessThreshold is nil default is returned. +func (s *ServerGroupProbeSpec) GetSuccessThreshold(d int32) int32 { + if s == nil || s.SuccessThreshold == nil { + return d + } + + if *s.SuccessThreshold <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.SuccessThreshold +} + +// GetFailureThreshold return FailureThreshold valid value. In case if FailureThreshold is nil default is returned. +func (s *ServerGroupProbeSpec) GetFailureThreshold(d int32) int32 { + if s == nil || s.FailureThreshold == nil { + return d + } + + if *s.FailureThreshold <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.FailureThreshold +} diff --git a/pkg/apis/deployment/v1/server_group_spec_shutdown_method.go b/pkg/apis/deployment/v1/server_group_spec_shutdown_method.go new file mode 100644 index 000000000..02f74f6e3 --- /dev/null +++ b/pkg/apis/deployment/v1/server_group_spec_shutdown_method.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +// ServerGroupShutdownMethod enum of possible shutdown methods +type ServerGroupShutdownMethod string + +// Default return default value for ServerGroupShutdownMethod +func (s *ServerGroupShutdownMethod) Default() ServerGroupShutdownMethod { + return ServerGroupShutdownMethodAPI +} + +// Get return current or default value of ServerGroupShutdownMethod +func (s *ServerGroupShutdownMethod) Get() ServerGroupShutdownMethod { + if s == nil { + return s.Default() + } + + switch t := *s; t { + case ServerGroupShutdownMethodAPI, ServerGroupShutdownMethodDelete: + return t + default: + return s.Default() + } +} + +const ( + // ServerGroupShutdownMethodAPI API Shutdown method + ServerGroupShutdownMethodAPI ServerGroupShutdownMethod = "api" + // ServerGroupShutdownMethodDelete Pod Delete shutdown method + ServerGroupShutdownMethodDelete ServerGroupShutdownMethod = "delete" +) diff --git a/pkg/apis/deployment/v1/server_group_spec_test.go b/pkg/apis/deployment/v1/server_group_spec_test.go index 026ccb053..df285d998 100644 --- a/pkg/apis/deployment/v1/server_group_spec_test.go +++ b/pkg/apis/deployment/v1/server_group_spec_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,55 +30,55 @@ import ( func TestServerGroupSpecValidateCount(t *testing.T) { // Valid - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) - - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](2), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6), MinCount: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](5), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSingle).New().New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) + + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](2), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6), MinCount: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](5), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) // Invalid - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, true, DeploymentModeActiveFailover, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) - - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](6), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), MinCount: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, true, DeploymentModeActiveFailover, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) + + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](6), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), MinCount: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) } @@ -88,47 +88,47 @@ func TestServerGroupSpecDefault(t *testing.T) { return spec } - assert.Equal(t, 1, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeSingle).GetCount()) - assert.Equal(t, 2, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSingle, false, DeploymentModeCluster).GetCount()) + assert.Equal(t, 1, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 2, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSingle, false, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupAgents, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupAgents, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupDBServers, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupDBServers, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupCoordinators, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupCoordinators, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncMasters, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncMasters, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncWorkers, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncWorkers, true, DeploymentModeCluster).New().GetCount()) for _, g := range AllServerGroups { assert.Equal(t, 0, len(def(ServerGroupSpec{}, g, true, DeploymentModeSingle).Args)) - assert.Equal(t, "", def(ServerGroupSpec{}, g, true, DeploymentModeSingle).GetStorageClassName()) + assert.Equal(t, "", def(ServerGroupSpec{}, g, true, DeploymentModeSingle).New().GetStorageClassName()) } } func TestServerGroupSpecValidateArgs(t *testing.T) { // Valid - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint"}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint"}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) // Invalid - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication", "true"}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint=http://something"}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--mq.type=strange"}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication", "true"}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint=http://something"}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--mq.type=strange"}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) } func TestServerGroupSpecMemoryReservation(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec.go b/pkg/apis/deployment/v2alpha1/server_group_spec.go index 8579e051c..d051efda2 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_spec.go +++ b/pkg/apis/deployment/v2alpha1/server_group_spec.go @@ -36,35 +36,6 @@ import ( kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" ) -// ServerGroupShutdownMethod enum of possible shutdown methods -type ServerGroupShutdownMethod string - -// Default return default value for ServerGroupShutdownMethod -func (s *ServerGroupShutdownMethod) Default() ServerGroupShutdownMethod { - return ServerGroupShutdownMethodAPI -} - -// Get return current or default value of ServerGroupShutdownMethod -func (s *ServerGroupShutdownMethod) Get() ServerGroupShutdownMethod { - if s == nil { - return s.Default() - } - - switch t := *s; t { - case ServerGroupShutdownMethodAPI, ServerGroupShutdownMethodDelete: - return t - default: - return s.Default() - } -} - -const ( - // ServerGroupShutdownMethodAPI API Shutdown method - ServerGroupShutdownMethodAPI ServerGroupShutdownMethod = "api" - // ServerGroupShutdownMethodDelete Pod Delete shutdown method - ServerGroupShutdownMethodDelete ServerGroupShutdownMethod = "delete" -) - // ServerGroupSpec contains the specification for all servers in a specific group (e.g. all agents) type ServerGroupSpec struct { group ServerGroup `json:"-"` @@ -243,171 +214,104 @@ type ServerGroupSpec struct { Numactl *ServerGroupSpecNumactl `json:"numactl,omitempty"` } -// ServerGroupProbesSpec contains specification for probes for pods of the server group -type ServerGroupProbesSpec struct { - // LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - // +doc/default: false - LivenessProbeDisabled *bool `json:"livenessProbeDisabled,omitempty"` - // LivenessProbeSpec override liveness probe configuration - LivenessProbeSpec *ServerGroupProbeSpec `json:"livenessProbeSpec,omitempty"` - - // OldReadinessProbeDisabled if true readinessProbes are disabled - // - // Deprecated: This field is deprecated, kept only for backward compatibility. - OldReadinessProbeDisabled *bool `json:"ReadinessProbeDisabled,omitempty"` - // ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - ReadinessProbeDisabled *bool `json:"readinessProbeDisabled,omitempty"` - // ReadinessProbeSpec override readiness probe configuration - ReadinessProbeSpec *ServerGroupProbeSpec `json:"readinessProbeSpec,omitempty"` - - // StartupProbeDisabled if true startupProbes are disabled - StartupProbeDisabled *bool `json:"startupProbeDisabled,omitempty"` - // StartupProbeSpec override startup probe configuration - StartupProbeSpec *ServerGroupProbeSpec `json:"startupProbeSpec,omitempty"` -} - -// GetReadinessProbeDisabled returns in proper manner readiness probe flag with backward compatibility. -func (s ServerGroupProbesSpec) GetReadinessProbeDisabled() *bool { - if s.OldReadinessProbeDisabled != nil { - return s.OldReadinessProbeDisabled - } - - return s.ReadinessProbeDisabled -} - -// ServerGroupProbeSpec -type ServerGroupProbeSpec struct { - // InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - // Minimum value is 0. - // +doc/default: 2 - InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` - // PeriodSeconds How often (in seconds) to perform the probe. - // Minimum value is 1. - // +doc/default: 10 - PeriodSeconds *int32 `json:"periodSeconds,omitempty"` - // TimeoutSeconds specifies number of seconds after which the probe times out - // Minimum value is 1. - // +doc/default: 2 - TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` - // SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - // Minimum value is 1. - // +doc/default: 1 - SuccessThreshold *int32 `json:"successThreshold,omitempty"` - // FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - // Giving up means restarting the container. - // Minimum value is 1. - // +doc/default: 3 - FailureThreshold *int32 `json:"failureThreshold,omitempty"` -} - -// GetInitialDelaySeconds return InitialDelaySeconds valid value. In case if InitialDelaySeconds is nil default is returned. -func (s *ServerGroupProbeSpec) GetInitialDelaySeconds(d int32) int32 { - if s == nil || s.InitialDelaySeconds == nil { - return d // Default Kubernetes value - } - - return *s.InitialDelaySeconds -} - -// GetPeriodSeconds return PeriodSeconds valid value. In case if PeriodSeconds is nil default is returned. -func (s *ServerGroupProbeSpec) GetPeriodSeconds(d int32) int32 { - if s == nil || s.PeriodSeconds == nil { - return d - } - - if *s.PeriodSeconds <= 0 { - return 1 // Value 0 is not allowed - } - - return *s.PeriodSeconds -} - -// GetTimeoutSeconds return TimeoutSeconds valid value. In case if TimeoutSeconds is nil default is returned. -func (s *ServerGroupProbeSpec) GetTimeoutSeconds(d int32) int32 { - if s == nil || s.TimeoutSeconds == nil { - return d - } - - if *s.TimeoutSeconds <= 0 { - return 1 // Value 0 is not allowed +func (s *ServerGroupSpec) Get() ServerGroupSpec { + if s != nil { + return *s } - return *s.TimeoutSeconds + return ServerGroupSpec{} } -// GetSuccessThreshold return SuccessThreshold valid value. In case if SuccessThreshold is nil default is returned. -func (s *ServerGroupProbeSpec) GetSuccessThreshold(d int32) int32 { - if s == nil || s.SuccessThreshold == nil { - return d - } - - if *s.SuccessThreshold <= 0 { - return 1 // Value 0 is not allowed - } - - return *s.SuccessThreshold +func (s ServerGroupSpec) New() *ServerGroupSpec { + return &s } -// GetFailureThreshold return FailureThreshold valid value. In case if FailureThreshold is nil default is returned. -func (s *ServerGroupProbeSpec) GetFailureThreshold(d int32) int32 { - if s == nil || s.FailureThreshold == nil { - return d - } - - if *s.FailureThreshold <= 0 { - return 1 // Value 0 is not allowed +// GetNumactl returns ServerGroupSpecNumactl +func (s *ServerGroupSpec) GetNumactl() *ServerGroupSpecNumactl { + if s == nil { + return nil } - return *s.FailureThreshold + return s.Numactl } // GetSidecars returns a list of sidecars the use wish to add -func (s ServerGroupSpec) GetSidecars() []core.Container { +func (s *ServerGroupSpec) GetSidecars() []core.Container { + if s == nil { + return nil + } return s.Sidecars } // HasVolumeClaimTemplate returns whether there is a volumeClaimTemplate or not -func (s ServerGroupSpec) HasVolumeClaimTemplate() bool { +func (s *ServerGroupSpec) HasVolumeClaimTemplate() bool { + if s == nil { + return false + } return s.VolumeClaimTemplate != nil } // GetVolumeClaimTemplate returns a pointer to a volume claim template or nil if none is specified -func (s ServerGroupSpec) GetVolumeClaimTemplate() *core.PersistentVolumeClaim { +func (s *ServerGroupSpec) GetVolumeClaimTemplate() *core.PersistentVolumeClaim { + if s == nil { + return nil + } return s.VolumeClaimTemplate } // GetCount returns the value of count. -func (s ServerGroupSpec) GetCount() int { +func (s *ServerGroupSpec) GetCount() int { + if s == nil { + return 0 + } return util.TypeOrDefault[int](s.Count) } // GetMinCount returns MinCount or 1 if not set -func (s ServerGroupSpec) GetMinCount() int { +func (s *ServerGroupSpec) GetMinCount() int { + if s == nil { + return 0 + } return util.TypeOrDefault[int](s.MinCount, 1) } // GetMaxCount returns MaxCount or -func (s ServerGroupSpec) GetMaxCount() int { +func (s *ServerGroupSpec) GetMaxCount() int { + if s == nil { + return math.MaxInt32 + } return util.TypeOrDefault[int](s.MaxCount, math.MaxInt32) } // GetNodeSelector returns the selectors for nodes of this group -func (s ServerGroupSpec) GetNodeSelector() map[string]string { +func (s *ServerGroupSpec) GetNodeSelector() map[string]string { + if s == nil { + return nil + } return s.NodeSelector } // GetAnnotations returns the annotations of this group -func (s ServerGroupSpec) GetAnnotations() map[string]string { +func (s *ServerGroupSpec) GetAnnotations() map[string]string { + if s == nil { + return nil + } return s.Annotations } // GetArgs returns the value of args. -func (s ServerGroupSpec) GetArgs() []string { +func (s *ServerGroupSpec) GetArgs() []string { + if s == nil { + return nil + } return s.Args } // GetStorageClassName returns the value of storageClassName. -func (s ServerGroupSpec) GetStorageClassName() string { +func (s *ServerGroupSpec) GetStorageClassName() string { + if s == nil { + return "" + } if pvc := s.GetVolumeClaimTemplate(); pvc != nil { return util.TypeOrDefault[string](pvc.Spec.StorageClassName) } @@ -415,22 +319,34 @@ func (s ServerGroupSpec) GetStorageClassName() string { } // GetTolerations returns the value of tolerations. -func (s ServerGroupSpec) GetTolerations() []core.Toleration { +func (s *ServerGroupSpec) GetTolerations() []core.Toleration { + if s == nil { + return nil + } return s.Tolerations } // GetServiceAccountName returns the value of serviceAccountName. -func (s ServerGroupSpec) GetServiceAccountName() string { +func (s *ServerGroupSpec) GetServiceAccountName() string { + if s == nil { + return "" + } return util.TypeOrDefault[string](s.ServiceAccountName) } // HasProbesSpec returns true if Probes is non nil -func (s ServerGroupSpec) HasProbesSpec() bool { +func (s *ServerGroupSpec) HasProbesSpec() bool { + if s == nil { + return false + } return s.Probes != nil } // GetProbesSpec returns the Probes spec or the nil value if not set -func (s ServerGroupSpec) GetProbesSpec() ServerGroupProbesSpec { +func (s *ServerGroupSpec) GetProbesSpec() ServerGroupProbesSpec { + if s == nil { + return ServerGroupProbesSpec{} + } if s.HasProbesSpec() { return *s.Probes } @@ -438,7 +354,11 @@ func (s ServerGroupSpec) GetProbesSpec() ServerGroupProbesSpec { } // GetOverrideDetectedTotalMemory returns OverrideDetectedTotalMemory with default value (false) -func (s ServerGroupSpec) GetOverrideDetectedTotalMemory() bool { +func (s *ServerGroupSpec) GetOverrideDetectedTotalMemory() bool { + if s == nil { + return true + } + if s.OverrideDetectedTotalMemory == nil { return true } @@ -447,7 +367,10 @@ func (s ServerGroupSpec) GetOverrideDetectedTotalMemory() bool { } // GetOverrideDetectedNumberOfCores returns OverrideDetectedNumberOfCores with default value (false) -func (s ServerGroupSpec) GetOverrideDetectedNumberOfCores() bool { +func (s *ServerGroupSpec) GetOverrideDetectedNumberOfCores() bool { + if s == nil { + return true + } if s.OverrideDetectedNumberOfCores == nil { return true } @@ -456,7 +379,11 @@ func (s ServerGroupSpec) GetOverrideDetectedNumberOfCores() bool { } // Validate the given group spec -func (s ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentMode, env Environment) error { +func (s *ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentMode, env Environment) error { + if s == nil { + return errors.WithStack(errors.Wrapf(ValidationError, "Validation is not allowed on nil group")) + } + if s.group != group { return errors.WithStack(errors.Wrapf(ValidationError, "Group is not set")) } @@ -559,6 +486,10 @@ func (s *ServerGroupSpec) validate() error { } func (s *ServerGroupSpec) validateVolumes() error { + if s == nil { + return nil + } + volumes := map[string]bool{} for _, volume := range s.Volumes { @@ -593,16 +524,24 @@ func (s *ServerGroupSpec) validateVolumes() error { } // WithGroup copy deployment with missing group -func (s ServerGroupSpec) WithGroup(group ServerGroup) ServerGroupSpec { - s.group = group - return s +func (s *ServerGroupSpec) WithGroup(group ServerGroup) ServerGroupSpec { + if s == nil { + return ServerGroupSpec{ + group: group, + } + } + + var q ServerGroupSpec + s.DeepCopyInto(&q) + q.group = group + return q } // WithDefaults copy deployment with missing defaults -func (s ServerGroupSpec) WithDefaults(group ServerGroup, used bool, mode DeploymentMode) ServerGroupSpec { +func (s *ServerGroupSpec) WithDefaults(group ServerGroup, used bool, mode DeploymentMode) *ServerGroupSpec { q := s.DeepCopy() q.SetDefaults(group, used, mode) - return *q + return q } // SetDefaults fills in missing defaults @@ -668,6 +607,10 @@ func setStorageDefaultsFromResourceList(s *core.ResourceList, source core.Resour // SetDefaultsFrom fills unspecified fields with a value from given source spec. func (s *ServerGroupSpec) SetDefaultsFrom(source ServerGroupSpec) { + if s == nil { + return + } + if s.Count == nil { s.Count = util.NewTypeOrNil[int](source.Count) } @@ -701,7 +644,13 @@ func (s *ServerGroupSpec) SetDefaultsFrom(source ServerGroupSpec) { // ResetImmutableFields replaces all immutable fields in the given target with values from the source spec. // It returns a list of fields that have been reset. -func (s ServerGroupSpec) ResetImmutableFields(group ServerGroup, fieldPrefix string, target *ServerGroupSpec) []string { +func (s *ServerGroupSpec) ResetImmutableFields(group ServerGroup, fieldPrefix string, target *ServerGroupSpec) []string { + if s == nil { + return []string{ + fieldPrefix, + } + } + var resetFields []string if group == ServerGroupAgents { if s.GetCount() != target.GetCount() { @@ -717,7 +666,11 @@ func (s ServerGroupSpec) ResetImmutableFields(group ServerGroup, fieldPrefix str } // Deprecated: GetVolumeAllowShrink returns true when it is possible to shrink the volume. -func (s ServerGroupSpec) GetVolumeAllowShrink() bool { +func (s *ServerGroupSpec) GetVolumeAllowShrink() bool { + if s == nil { + return false + } + if s.VolumeAllowShrink == nil { return false // Default value } @@ -734,7 +687,11 @@ func (s *ServerGroupSpec) GetEntrypoint(defaultEntrypoint string) string { } // GetShutdownDelay returns defined or default Group ShutdownDelay in seconds -func (s ServerGroupSpec) GetShutdownDelay(group ServerGroup) int { +func (s *ServerGroupSpec) GetShutdownDelay(group ServerGroup) int { + if s == nil { + return 0 + } + if s.ShutdownDelay == nil { switch group { case ServerGroupCoordinators: @@ -747,7 +704,11 @@ func (s ServerGroupSpec) GetShutdownDelay(group ServerGroup) int { } // GetTerminationGracePeriod returns termination grace period as Duration -func (s ServerGroupSpec) GetTerminationGracePeriod(group ServerGroup) time.Duration { +func (s *ServerGroupSpec) GetTerminationGracePeriod(group ServerGroup) time.Duration { + if s == nil { + return ServerGroupUnknown.DefaultTerminationGracePeriod() + } + if v := s.TerminationGracePeriodSeconds; v == nil { return group.DefaultTerminationGracePeriod() } else { @@ -756,7 +717,11 @@ func (s ServerGroupSpec) GetTerminationGracePeriod(group ServerGroup) time.Durat } // GetExternalPortEnabled returns value of ExternalPortEnabled. If ExternalPortEnabled is nil true is returned -func (s ServerGroupSpec) GetExternalPortEnabled() bool { +func (s *ServerGroupSpec) GetExternalPortEnabled() bool { + if s == nil { + return true + } + if v := s.ExternalPortEnabled; v == nil { return true } else { @@ -773,6 +738,10 @@ func (s *ServerGroupSpec) Group() ServerGroup { } func (s *ServerGroupSpec) GetPort() uint16 { + if s == nil { + return shared.ArangoPort + } + if s != nil { if p := s.Port; p != nil { return *p @@ -790,6 +759,10 @@ func (s *ServerGroupSpec) GetPort() uint16 { } func (s *ServerGroupSpec) GetExporterPort() uint16 { + if s == nil { + return shared.ArangoExporterPort + } + if s != nil { if p := s.ExporterPort; p != nil { return *p @@ -800,6 +773,10 @@ func (s *ServerGroupSpec) GetExporterPort() uint16 { } func (s *ServerGroupSpec) GetMemoryReservation() int64 { + if s == nil { + return 0 + } + if s != nil { if v := s.MemoryReservation; v != nil { if q := *v; q < 0 { @@ -816,6 +793,10 @@ func (s *ServerGroupSpec) GetMemoryReservation() int64 { } func (s *ServerGroupSpec) CalculateMemoryReservation(memory int64) int64 { + if s == nil { + return memory + } + if r := s.GetMemoryReservation(); r > 0 { return int64((float64(memory)) * (float64(100-r) / 100)) } diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec_probe.go b/pkg/apis/deployment/v2alpha1/server_group_spec_probe.go new file mode 100644 index 000000000..169587186 --- /dev/null +++ b/pkg/apis/deployment/v2alpha1/server_group_spec_probe.go @@ -0,0 +1,139 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v2alpha1 + +// ServerGroupProbesSpec contains specification for probes for pods of the server group +type ServerGroupProbesSpec struct { + // LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + // +doc/default: false + LivenessProbeDisabled *bool `json:"livenessProbeDisabled,omitempty"` + // LivenessProbeSpec override liveness probe configuration + LivenessProbeSpec *ServerGroupProbeSpec `json:"livenessProbeSpec,omitempty"` + + // OldReadinessProbeDisabled if true readinessProbes are disabled + // + // Deprecated: This field is deprecated, kept only for backward compatibility. + OldReadinessProbeDisabled *bool `json:"ReadinessProbeDisabled,omitempty"` + // ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + ReadinessProbeDisabled *bool `json:"readinessProbeDisabled,omitempty"` + // ReadinessProbeSpec override readiness probe configuration + ReadinessProbeSpec *ServerGroupProbeSpec `json:"readinessProbeSpec,omitempty"` + + // StartupProbeDisabled if true startupProbes are disabled + StartupProbeDisabled *bool `json:"startupProbeDisabled,omitempty"` + // StartupProbeSpec override startup probe configuration + StartupProbeSpec *ServerGroupProbeSpec `json:"startupProbeSpec,omitempty"` +} + +// GetReadinessProbeDisabled returns in proper manner readiness probe flag with backward compatibility. +func (s ServerGroupProbesSpec) GetReadinessProbeDisabled() *bool { + if s.OldReadinessProbeDisabled != nil { + return s.OldReadinessProbeDisabled + } + + return s.ReadinessProbeDisabled +} + +// ServerGroupProbeSpec +type ServerGroupProbeSpec struct { + // InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + // Minimum value is 0. + // +doc/default: 2 + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` + // PeriodSeconds How often (in seconds) to perform the probe. + // Minimum value is 1. + // +doc/default: 10 + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + // TimeoutSeconds specifies number of seconds after which the probe times out + // Minimum value is 1. + // +doc/default: 2 + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` + // SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + // Minimum value is 1. + // +doc/default: 1 + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + // FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + // Giving up means restarting the container. + // Minimum value is 1. + // +doc/default: 3 + FailureThreshold *int32 `json:"failureThreshold,omitempty"` +} + +// GetInitialDelaySeconds return InitialDelaySeconds valid value. In case if InitialDelaySeconds is nil default is returned. +func (s *ServerGroupProbeSpec) GetInitialDelaySeconds(d int32) int32 { + if s == nil || s.InitialDelaySeconds == nil { + return d // Default Kubernetes value + } + + return *s.InitialDelaySeconds +} + +// GetPeriodSeconds return PeriodSeconds valid value. In case if PeriodSeconds is nil default is returned. +func (s *ServerGroupProbeSpec) GetPeriodSeconds(d int32) int32 { + if s == nil || s.PeriodSeconds == nil { + return d + } + + if *s.PeriodSeconds <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.PeriodSeconds +} + +// GetTimeoutSeconds return TimeoutSeconds valid value. In case if TimeoutSeconds is nil default is returned. +func (s *ServerGroupProbeSpec) GetTimeoutSeconds(d int32) int32 { + if s == nil || s.TimeoutSeconds == nil { + return d + } + + if *s.TimeoutSeconds <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.TimeoutSeconds +} + +// GetSuccessThreshold return SuccessThreshold valid value. In case if SuccessThreshold is nil default is returned. +func (s *ServerGroupProbeSpec) GetSuccessThreshold(d int32) int32 { + if s == nil || s.SuccessThreshold == nil { + return d + } + + if *s.SuccessThreshold <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.SuccessThreshold +} + +// GetFailureThreshold return FailureThreshold valid value. In case if FailureThreshold is nil default is returned. +func (s *ServerGroupProbeSpec) GetFailureThreshold(d int32) int32 { + if s == nil || s.FailureThreshold == nil { + return d + } + + if *s.FailureThreshold <= 0 { + return 1 // Value 0 is not allowed + } + + return *s.FailureThreshold +} diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec_shutdown_method.go b/pkg/apis/deployment/v2alpha1/server_group_spec_shutdown_method.go new file mode 100644 index 000000000..63e201fff --- /dev/null +++ b/pkg/apis/deployment/v2alpha1/server_group_spec_shutdown_method.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v2alpha1 + +// ServerGroupShutdownMethod enum of possible shutdown methods +type ServerGroupShutdownMethod string + +// Default return default value for ServerGroupShutdownMethod +func (s *ServerGroupShutdownMethod) Default() ServerGroupShutdownMethod { + return ServerGroupShutdownMethodAPI +} + +// Get return current or default value of ServerGroupShutdownMethod +func (s *ServerGroupShutdownMethod) Get() ServerGroupShutdownMethod { + if s == nil { + return s.Default() + } + + switch t := *s; t { + case ServerGroupShutdownMethodAPI, ServerGroupShutdownMethodDelete: + return t + default: + return s.Default() + } +} + +const ( + // ServerGroupShutdownMethodAPI API Shutdown method + ServerGroupShutdownMethodAPI ServerGroupShutdownMethod = "api" + // ServerGroupShutdownMethodDelete Pod Delete shutdown method + ServerGroupShutdownMethodDelete ServerGroupShutdownMethod = "delete" +) diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec_test.go b/pkg/apis/deployment/v2alpha1/server_group_spec_test.go index 8c622c959..6383cef37 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/server_group_spec_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,55 +30,55 @@ import ( func TestServerGroupSpecValidateCount(t *testing.T) { // Valid - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) - - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](2), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6), MinCount: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](5), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSingle).New().New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](3)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) + + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](2), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](6), MinCount: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](5), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) // Invalid - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSingle).Validate(ServerGroupSingle, true, DeploymentModeActiveFailover, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.WithGroup(ServerGroupAgents).Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupDBServers).Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSyncMasters).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.WithGroup(ServerGroupSyncWorkers).Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) - - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](1)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](6), MaxCount: util.NewType[int](5)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), MinCount: util.NewType[int](2)}.WithGroup(ServerGroupCoordinators).Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSingle).New().Validate(ServerGroupSingle, true, DeploymentModeActiveFailover, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](0)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](-1)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupAgents).New().Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupDBServers).New().Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) + + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](5), MaxCount: util.NewType[int](1)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](6), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), MinCount: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) } @@ -88,47 +88,47 @@ func TestServerGroupSpecDefault(t *testing.T) { return spec } - assert.Equal(t, 1, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeSingle).GetCount()) - assert.Equal(t, 2, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSingle, false, DeploymentModeCluster).GetCount()) + assert.Equal(t, 1, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 2, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSingle, false, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupAgents, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupAgents, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupDBServers, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupDBServers, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupCoordinators, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupCoordinators, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncMasters, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncMasters, true, DeploymentModeCluster).New().GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeActiveFailover).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncWorkers, true, DeploymentModeCluster).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncWorkers, true, DeploymentModeCluster).New().GetCount()) for _, g := range AllServerGroups { assert.Equal(t, 0, len(def(ServerGroupSpec{}, g, true, DeploymentModeSingle).Args)) - assert.Equal(t, "", def(ServerGroupSpec{}, g, true, DeploymentModeSingle).GetStorageClassName()) + assert.Equal(t, "", def(ServerGroupSpec{}, g, true, DeploymentModeSingle).New().GetStorageClassName()) } } func TestServerGroupSpecValidateArgs(t *testing.T) { // Valid - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint"}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint"}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) // Invalid - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication", "true"}}.WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint=http://something"}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--mq.type=strange"}}.WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication=true"}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--server.authentication", "true"}}.New().WithDefaults(ServerGroupSingle, true, DeploymentModeSingle).New().Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--master.endpoint=http://something"}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewType[int](1), Args: []string{"--mq.type=strange"}}.New().WithDefaults(ServerGroupSyncMasters, true, DeploymentModeCluster).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) } func TestServerGroupSpecMemoryReservation(t *testing.T) { diff --git a/pkg/deployment/cluster_scaling_integration.go b/pkg/deployment/cluster_scaling_integration.go index 2a6c14473..a10d02e7b 100644 --- a/pkg/deployment/cluster_scaling_integration.go +++ b/pkg/deployment/cluster_scaling_integration.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -239,12 +239,12 @@ func (ci *clusterScalingIntegration) inspectCluster(ctx context.Context, expectS // Let's update the spec p := make([]patch.Item, 0, 2) if coordinatorsChanged { - if min, max, expected := ci.depl.GetSpec().Coordinators.GetMinCount(), ci.depl.GetSpec().Coordinators.GetMaxCount(), req.GetCoordinators(); min <= expected && expected <= max { + if min, max, expected := ci.depl.GetSpec().GetServerGroupSpec(api.ServerGroupCoordinators).New().GetMinCount(), ci.depl.GetSpec().GetServerGroupSpec(api.ServerGroupCoordinators).New().GetMaxCount(), req.GetCoordinators(); min <= expected && expected <= max { p = append(p, patch.ItemReplace(patch.NewPath("spec", "coordinators", "count"), expected)) } } if dbserversChanged { - if min, max, expected := ci.depl.GetSpec().DBServers.GetMinCount(), ci.depl.GetSpec().DBServers.GetMaxCount(), req.GetDBServers(); min <= expected && expected <= max { + if min, max, expected := ci.depl.GetSpec().GetServerGroupSpec(api.ServerGroupDBServers).New().GetMinCount(), ci.depl.GetSpec().GetServerGroupSpec(api.ServerGroupDBServers).New().GetMaxCount(), req.GetDBServers(); min <= expected && expected <= max { p = append(p, patch.ItemReplace(patch.NewPath("spec", "dbservers", "count"), expected)) } } diff --git a/pkg/deployment/resources/pdbs.go b/pkg/deployment/resources/pdbs.go index 4c5835cd2..afdf41dec 100644 --- a/pkg/deployment/resources/pdbs.go +++ b/pkg/deployment/resources/pdbs.go @@ -52,23 +52,23 @@ func (r *Resources) EnsurePDBs(ctx context.Context) error { // We want to lose at most one agent and dbserver. // Coordinators are not that critical. To keep the service available two should be enough - minAgents := spec.GetServerGroupSpec(api.ServerGroupAgents).GetCount() - 1 + minAgents := spec.GetServerGroupSpec(api.ServerGroupAgents).New().GetCount() - 1 currAgents := status.Members.Agents.MembersReady() - minDBServers := spec.GetServerGroupSpec(api.ServerGroupDBServers).GetCount() - 1 + minDBServers := spec.GetServerGroupSpec(api.ServerGroupDBServers).New().GetCount() - 1 currDBServers := status.Members.DBServers.MembersReady() - minCoordinators := min(spec.GetServerGroupSpec(api.ServerGroupCoordinators).GetCount()-1, 2) + minCoordinators := min(spec.GetServerGroupSpec(api.ServerGroupCoordinators).New().GetCount()-1, 2) currCoordinators := status.Members.Coordinators.MembersReady() // Setting those to zero triggers a remove of the PDB minSyncMaster, currSyncMaster := 0, 0 minSyncWorker, currSyncWorker := 0, 0 if r.context.IsSyncEnabled() { - minSyncMaster = spec.GetServerGroupSpec(api.ServerGroupSyncMasters).GetCount() - 1 + minSyncMaster = spec.GetServerGroupSpec(api.ServerGroupSyncMasters).New().GetCount() - 1 currSyncMaster = status.Members.SyncMasters.MembersReady() - minSyncWorker = spec.GetServerGroupSpec(api.ServerGroupSyncWorkers).GetCount() - 1 + minSyncWorker = spec.GetServerGroupSpec(api.ServerGroupSyncWorkers).New().GetCount() - 1 currSyncWorker = status.Members.SyncWorkers.MembersReady() } From c11b343f2fa61bad4002deae5c9a5fc5152893ed Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:53:43 +0200 Subject: [PATCH 12/50] [Feature] Envoy AuthV3 Integration (#1701) --- .golangci.yaml | 4 ++ CHANGELOG.md | 1 + go.mod | 4 ++ go.sum | 39 +++++++++++++++ integrations/envoy/auth/v3/consts.go | 25 ++++++++++ integrations/envoy/auth/v3/impl.go | 57 +++++++++++++++++++++ integrations/envoy/auth/v3/service_test.go | 58 ++++++++++++++++++++++ pkg/integrations/envoy_auth_v3.go | 55 ++++++++++++++++++++ 8 files changed, 243 insertions(+) create mode 100644 integrations/envoy/auth/v3/consts.go create mode 100644 integrations/envoy/auth/v3/impl.go create mode 100644 integrations/envoy/auth/v3/service_test.go create mode 100644 pkg/integrations/envoy_auth_v3.go diff --git a/.golangci.yaml b/.golangci.yaml index d46694844..406b638b5 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -103,6 +103,10 @@ linters-settings: alias: pbSharedV1 - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1 alias: pbImplSharedV1 + - pkg: github.com/envoyproxy/go-control-plane/envoy/service/auth/v3 + alias: pbEnvoyAuthV3 + - pkg: github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3 + alias: pbImplEnvoyAuthV3 - pkg: github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources alias: kresources gci: diff --git a/CHANGELOG.md b/CHANGELOG.md index b9264bdf2..3a82e71d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - (Feature) Envoy Image Layer - (Feature) Add ArangoDeployment ServerGroupType - (Feature) ServerGroup Pointer +- (Feature) Envoy AuthV3 Integration ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/go.mod b/go.mod index 3e27f4b0b..879007750 100644 --- a/go.mod +++ b/go.mod @@ -69,6 +69,8 @@ require ( sigs.k8s.io/yaml v1.4.0 ) +require github.com/envoyproxy/go-control-plane v0.11.1 + require ( github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -76,9 +78,11 @@ require ( github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/siphash v1.2.2 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect diff --git a/go.sum b/go.sum index 290a1d0c4..fed513951 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= @@ -31,13 +33,16 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEe github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= @@ -56,7 +61,11 @@ github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9/go.mod h1:GgB8SF9nRG github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= 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.11.1 h1:wSUXTlLfiAQRWs2F+p+EKOY9rUyis1MyGqJ2DIk5HpM= github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -102,10 +111,13 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= @@ -114,6 +126,7 @@ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9 github.com/google/cel-go v0.17.7/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= 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.5.5/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= @@ -206,6 +219,7 @@ github.com/prometheus-operator/prometheus-operator/pkg/client v0.71.2 h1:7eyX8My github.com/prometheus-operator/prometheus-operator/pkg/client v0.71.2/go.mod h1:dH5cun6jo8vesIzplptAQpdXW9dL8rD2jpvWylG4B6s= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= @@ -274,11 +288,19 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230125214544-b3c2aaf6208d/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -287,8 +309,11 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -296,6 +321,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -320,6 +346,10 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -333,12 +363,19 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -356,6 +393,8 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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.29.6 h1:eDxIl8+PeEpwbe2YyS5RXJ9vdn4hnKWMBf4WUJP9DQM= k8s.io/api v0.29.6/go.mod h1:ZuUPMhJV74DJXapldbg6upaHfiOjrBb+0ffUbBi1jaw= k8s.io/apiextensions-apiserver v0.29.6 h1:tUu1N6Zt9GT8KVcPF5aGDqfISz1mveM4yFh7eL5bxmE= diff --git a/integrations/envoy/auth/v3/consts.go b/integrations/envoy/auth/v3/consts.go new file mode 100644 index 000000000..7cd7c3413 --- /dev/null +++ b/integrations/envoy/auth/v3/consts.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +const ( + Name = "envoy.auth.v3" +) diff --git a/integrations/envoy/auth/v3/impl.go b/integrations/envoy/auth/v3/impl.go new file mode 100644 index 000000000..b85bd2c40 --- /dev/null +++ b/integrations/envoy/auth/v3/impl.go @@ -0,0 +1,57 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +import ( + "context" + + pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" + "google.golang.org/grpc" + + "github.com/arangodb/kube-arangodb/pkg/util/svc" +) + +func New() svc.Handler { + return &impl{} +} + +var _ pbEnvoyAuthV3.AuthorizationServer = &impl{} +var _ svc.Handler = &impl{} + +type impl struct { + pbEnvoyAuthV3.UnimplementedAuthorizationServer +} + +func (i *impl) Name() string { + return Name +} + +func (i *impl) Health() svc.HealthState { + return svc.Healthy +} + +func (i *impl) Register(registrar *grpc.Server) { + pbEnvoyAuthV3.RegisterAuthorizationServer(registrar, i) +} + +func (i *impl) Check(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest) (*pbEnvoyAuthV3.CheckResponse, error) { + return &pbEnvoyAuthV3.CheckResponse{}, nil +} diff --git a/integrations/envoy/auth/v3/service_test.go b/integrations/envoy/auth/v3/service_test.go new file mode 100644 index 000000000..440182d9d --- /dev/null +++ b/integrations/envoy/auth/v3/service_test.go @@ -0,0 +1,58 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +import ( + "context" + "testing" + + pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" + "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util/svc" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Client(t *testing.T, ctx context.Context) pbEnvoyAuthV3.AuthorizationClient { + local := svc.NewService(svc.Configuration{ + Address: "127.0.0.1:0", + }, New()) + + start := local.Start(ctx) + + client := tgrpc.NewGRPCClient(t, ctx, pbEnvoyAuthV3.NewAuthorizationClient, start.Address()) + + return client +} + +func Test_AllowAll(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + client := Client(t, ctx) + + resp, err := client.Check(ctx, &pbEnvoyAuthV3.CheckRequest{}) + require.NoError(t, err) + require.NoError(t, resp.Validate()) + require.Nil(t, resp.Status) + require.Nil(t, resp.HttpResponse) + require.Nil(t, resp.DynamicMetadata) +} diff --git a/pkg/integrations/envoy_auth_v3.go b/pkg/integrations/envoy_auth_v3.go new file mode 100644 index 000000000..104ff1f89 --- /dev/null +++ b/pkg/integrations/envoy_auth_v3.go @@ -0,0 +1,55 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "context" + + "github.com/spf13/cobra" + + pbImplEnvoyAuthV3 "github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3" + "github.com/arangodb/kube-arangodb/pkg/util/svc" +) + +func init() { + register(func() Integration { + return &envoyAuthV3{} + }) +} + +type envoyAuthV3 struct { +} + +func (a envoyAuthV3) Name() string { + return pbImplEnvoyAuthV3.Name +} + +func (a envoyAuthV3) Description() string { + return "Enable EnvoyAuthV3 Integration Service" +} + +func (a envoyAuthV3) Register(cmd *cobra.Command, arg ArgGen) error { + return nil +} + +func (a envoyAuthV3) Handler(ctx context.Context) (svc.Handler, error) { + return pbImplEnvoyAuthV3.New(), nil +} From 08831bf34985253cb7d360b545d11046d1f9cca6 Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Sun, 25 Aug 2024 21:36:59 +0200 Subject: [PATCH 13/50] OAS-9904 Switch to ubuntu:24.04 base image (#1702) --- CHANGELOG.md | 1 + Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a82e71d3..dc68ac940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - (Feature) Add ArangoDeployment ServerGroupType - (Feature) ServerGroup Pointer - (Feature) Envoy AuthV3 Integration +- (Maintenance) Switch to ubuntu:24.04 base image ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Dockerfile b/Dockerfile index dc08f9e1b..9cfc8a5d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG IMAGE=alpine:3.17 +ARG IMAGE=ubuntu:24.04 ARG ENVOY_IMAGE=envoyproxy/envoy:v1.31.0 # Build Steps @@ -7,7 +7,7 @@ FROM ${ENVOY_IMAGE} AS envoy FROM ${IMAGE} AS base -RUN apk upgrade --no-cache +RUN apt-get update && apt-get upgrade -y && apt-get clean FROM base From 1facdeabdb1e4b91226b5c1f074970ba01bceb9f Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Mon, 26 Aug 2024 09:08:33 +0200 Subject: [PATCH 14/50] OAS-9904 Introduce ArangoDeployment Gateway Group (#1694) Co-authored-by: ajanikow <12255597+ajanikow@users.noreply.github.com> --- CHANGELOG.md | 1 + Makefile | 2 +- README.md | 1 + docs/api/ArangoDeployment.V1.md | 936 +- docs/features/README.md | 1 + internal/features.yaml | 5 + pkg/apis/deployment/v1/deployment.go | 9 +- pkg/apis/deployment/v1/deployment_spec.go | 46 +- .../deployment/v1/deployment_spec_gateway.go | 37 + pkg/apis/deployment/v1/deployment_status.go | 7 +- .../v1/deployment_status_members.go | 40 +- .../v1/deployment_status_members_test.go | 3 +- pkg/apis/deployment/v1/server_group.go | 32 +- .../deployment/v1/server_group_spec_test.go | 5 + pkg/apis/deployment/v1/server_group_test.go | 6 + pkg/apis/deployment/v1/server_group_type.go | 1 + .../deployment/v1/zz_generated.deepcopy.go | 43 + pkg/apis/deployment/v2alpha1/deployment.go | 9 +- .../deployment/v2alpha1/deployment_spec.go | 46 +- .../v2alpha1/deployment_spec_gateway.go | 37 + .../deployment/v2alpha1/deployment_status.go | 7 +- .../v2alpha1/deployment_status_members.go | 40 +- .../deployment_status_members_test.go | 3 +- pkg/apis/deployment/v2alpha1/server_group.go | 32 +- .../v2alpha1/server_group_spec_test.go | 5 + .../deployment/v2alpha1/server_group_test.go | 6 + .../deployment/v2alpha1/server_group_type.go | 1 + .../v2alpha1/zz_generated.deepcopy.go | 43 + .../database-deployment.schema.generated.yaml | 31484 ++++++++++------ pkg/deployment/features/gateway.go | 37 + pkg/deployment/images.go | 5 + pkg/deployment/members.go | 10 + pkg/deployment/pod/utils.go | 2 +- .../reconcile/plan_builder_rebalancer_v2.go | 5 +- .../reconcile/plan_builder_rotate_upgrade.go | 1 + .../reconcile/plan_builder_scale.go | 6 + pkg/deployment/resilience/member_failure.go | 5 +- pkg/deployment/resources/pdbs.go | 10 + pkg/deployment/resources/pod_creator.go | 45 + .../resources/pod_creator_gateway.go | 346 + pkg/deployment/resources/pod_inspector.go | 3 +- pkg/deployment/resources/services.go | 4 + pkg/util/k8sutil/pods.go | 12 + pkg/util/k8sutil/tolerations/tolerations.go | 5 +- pkg/util/k8sutil/util.go | 2 +- 45 files changed, 20797 insertions(+), 12589 deletions(-) create mode 100644 pkg/apis/deployment/v1/deployment_spec_gateway.go create mode 100644 pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go create mode 100644 pkg/deployment/features/gateway.go create mode 100644 pkg/deployment/resources/pod_creator_gateway.go diff --git a/CHANGELOG.md b/CHANGELOG.md index dc68ac940..f1e06163c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - (Feature) ServerGroup Pointer - (Feature) Envoy AuthV3 Integration - (Maintenance) Switch to ubuntu:24.04 base image +- (Feature) Gateway Group for ArangoDeployment ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index 62c999662..d33c24fc9 100644 --- a/Makefile +++ b/Makefile @@ -475,7 +475,7 @@ $(BIN): $(VBIN_LINUX_AMD64) $(VBIN_OPS_LINUX_AMD64) $(VBIN_INT_LINUX_AMD64) @cp "$(VBIN_OPS_LINUX_AMD64)" "$(BIN_OPS)" .PHONY: docker -docker: check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64) +docker: clean check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64) ifdef PUSHIMAGES docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \ --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \ diff --git a/README.md b/README.md index ddcded77c..f863b2e4e 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ covers individual newer features separately. | Feature | Operator Version | Introduced | ArangoDB Version | ArangoDB Edition | State | Enabled | Flag | Remarks | |:------------------------------------------------------------------------------|:-----------------|:-----------|:-----------------|:----------------------|:-------------|:--------|:-------------------------------------------------------|:------------------------------------------------------------------------------------------| +| Gateway | 1.2.43 | 1.2.43 | >= 3.8.0 | Community, Enterprise | Alpha | True | N/A | Support for ArangoDeployment Gateway Group | | Cleanup Imported Backups | 1.2.41 | 1.2.41 | >= 3.8.0 | Community, Enterprise | Production | False | --deployment.feature.backup-cleanup | Cleanup backups created outside of the Operator and imported into Kubernetes ArangoBackup | | Upscale resources spec in init containers | 1.2.36 | 1.2.36 | >= 3.8.0 | Community, Enterprise | Production | True | --deployment.feature.init-containers-upscale-resources | Upscale resources spec to built-in init containers if they are not specified or lower | | Create backups asynchronously | 1.2.35 | 1.2.41 | >= 3.8.0 | Community, Enterprise | Production | True | --deployment.feature.async-backup-creation | Create backups asynchronously to avoid blocking the operator and reaching the timeout | diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index cb4436d8e..8bbbf460d 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -973,7 +973,7 @@ Possible Values: ### .spec.architecture -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L254) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L257) Architecture defines the list of supported architectures. First element on the list is marked as default architecture. @@ -1050,7 +1050,7 @@ KillPodProbability is the chance of a pod being killed during an event ### .spec.ClusterDomain -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L226) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L229) ClusterDomain define domain used in the kubernetes cluster. Required only of domain is not set to default (cluster.local) @@ -1061,7 +1061,7 @@ Default Value: `cluster.local` ### .spec.communicationMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L234) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L237) CommunicationMethod define communication method used in deployment @@ -3043,6 +3043,932 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. *** +### .spec.gateways.affinity + +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) + +Affinity specified additional affinity settings in ArangoDB Pod definitions + +Links: +* [Documentation of core.PodAffinity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#podaffinity-v1-core) + +*** + +### .spec.gateways.allowMemberRecreation + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) + +AllowMemberRecreation allows to recreate member. +This setting changes the member recreation logic based on group: +- For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) +- For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + +*** + +### .spec.gateways.annotations + +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) + +Annotations specified the annotations added to Pods in this group. +Annotations are merged with `spec.annotations`. + +*** + +### .spec.gateways.annotationsIgnoreList + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) + +AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + +*** + +### .spec.gateways.annotationsMode + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) + +AnnotationsMode Define annotations mode which should be use while overriding annotations + +*** + +### .spec.gateways.antiAffinity + +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) + +AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + +Links: +* [Documentation of core.Pod.AntiAffinity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#podantiaffinity-v1-core) + +*** + +### .spec.gateways.args + +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) + +Args setting specifies additional command-line arguments passed to all servers of this group. + +Default Value: `[]` + +*** + +### .spec.gateways.count + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) + +Count setting specifies the number of servers to start for the given group. +For the Agent group, this value must be a positive, odd number. +The default value is `3` for all groups except `single` (there the default is `1` +for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). +For the `syncworkers` group, it is highly recommended to use the same number +as for the `dbservers` group. + +*** + +### .spec.gateways.entrypoint + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) + +Entrypoint overrides container executable + +*** + +### .spec.gateways.envs\[int\].name + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) + +*** + +### .spec.gateways.envs\[int\].value + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) + +*** + +### .spec.gateways.ephemeralVolumes.apps.size + +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) + +Size define size of the ephemeral volume + +Links: +* [Documentation of resource.Quantity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#quantity-resource-core) + +*** + +### .spec.gateways.ephemeralVolumes.temp.size + +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) + +Size define size of the ephemeral volume + +Links: +* [Documentation of resource.Quantity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#quantity-resource-core) + +*** + +### .spec.gateways.exporterPort + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) + +ExporterPort define Port used by exporter + +*** + +### .spec.gateways.extendedRotationCheck + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) + +ExtendedRotationCheck extend checks for rotation + +*** + +### .spec.gateways.externalPortEnabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) + +ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + +*** + +### .spec.gateways.indexMethod + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) + +IndexMethod define group Indexing method + +Possible Values: +* `"random"` (default) - Pick random ID for member. Enforced on the Community Operator. +* `"ordered"` - Use sequential number as Member ID, starting from 0. Enterprise Operator required. + +*** + +### .spec.gateways.initContainers.containers + +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) + +Containers contains list of containers + +Links: +* [Documentation of core.Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#container-v1-core) + +*** + +### .spec.gateways.initContainers.mode + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) + +Mode keep container replace mode + +*** + +### .spec.gateways.internalPort + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) + +InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + +*** + +### .spec.gateways.internalPortProtocol + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) + +InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + +*** + +### .spec.gateways.labels + +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) + +Labels specified the labels added to Pods in this group. + +*** + +### .spec.gateways.labelsIgnoreList + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) + +LabelsIgnoreList list regexp or plain definitions which labels should be ignored + +*** + +### .spec.gateways.labelsMode + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) + +LabelsMode Define labels mode which should be use while overriding labels + +*** + +### .spec.gateways.maxCount + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) + +MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + +*** + +### .spec.gateways.memoryReservation + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) + +MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. +If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. +Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + +Links: +* [Documentation of the ArangoDB Envs](https://docs.arangodb.com/devel/components/arangodb-server/environment-variables/) + +Default Value: `0` + +*** + +### .spec.gateways.minCount + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) + +MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + +*** + +### .spec.gateways.nodeAffinity + +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) + +NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + +Links: +* [Documentation of code.NodeAffinity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#nodeaffinity-v1-core) + +*** + +### .spec.gateways.nodeSelector + +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) + +NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + +Links: +* [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) + +*** + +### .spec.gateways.numactl.args + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) + +Args define list of the numactl process + +Default Value: `[]` + +*** + +### .spec.gateways.numactl.enabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) + +Enabled define if numactl should be enabled + +Default Value: `false` + +*** + +### .spec.gateways.numactl.path + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) + +Path define numactl path within the container + +Default Value: `/usr/bin/numactl` + +*** + +### .spec.gateways.overrideDetectedNumberOfCores + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) + +> [!IMPORTANT] +> **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** + +OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. +If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. + +Links: +* [Documentation of the ArangoDB Envs](https://docs.arangodb.com/devel/components/arangodb-server/environment-variables/) + +Default Value: `true` + +*** + +### .spec.gateways.overrideDetectedTotalMemory + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) + +> [!IMPORTANT] +> **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** + +OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. +If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + +Links: +* [Documentation of the ArangoDB Envs](https://docs.arangodb.com/devel/components/arangodb-server/environment-variables/) + +Default Value: `true` + +*** + +### .spec.gateways.podModes.network + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) + +*** + +### .spec.gateways.podModes.pid + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) + +*** + +### .spec.gateways.port + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) + +Port define Port used by member + +*** + +### .spec.gateways.priorityClassName + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) + +PriorityClassName specifies a priority class name +Will be forwarded to the pod spec. + +Links: +* [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/) + +*** + +### .spec.gateways.probes.livenessProbeDisabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) + +LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + +Default Value: `false` + +*** + +### .spec.gateways.probes.livenessProbeSpec.failureThreshold + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) + +FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. +Giving up means restarting the container. +Minimum value is 1. + +Default Value: `3` + +*** + +### .spec.gateways.probes.livenessProbeSpec.initialDelaySeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) + +InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. +Minimum value is 0. + +Default Value: `2` + +*** + +### .spec.gateways.probes.livenessProbeSpec.periodSeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) + +PeriodSeconds How often (in seconds) to perform the probe. +Minimum value is 1. + +Default Value: `10` + +*** + +### .spec.gateways.probes.livenessProbeSpec.successThreshold + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) + +SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. +Minimum value is 1. + +Default Value: `1` + +*** + +### .spec.gateways.probes.livenessProbeSpec.timeoutSeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) + +TimeoutSeconds specifies number of seconds after which the probe times out +Minimum value is 1. + +Default Value: `2` + +*** + +### .spec.gateways.probes.ReadinessProbeDisabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) + +> [!WARNING] +> ***DEPRECATED*** +> +> **This field is deprecated, kept only for backward compatibility.** + +OldReadinessProbeDisabled if true readinessProbes are disabled + +*** + +### .spec.gateways.probes.readinessProbeDisabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) + +ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + +*** + +### .spec.gateways.probes.readinessProbeSpec.failureThreshold + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) + +FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. +Giving up means restarting the container. +Minimum value is 1. + +Default Value: `3` + +*** + +### .spec.gateways.probes.readinessProbeSpec.initialDelaySeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) + +InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. +Minimum value is 0. + +Default Value: `2` + +*** + +### .spec.gateways.probes.readinessProbeSpec.periodSeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) + +PeriodSeconds How often (in seconds) to perform the probe. +Minimum value is 1. + +Default Value: `10` + +*** + +### .spec.gateways.probes.readinessProbeSpec.successThreshold + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) + +SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. +Minimum value is 1. + +Default Value: `1` + +*** + +### .spec.gateways.probes.readinessProbeSpec.timeoutSeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) + +TimeoutSeconds specifies number of seconds after which the probe times out +Minimum value is 1. + +Default Value: `2` + +*** + +### .spec.gateways.probes.startupProbeDisabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) + +StartupProbeDisabled if true startupProbes are disabled + +*** + +### .spec.gateways.probes.startupProbeSpec.failureThreshold + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) + +FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. +Giving up means restarting the container. +Minimum value is 1. + +Default Value: `3` + +*** + +### .spec.gateways.probes.startupProbeSpec.initialDelaySeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) + +InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. +Minimum value is 0. + +Default Value: `2` + +*** + +### .spec.gateways.probes.startupProbeSpec.periodSeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) + +PeriodSeconds How often (in seconds) to perform the probe. +Minimum value is 1. + +Default Value: `10` + +*** + +### .spec.gateways.probes.startupProbeSpec.successThreshold + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) + +SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. +Minimum value is 1. + +Default Value: `1` + +*** + +### .spec.gateways.probes.startupProbeSpec.timeoutSeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) + +TimeoutSeconds specifies number of seconds after which the probe times out +Minimum value is 1. + +Default Value: `2` + +*** + +### .spec.gateways.pvcResizeMode + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) + +VolumeResizeMode specified resize mode for PVCs and PVs + +Possible Values: +* `"runtime"` (default) - PVC will be resized in Pod runtime (EKS, GKE) +* `"rotate"` - Pod will be shutdown and PVC will be resized (AKS) + +*** + +### .spec.gateways.resources + +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) + +Resources holds resource requests & limits + +Links: +* [Documentation of core.ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#resourcerequirements-v1-core) + +*** + +### .spec.gateways.schedulerName + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) + +SchedulerName define scheduler name used for group + +*** + +### .spec.gateways.securityContext.addCapabilities + +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) + +AddCapabilities add new capabilities to containers + +*** + +### .spec.gateways.securityContext.allowPrivilegeEscalation + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) + +AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + +*** + +### .spec.gateways.securityContext.dropAllCapabilities + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) + +> [!WARNING] +> ***DEPRECATED*** +> +> **This field is added for backward compatibility. Will be removed in 1.1.0.** + +DropAllCapabilities specifies if capabilities should be dropped for this pod containers + +*** + +### .spec.gateways.securityContext.fsGroup + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) + +FSGroup is a special supplemental group that applies to all containers in a pod. + +*** + +### .spec.gateways.securityContext.privileged + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) + +Privileged If true, runs container in privileged mode. Processes in privileged containers are +essentially equivalent to root on the host. + +*** + +### .spec.gateways.securityContext.readOnlyRootFilesystem + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) + +ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + +*** + +### .spec.gateways.securityContext.runAsGroup + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) + +RunAsGroup is the GID to run the entrypoint of the container process. + +*** + +### .spec.gateways.securityContext.runAsNonRoot + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) + +RunAsNonRoot if true, indicates that the container must run as a non-root user. + +*** + +### .spec.gateways.securityContext.runAsUser + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) + +RunAsUser is the UID to run the entrypoint of the container process. + +*** + +### .spec.gateways.securityContext.seccompProfile + +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) + +SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + +Links: +* [Documentation of core.SeccompProfile](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#seccompprofile-v1-core) + +*** + +### .spec.gateways.securityContext.seLinuxOptions + +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) + +SELinuxOptions are the labels to be applied to the container + +Links: +* [Documentation of core.SELinuxOptions](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#selinuxoptions-v1-core) + +*** + +### .spec.gateways.securityContext.supplementalGroups + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) + +SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, +the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + +*** + +### .spec.gateways.securityContext.sysctls + +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) + +Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported +sysctls (by the container runtime) might fail to launch. +Map Value can be String or Int + +Links: +* [Documentation](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) + +Example: +```yaml +sysctls: + "kernel.shm_rmid_forced": "0" + "net.core.somaxconn": 1024 + "kernel.msgmax": "65536" +``` + +*** + +### .spec.gateways.serviceAccountName + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) + +ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created +for each server of this group. If empty, it defaults to using the +`default` service account. +Using an alternative `ServiceAccount` is typically used to separate access rights. +The ArangoDB deployments need some very minimal access rights. With the +deployment of the operator, we grant the rights to 'get' all 'pod' resources. +If you are using a different service account, please grant these rights +to that service account. + +*** + +### .spec.gateways.shutdownDelay + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) + +ShutdownDelay define how long operator should delay finalizer removal after shutdown + +*** + +### .spec.gateways.shutdownMethod + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) + +ShutdownMethod describe procedure of member shutdown taken by Operator + +*** + +### .spec.gateways.sidecarCoreNames + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) + +SidecarCoreNames is a list of sidecar containers which must run in the pod. +Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + +*** + +### .spec.gateways.sidecars + +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) + +Sidecars specifies a list of additional containers to be started + +Links: +* [Documentation of core.Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#container-v1-core) + +*** + +### .spec.gateways.storageClassName + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) + +> [!WARNING] +> ***DEPRECATED*** +> +> **Use VolumeClaimTemplate instead.** + +StorageClassName specifies the classname for storage of the servers. + +*** + +### .spec.gateways.terminationGracePeriodSeconds + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) + +TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + +*** + +### .spec.gateways.tolerations + +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) + +Tolerations specifies the tolerations added to Pods in this group. +By default, suitable tolerations are set for the following keys with the `NoExecute` effect: +- `node.kubernetes.io/not-ready` +- `node.kubernetes.io/unreachable` +- `node.alpha.kubernetes.io/unreachable` (will be removed in future version) +For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + +Links: +* [Documentation of core.Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#toleration-v1-core) + +*** + +### .spec.gateways.volumeAllowShrink + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) + +> [!WARNING] +> ***DEPRECATED*** +> +> **Not used anymore** + +VolumeAllowShrink allows shrinking of the volume + +*** + +### .spec.gateways.volumeClaimTemplate + +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) + +VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. +This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. +The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. +If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim +with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` +and `iops` is not forwarded to the pods resource requirements. + +Links: +* [Documentation of core.PersistentVolumeClaim](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#persistentvolumeclaim-v1-core) + +*** + +### .spec.gateways.volumeMounts + +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) + +VolumeMounts define list of volume mounts mounted into server container + +Links: +* [Documentation of ServerGroupSpecVolumeMount](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#volumemount-v1-core) + +*** + +### .spec.gateways.volumes\[int\].configMap + +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) + +ConfigMap which should be mounted into pod + +Links: +* [Documentation of core.ConfigMapVolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#configmapvolumesource-v1-core) + +*** + +### .spec.gateways.volumes\[int\].emptyDir + +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) + +EmptyDir + +Links: +* [Documentation of core.EmptyDirVolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#emptydirvolumesource-v1-core) + +*** + +### .spec.gateways.volumes\[int\].hostPath + +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) + +HostPath + +Links: +* [Documentation of core.HostPathVolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#hostpathvolumesource-v1-core) + +*** + +### .spec.gateways.volumes\[int\].name + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) + +Name of volume + +*** + +### .spec.gateways.volumes\[int\].persistentVolumeClaim + +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) + +PersistentVolumeClaim + +Links: +* [Documentation of core.PersistentVolumeClaimVolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#persistentvolumeclaimvolumesource-v1-core) + +*** + +### .spec.gateways.volumes\[int\].secret + +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) + +Secret which should be mounted into pod + +Links: +* [Documentation of core.SecretVolumeSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretvolumesource-v1-core) + +*** + ### .spec.id.affinity Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L48) @@ -3369,7 +4295,7 @@ Links: ### .spec.memberPropagationMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L209) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L212) MemberPropagationMode defines how changes to pod spec should be propogated. Changes to a pod’s configuration require a restart of that pod in almost all cases. @@ -6605,7 +7531,7 @@ MaintenanceGracePeriod action timeout ### .spec.timezone -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L258) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L261) Timezone if specified, will set a timezone for deployment. Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` diff --git a/docs/features/README.md b/docs/features/README.md index 5efce638b..c59b17ffb 100644 --- a/docs/features/README.md +++ b/docs/features/README.md @@ -8,6 +8,7 @@ title: List of all features | Feature | Operator Version | Introduced | ArangoDB Version | ArangoDB Edition | State | Enabled | Flag | Remarks | |:----------------------------------------------------------------|:-----------------|:-----------|:-----------------|:----------------------|:-------------|:--------|:-------------------------------------------------------|:------------------------------------------------------------------------------------------| +| Gateway | 1.2.43 | 1.2.43 | >= 3.8.0 | Community, Enterprise | Alpha | True | N/A | Support for ArangoDeployment Gateway Group | | Cleanup Imported Backups | 1.2.41 | 1.2.41 | >= 3.8.0 | Community, Enterprise | Production | False | --deployment.feature.backup-cleanup | Cleanup backups created outside of the Operator and imported into Kubernetes ArangoBackup | | Upscale resources spec in init containers | 1.2.36 | 1.2.36 | >= 3.8.0 | Community, Enterprise | Production | True | --deployment.feature.init-containers-upscale-resources | Upscale resources spec to built-in init containers if they are not specified or lower | | Create backups asynchronously | 1.2.35 | 1.2.41 | >= 3.8.0 | Community, Enterprise | Production | True | --deployment.feature.async-backup-creation | Create backups asynchronously to avoid blocking the operator and reaching the timeout | diff --git a/internal/features.yaml b/internal/features.yaml index 3fce1a5f9..fddd3f509 100644 --- a/internal/features.yaml +++ b/internal/features.yaml @@ -257,3 +257,8 @@ features: releases: - operatorVersion: 1.2.36 state: Alpha + - name: Gateway + remarks: Support for ArangoDeployment Gateway Group + releases: + - operatorVersion: 1.2.43 + state: Alpha diff --git a/pkg/apis/deployment/v1/deployment.go b/pkg/apis/deployment/v1/deployment.go index 4f5d186b8..ec8bb763d 100644 --- a/pkg/apis/deployment/v1/deployment.go +++ b/pkg/apis/deployment/v1/deployment.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ func (d *ArangoDeployment) AsOwner() meta.OwnerReference { // ForeachServerGroup calls the given callback for all server groups. // If the callback returns an error, this error is returned and no other server // groups are processed. -// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers +// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers, gateways func (d *ArangoDeployment) ForeachServerGroup(cb ServerGroupFunc, status *DeploymentStatus) error { if status == nil { status = &d.Status @@ -84,7 +84,7 @@ func (d *ArangoDeployment) ForeachServerGroup(cb ServerGroupFunc, status *Deploy // ForeachServerGroupAccepted calls the given callback for all accepted server groups. // If the callback returns an error, this error is returned and no other server // groups are processed. -// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers +// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers, gateways func (d *ArangoDeployment) ForeachServerGroupAccepted(cb ServerGroupFunc, status *DeploymentStatus) error { if status == nil { status = &d.Status @@ -115,6 +115,9 @@ func (d *ArangoDeployment) foreachServerGroup(cb ServerGroupFunc, spec Deploymen if err := cb(ServerGroupSyncWorkers, spec.SyncWorkers, &status.Members.SyncWorkers); err != nil { return errors.WithStack(err) } + if err := cb(ServerGroupGateways, spec.Gateways.Get(), &status.Members.Gateways); err != nil { + return errors.WithStack(err) + } return nil } diff --git a/pkg/apis/deployment/v1/deployment_spec.go b/pkg/apis/deployment/v1/deployment_spec.go index 12a8690d6..d25070f04 100644 --- a/pkg/apis/deployment/v1/deployment_spec.go +++ b/pkg/apis/deployment/v1/deployment_spec.go @@ -199,6 +199,9 @@ type DeploymentSpec struct { // SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`. SyncWorkers ServerGroupSpec `json:"syncworkers"` + // Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. + Gateways *ServerGroupSpec `json:"gateways,omitempty"` + // MemberPropagationMode defines how changes to pod spec should be propogated. // Changes to a pod’s configuration require a restart of that pod in almost all cases. // Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator. @@ -256,6 +259,9 @@ type DeploymentSpec struct { // Timezone if specified, will set a timezone for deployment. // Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` Timezone *string `json:"timezone,omitempty"` + + // Gateway defined main Gateway configuration. + Gateway *DeploymentSpecGateway `json:"gateway,omitempty"` } // GetAllowMemberRecreation returns member recreation policy based on group and settings @@ -267,6 +273,8 @@ func (s *DeploymentSpec) GetAllowMemberRecreation(group ServerGroup) bool { groupSpec := s.GetServerGroupSpec(group) switch group { + case ServerGroupGateways: + return true case ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: if v := groupSpec.AllowMemberRecreation; v == nil { return true @@ -326,6 +334,11 @@ func (s DeploymentSpec) GetSyncImage() string { return s.GetImage() } +// IsGatewayEnabled returns true when the deployment has gateways enabled. +func (s DeploymentSpec) IsGatewayEnabled() bool { + return s.Gateway.IsEnabled() +} + // GetImagePullPolicy returns the value of imagePullPolicy. func (s DeploymentSpec) GetImagePullPolicy() core.PullPolicy { return util.TypeOrDefault[core.PullPolicy](s.ImagePullPolicy) @@ -364,8 +377,7 @@ func (s DeploymentSpec) IsSecure() bool { return s.TLS.IsSecure() } -// GetServerGroupSpec returns the server group spec (from this -// deployment spec) for the given group. +// GetServerGroupSpec returns the server group spec (from this deployment spec) for the given group. func (s DeploymentSpec) GetServerGroupSpec(group ServerGroup) ServerGroupSpec { switch group { case ServerGroupSingle: @@ -380,13 +392,14 @@ func (s DeploymentSpec) GetServerGroupSpec(group ServerGroup) ServerGroupSpec { return s.SyncMasters.WithGroup(group) case ServerGroupSyncWorkers: return s.SyncWorkers.WithGroup(group) + case ServerGroupGateways: + return s.Gateways.WithGroup(group) default: return ServerGroupSpec{} } } -// UpdateServerGroupSpec returns the server group spec (from this -// deployment spec) for the given group. +// UpdateServerGroupSpec returns the server group spec (from this deployment spec) for the given group. func (s *DeploymentSpec) UpdateServerGroupSpec(group ServerGroup, gspec ServerGroupSpec) { switch group { case ServerGroupSingle: @@ -401,6 +414,8 @@ func (s *DeploymentSpec) UpdateServerGroupSpec(group ServerGroup, gspec ServerGr s.SyncMasters = gspec case ServerGroupSyncWorkers: s.SyncWorkers = gspec + case ServerGroupGateways: + s.Gateways = gspec.DeepCopy() } } @@ -421,6 +436,11 @@ func (s *DeploymentSpec) SetDefaults(deploymentName string) { if s.GetImagePullPolicy() == "" { s.ImagePullPolicy = util.NewType[core.PullPolicy](core.PullIfNotPresent) } + if s.Gateway.IsEnabled() { + if s.Gateways == nil { + s.Gateways = &ServerGroupSpec{} + } + } s.ExternalAccess.SetDefaults() s.RocksDB.SetDefaults() s.Authentication.SetDefaults(deploymentName + "-jwt") @@ -432,6 +452,7 @@ func (s *DeploymentSpec) SetDefaults(deploymentName string) { s.Coordinators.SetDefaults(ServerGroupCoordinators, s.GetMode().HasCoordinators(), s.GetMode()) s.SyncMasters.SetDefaults(ServerGroupSyncMasters, s.Sync.IsEnabled(), s.GetMode()) s.SyncWorkers.SetDefaults(ServerGroupSyncWorkers, s.Sync.IsEnabled(), s.GetMode()) + s.Gateways.SetDefaults(ServerGroupGateways, s.IsGatewayEnabled(), s.GetMode()) s.Metrics.SetDefaults(deploymentName+"-exporter-jwt-token", s.Authentication.IsAuthenticated()) s.Chaos.SetDefaults() s.Bootstrap.SetDefaults(deploymentName) @@ -480,6 +501,7 @@ func (s *DeploymentSpec) SetDefaultsFrom(source DeploymentSpec) { s.Coordinators.SetDefaultsFrom(source.Coordinators) s.SyncMasters.SetDefaultsFrom(source.SyncMasters) s.SyncWorkers.SetDefaultsFrom(source.SyncWorkers) + s.Gateways.SetDefaultsFrom(source.Gateways.Get()) s.Metrics.SetDefaultsFrom(source.Metrics) s.Lifecycle.SetDefaultsFrom(source.Lifecycle) s.Chaos.SetDefaultsFrom(source.Chaos) @@ -539,6 +561,11 @@ func (s *DeploymentSpec) Validate() error { if err := s.SyncWorkers.Validate(ServerGroupSyncWorkers, s.Sync.IsEnabled(), s.GetMode(), s.GetEnvironment()); err != nil { return errors.WithStack(err) } + if s.IsGatewayEnabled() { + if err := s.Gateways.Validate(ServerGroupGateways, s.IsGatewayEnabled(), s.GetMode(), s.GetEnvironment()); err != nil { + return errors.WithStack(err) + } + } if err := s.Metrics.Validate(); err != nil { return errors.WithStack(errors.Wrap(err, "spec.metrics")) } @@ -554,6 +581,9 @@ func (s *DeploymentSpec) Validate() error { if err := s.Architecture.Validate(); err != nil { return errors.WithStack(errors.Wrap(err, "spec.architecture")) } + if err := s.Gateway.Validate(); err != nil { + return errors.WithStack(errors.Wrap(err, "spec.architecture")) + } return nil } @@ -614,6 +644,14 @@ func (s DeploymentSpec) ResetImmutableFields(target *DeploymentSpec) []string { if l := s.SyncWorkers.ResetImmutableFields(ServerGroupSyncWorkers, "syncworkers", &target.SyncWorkers); l != nil { resetFields = append(resetFields, l...) } + if s.Gateways != nil { + if target.Gateways == nil { + target.Gateways = &ServerGroupSpec{} + } + if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil { + resetFields = append(resetFields, l...) + } + } if l := s.Metrics.ResetImmutableFields("metrics", &target.Metrics); l != nil { resetFields = append(resetFields, l...) } diff --git a/pkg/apis/deployment/v1/deployment_spec_gateway.go b/pkg/apis/deployment/v1/deployment_spec_gateway.go new file mode 100644 index 000000000..ecb4f9389 --- /dev/null +++ b/pkg/apis/deployment/v1/deployment_spec_gateway.go @@ -0,0 +1,37 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +type DeploymentSpecGateway struct { + Enabled *bool `json:"enabled,omitempty"` +} + +func (d *DeploymentSpecGateway) IsEnabled() bool { + if d == nil || d.Enabled == nil { + return false + } + + return *d.Enabled +} + +func (d *DeploymentSpecGateway) Validate() error { + return nil +} diff --git a/pkg/apis/deployment/v1/deployment_status.go b/pkg/apis/deployment/v1/deployment_status.go index d6f0fcd9a..6f422ff8c 100644 --- a/pkg/apis/deployment/v1/deployment_status.go +++ b/pkg/apis/deployment/v1/deployment_status.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -103,6 +103,7 @@ type DeploymentStatus struct { Coordinators *ServerGroupStatus `json:"coordinators,omitempty"` SyncMasters *ServerGroupStatus `json:"syncmasters,omitempty"` SyncWorkers *ServerGroupStatus `json:"syncworkers,omitempty"` + Gateways *ServerGroupStatus `json:"gateways,omitempty"` } // Equal checks for equality @@ -174,6 +175,8 @@ func (ds DeploymentStatus) getServerGroupStatus(group ServerGroup) *ServerGroupS return ds.SyncMasters.DeepCopy() case ServerGroupSyncWorkers: return ds.SyncWorkers.DeepCopy() + case ServerGroupGateways: + return ds.Gateways.DeepCopy() default: return nil } @@ -195,5 +198,7 @@ func (ds *DeploymentStatus) UpdateServerGroupStatus(group ServerGroup, gspec Ser ds.SyncMasters = &gspec case ServerGroupSyncWorkers: ds.SyncWorkers = &gspec + case ServerGroupGateways: + ds.Gateways = &gspec } } diff --git a/pkg/apis/deployment/v1/deployment_status_members.go b/pkg/apis/deployment/v1/deployment_status_members.go index 8215de38e..25fce7f47 100644 --- a/pkg/apis/deployment/v1/deployment_status_members.go +++ b/pkg/apis/deployment/v1/deployment_status_members.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ type DeploymentStatusMembers struct { Coordinators MemberStatusList `json:"coordinators,omitempty"` SyncMasters MemberStatusList `json:"syncmasters,omitempty"` SyncWorkers MemberStatusList `json:"syncworkers,omitempty"` + Gateways MemberStatusList `json:"gateways,omitempty"` } // Equal checks for equality @@ -44,7 +45,8 @@ func (ds DeploymentStatusMembers) Equal(other DeploymentStatusMembers) bool { ds.DBServers.Equal(other.DBServers) && ds.Coordinators.Equal(other.Coordinators) && ds.SyncMasters.Equal(other.SyncMasters) && - ds.SyncWorkers.Equal(other.SyncWorkers) + ds.SyncWorkers.Equal(other.SyncWorkers) && + ds.Gateways.Equal(other.Gateways) } // ContainsID returns true if the given set of members contains a member with given ID. @@ -54,7 +56,8 @@ func (ds DeploymentStatusMembers) ContainsID(id string) bool { ds.DBServers.ContainsID(id) || ds.Coordinators.ContainsID(id) || ds.SyncMasters.ContainsID(id) || - ds.SyncWorkers.ContainsID(id) + ds.SyncWorkers.ContainsID(id) || + ds.Gateways.ContainsID(id) } // ElementByID returns the element in the given list that has the given ID and true. @@ -78,6 +81,9 @@ func (ds DeploymentStatusMembers) ElementByID(id string) (MemberStatus, ServerGr if result, found := ds.SyncWorkers.ElementByID(id); found { return result, ServerGroupSyncWorkers, true } + if result, found := ds.Gateways.ElementByID(id); found { + return result, ServerGroupGateways, true + } return MemberStatus{}, 0, false } @@ -129,6 +135,10 @@ func (ds DeploymentStatusMembers) ForServerGroup(cb MemberStatusFunc, group Serv if err := cb(ServerGroupSyncWorkers, ds.SyncWorkers); err != nil { return errors.WithStack(err) } + case ServerGroupGateways: + if err := cb(ServerGroupGateways, ds.Gateways); err != nil { + return errors.WithStack(err) + } } return nil } @@ -155,6 +165,9 @@ func (ds DeploymentStatusMembers) MemberStatusByPodName(podName string) (MemberS if result, found := ds.SyncWorkers.ElementByPodName(podName); found { return result, ServerGroupSyncWorkers, true } + if result, found := ds.Gateways.ElementByPodName(podName); found { + return result, ServerGroupGateways, true + } return MemberStatus{}, 0, false } @@ -190,6 +203,8 @@ func (ds *DeploymentStatusMembers) Add(status MemberStatus, group ServerGroup) e err = ds.SyncMasters.add(status) case ServerGroupSyncWorkers: err = ds.SyncWorkers.add(status) + case ServerGroupGateways: + err = ds.Gateways.add(status) default: return errors.WithStack(errors.Wrapf(NotFoundError, "ServerGroup %d is not known", group)) } @@ -215,6 +230,8 @@ func (ds *DeploymentStatusMembers) Update(status MemberStatus, group ServerGroup err = ds.SyncMasters.update(status) case ServerGroupSyncWorkers: err = ds.SyncWorkers.update(status) + case ServerGroupGateways: + err = ds.Gateways.update(status) default: return errors.WithStack(errors.Wrapf(NotFoundError, "ServerGroup %d is not known", group)) } @@ -241,6 +258,8 @@ func (ds *DeploymentStatusMembers) RemoveByID(id string, group ServerGroup) erro err = ds.SyncMasters.removeByID(id) case ServerGroupSyncWorkers: err = ds.SyncWorkers.removeByID(id) + case ServerGroupGateways: + err = ds.Gateways.removeByID(id) default: return errors.WithStack(errors.Wrapf(NotFoundError, "ServerGroup %d is not known", group)) } @@ -250,23 +269,30 @@ func (ds *DeploymentStatusMembers) RemoveByID(id string, group ServerGroup) erro return nil } -// AllMembersReady returns true when all members, that must be ready for the given mode, are in the Ready state. -func (ds DeploymentStatusMembers) AllMembersReady(mode DeploymentMode, syncEnabled bool) bool { +// AllMembersReady returns true when all members, that must be ready for the given mode are in the Ready state. +func (ds DeploymentStatusMembers) AllMembersReady(mode DeploymentMode, syncEnabled, gatewayEnabled bool) bool { syncReady := func() bool { if syncEnabled { return ds.SyncMasters.AllMembersReady() && ds.SyncWorkers.AllMembersReady() } return true } + gatewayReady := func() bool { + if gatewayEnabled { + return ds.Gateways.AllMembersReady() + } + return true + } switch mode { case DeploymentModeSingle: - return ds.Single.MembersReady() > 0 + return ds.Single.MembersReady() > 0 && gatewayReady() case DeploymentModeActiveFailover: return ds.Agents.AllMembersReady() && ds.Single.MembersReady() > 0 case DeploymentModeCluster: return ds.Agents.AllMembersReady() && ds.DBServers.AllMembersReady() && ds.Coordinators.AllMembersReady() && + gatewayReady() && syncReady() default: return false @@ -288,6 +314,8 @@ func (ds DeploymentStatusMembers) MembersOfGroup(group ServerGroup) MemberStatus return ds.SyncMasters case ServerGroupSyncWorkers: return ds.SyncWorkers + case ServerGroupGateways: + return ds.Gateways default: return MemberStatusList{} } diff --git a/pkg/apis/deployment/v1/deployment_status_members_test.go b/pkg/apis/deployment/v1/deployment_status_members_test.go index aea0020b7..e88f2a1e9 100644 --- a/pkg/apis/deployment/v1/deployment_status_members_test.go +++ b/pkg/apis/deployment/v1/deployment_status_members_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ func newMemberList() DeploymentStatusMembers { Coordinators: MemberStatusList{{ID: ServerGroupCoordinators.AsRole()}}, SyncMasters: MemberStatusList{{ID: ServerGroupSyncMasters.AsRole()}}, SyncWorkers: MemberStatusList{{ID: ServerGroupSyncWorkers.AsRole()}}, + Gateways: MemberStatusList{{ID: ServerGroupGateways.AsRole()}}, } } diff --git a/pkg/apis/deployment/v1/server_group.go b/pkg/apis/deployment/v1/server_group.go index b504f1cd9..d3795422e 100644 --- a/pkg/apis/deployment/v1/server_group.go +++ b/pkg/apis/deployment/v1/server_group.go @@ -84,6 +84,7 @@ const ( ServerGroupCoordinators ServerGroup = 4 ServerGroupSyncMasters ServerGroup = 5 ServerGroupSyncWorkers ServerGroup = 6 + ServerGroupGateways ServerGroup = 7 ServerGroupImageDiscovery ServerGroup = -1 ServerGroupSingleString = "single" @@ -92,6 +93,7 @@ const ( ServerGroupCoordinatorsString = "coordinator" ServerGroupSyncMastersString = "syncmaster" ServerGroupSyncWorkersString = "syncworker" + ServerGroupGatewaysString = "gateways" ServerGroupImageDiscoveryString = "id" ServerGroupSingleAbbreviatedString = "sngl" @@ -100,6 +102,7 @@ const ( ServerGroupCoordinatorsAbbreviatedString = "crdn" ServerGroupSyncMastersAbbreviatedString = "syma" ServerGroupSyncWorkersAbbreviatedString = "sywo" + ServerGroupGatewaysAbbreviatedString = "gway" ServerGroupImageDiscoveryAbbreviatedString = "id" ) @@ -112,6 +115,7 @@ var ( ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers, + ServerGroupGateways, } // AllArangoDServerGroups contains a constant list of all ArangoD server groups AllArangoDServerGroups = []ServerGroup{ @@ -131,6 +135,8 @@ func (g ServerGroup) Type() ServerGroupType { return ServerGroupTypeID case ServerGroupSyncMasters, ServerGroupSyncWorkers: return ServerGroupTypeArangoSync + case ServerGroupGateways: + return ServerGroupTypeGateway default: return ServerGroupTypeUnknown } @@ -151,6 +157,8 @@ func (g ServerGroup) AsRole() string { return ServerGroupSyncMastersString case ServerGroupSyncWorkers: return ServerGroupSyncWorkersString + case ServerGroupGateways: + return ServerGroupGatewaysString case ServerGroupImageDiscovery: return ServerGroupImageDiscoveryString default: @@ -163,14 +171,14 @@ func (g ServerGroup) Enabled(mode DeploymentMode) bool { switch mode { case DeploymentModeSingle: switch g { - case ServerGroupSingle: + case ServerGroupSingle, ServerGroupGateways: return true default: return false } case DeploymentModeCluster: switch g { - case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: + case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers, ServerGroupGateways: return true default: return false @@ -202,6 +210,8 @@ func (g ServerGroup) AsRoleAbbreviated() string { return ServerGroupSyncMastersAbbreviatedString case ServerGroupSyncWorkers: return ServerGroupSyncWorkersAbbreviatedString + case ServerGroupGateways: + return ServerGroupGatewaysAbbreviatedString case ServerGroupImageDiscovery: return ServerGroupImageDiscoveryAbbreviatedString default: @@ -228,7 +238,7 @@ func (g ServerGroup) DefaultTerminationGracePeriod() time.Duration { // IsStateless returns true when the groups runs servers without a persistent volume. func (g ServerGroup) IsStateless() bool { switch g { - case ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: + case ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers, ServerGroupGateways: return true default: return false @@ -255,6 +265,16 @@ func (g ServerGroup) IsArangosync() bool { } } +// IsGateway returns true when the group is a gateway group +func (g ServerGroup) IsGateway() bool { + switch g { + case ServerGroupGateways: + return true + default: + return false + } +} + // IsExportMetrics return true when the group can be used with the arangodbexporter func (g ServerGroup) IsExportMetrics() bool { switch g { @@ -280,6 +300,8 @@ func ServerGroupFromAbbreviatedRole(label string) ServerGroup { return ServerGroupSyncMasters case ServerGroupSyncWorkersAbbreviatedString: return ServerGroupSyncWorkers + case ServerGroupGatewaysAbbreviatedString: + return ServerGroupGateways case ServerGroupImageDiscoveryAbbreviatedString: return ServerGroupImageDiscovery default: @@ -287,7 +309,7 @@ func ServerGroupFromAbbreviatedRole(label string) ServerGroup { } } -// ServerGroupFromAbbreviatedRole returns ServerGroup from role +// ServerGroupFromRole returns ServerGroup from role func ServerGroupFromRole(label string) ServerGroup { switch label { case ServerGroupSingleString: @@ -302,6 +324,8 @@ func ServerGroupFromRole(label string) ServerGroup { return ServerGroupSyncMasters case ServerGroupSyncWorkersString: return ServerGroupSyncWorkers + case ServerGroupGatewaysString: + return ServerGroupGateways case ServerGroupImageDiscoveryString: return ServerGroupImageDiscovery default: diff --git a/pkg/apis/deployment/v1/server_group_spec_test.go b/pkg/apis/deployment/v1/server_group_spec_test.go index df285d998..e3ec3e3ce 100644 --- a/pkg/apis/deployment/v1/server_group_spec_test.go +++ b/pkg/apis/deployment/v1/server_group_spec_test.go @@ -46,6 +46,7 @@ func TestServerGroupSpecValidateCount(t *testing.T) { assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupGateways).New().Validate(ServerGroupGateways, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](2), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) @@ -112,6 +113,10 @@ func TestServerGroupSpecDefault(t *testing.T) { assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeActiveFailover).New().GetCount()) assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncWorkers, true, DeploymentModeCluster).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupGateways, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupGateways, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupGateways, true, DeploymentModeCluster).New().GetCount()) + for _, g := range AllServerGroups { assert.Equal(t, 0, len(def(ServerGroupSpec{}, g, true, DeploymentModeSingle).Args)) assert.Equal(t, "", def(ServerGroupSpec{}, g, true, DeploymentModeSingle).New().GetStorageClassName()) diff --git a/pkg/apis/deployment/v1/server_group_test.go b/pkg/apis/deployment/v1/server_group_test.go index ef2ddc8d9..d182c2399 100644 --- a/pkg/apis/deployment/v1/server_group_test.go +++ b/pkg/apis/deployment/v1/server_group_test.go @@ -33,6 +33,7 @@ func TestServerGroupAsRole(t *testing.T) { assert.Equal(t, "coordinator", ServerGroupCoordinators.AsRole()) assert.Equal(t, "syncmaster", ServerGroupSyncMasters.AsRole()) assert.Equal(t, "syncworker", ServerGroupSyncWorkers.AsRole()) + assert.Equal(t, "gateways", ServerGroupGateways.AsRole()) } func TestServerGroupAsRoleAbbreviated(t *testing.T) { @@ -42,6 +43,7 @@ func TestServerGroupAsRoleAbbreviated(t *testing.T) { assert.Equal(t, "crdn", ServerGroupCoordinators.AsRoleAbbreviated()) assert.Equal(t, "syma", ServerGroupSyncMasters.AsRoleAbbreviated()) assert.Equal(t, "sywo", ServerGroupSyncWorkers.AsRoleAbbreviated()) + assert.Equal(t, "gway", ServerGroupGateways.AsRoleAbbreviated()) } func TestServerGroupIsArangod(t *testing.T) { @@ -51,6 +53,7 @@ func TestServerGroupIsArangod(t *testing.T) { assert.True(t, ServerGroupCoordinators.IsArangod()) assert.False(t, ServerGroupSyncMasters.IsArangod()) assert.False(t, ServerGroupSyncWorkers.IsArangod()) + assert.False(t, ServerGroupGateways.IsArangod()) } func TestServerGroupIsArangosync(t *testing.T) { @@ -60,6 +63,7 @@ func TestServerGroupIsArangosync(t *testing.T) { assert.False(t, ServerGroupCoordinators.IsArangosync()) assert.True(t, ServerGroupSyncMasters.IsArangosync()) assert.True(t, ServerGroupSyncWorkers.IsArangosync()) + assert.False(t, ServerGroupGateways.IsArangosync()) } func TestServerGroupType(t *testing.T) { @@ -71,4 +75,6 @@ func TestServerGroupType(t *testing.T) { assert.Equal(t, ServerGroupTypeArangoD, ServerGroupCoordinators.Type()) assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncMasters.Type()) assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncWorkers.Type()) + assert.Equal(t, ServerGroupTypeGateway, ServerGroupGateways.Type()) + } diff --git a/pkg/apis/deployment/v1/server_group_type.go b/pkg/apis/deployment/v1/server_group_type.go index 1c3c24f5d..70ce15bc4 100644 --- a/pkg/apis/deployment/v1/server_group_type.go +++ b/pkg/apis/deployment/v1/server_group_type.go @@ -27,4 +27,5 @@ const ( ServerGroupTypeArangoD ServerGroupTypeArangoSync ServerGroupTypeID + ServerGroupTypeGateway ) diff --git a/pkg/apis/deployment/v1/zz_generated.deepcopy.go b/pkg/apis/deployment/v1/zz_generated.deepcopy.go index 2b9c00f0f..6b0d6bae1 100644 --- a/pkg/apis/deployment/v1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1/zz_generated.deepcopy.go @@ -1101,6 +1101,11 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { in.Coordinators.DeepCopyInto(&out.Coordinators) in.SyncMasters.DeepCopyInto(&out.SyncMasters) in.SyncWorkers.DeepCopyInto(&out.SyncWorkers) + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = new(ServerGroupSpec) + (*in).DeepCopyInto(*out) + } if in.MemberPropagationMode != nil { in, out := &in.MemberPropagationMode, &out.MemberPropagationMode *out = new(DeploymentMemberPropagationMode) @@ -1148,6 +1153,11 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { *out = new(string) **out = **in } + if in.Gateway != nil { + in, out := &in.Gateway, &out.Gateway + *out = new(DeploymentSpecGateway) + (*in).DeepCopyInto(*out) + } return } @@ -1161,6 +1171,27 @@ func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecGateway. +func (in *DeploymentSpecGateway) DeepCopy() *DeploymentSpecGateway { + if in == nil { + return nil + } + out := new(DeploymentSpecGateway) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = *in @@ -1291,6 +1322,11 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = new(ServerGroupStatus) (*in).DeepCopyInto(*out) } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = new(ServerGroupStatus) + (*in).DeepCopyInto(*out) + } return } @@ -1521,6 +1557,13 @@ func (in *DeploymentStatusMembers) DeepCopyInto(out *DeploymentStatusMembers) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = make(MemberStatusList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } diff --git a/pkg/apis/deployment/v2alpha1/deployment.go b/pkg/apis/deployment/v2alpha1/deployment.go index 11c4326ce..53472fcdd 100644 --- a/pkg/apis/deployment/v2alpha1/deployment.go +++ b/pkg/apis/deployment/v2alpha1/deployment.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ func (d *ArangoDeployment) AsOwner() meta.OwnerReference { // ForeachServerGroup calls the given callback for all server groups. // If the callback returns an error, this error is returned and no other server // groups are processed. -// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers +// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers, gateways func (d *ArangoDeployment) ForeachServerGroup(cb ServerGroupFunc, status *DeploymentStatus) error { if status == nil { status = &d.Status @@ -84,7 +84,7 @@ func (d *ArangoDeployment) ForeachServerGroup(cb ServerGroupFunc, status *Deploy // ForeachServerGroupAccepted calls the given callback for all accepted server groups. // If the callback returns an error, this error is returned and no other server // groups are processed. -// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers +// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers, gateways func (d *ArangoDeployment) ForeachServerGroupAccepted(cb ServerGroupFunc, status *DeploymentStatus) error { if status == nil { status = &d.Status @@ -115,6 +115,9 @@ func (d *ArangoDeployment) foreachServerGroup(cb ServerGroupFunc, spec Deploymen if err := cb(ServerGroupSyncWorkers, spec.SyncWorkers, &status.Members.SyncWorkers); err != nil { return errors.WithStack(err) } + if err := cb(ServerGroupGateways, spec.Gateways.Get(), &status.Members.Gateways); err != nil { + return errors.WithStack(err) + } return nil } diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec.go b/pkg/apis/deployment/v2alpha1/deployment_spec.go index 0f0192cb9..4e979fa22 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec.go @@ -199,6 +199,9 @@ type DeploymentSpec struct { // SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`. SyncWorkers ServerGroupSpec `json:"syncworkers"` + // Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. + Gateways *ServerGroupSpec `json:"gateways,omitempty"` + // MemberPropagationMode defines how changes to pod spec should be propogated. // Changes to a pod’s configuration require a restart of that pod in almost all cases. // Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator. @@ -256,6 +259,9 @@ type DeploymentSpec struct { // Timezone if specified, will set a timezone for deployment. // Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` Timezone *string `json:"timezone,omitempty"` + + // Gateway defined main Gateway configuration. + Gateway *DeploymentSpecGateway `json:"gateway,omitempty"` } // GetAllowMemberRecreation returns member recreation policy based on group and settings @@ -267,6 +273,8 @@ func (s *DeploymentSpec) GetAllowMemberRecreation(group ServerGroup) bool { groupSpec := s.GetServerGroupSpec(group) switch group { + case ServerGroupGateways: + return true case ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: if v := groupSpec.AllowMemberRecreation; v == nil { return true @@ -326,6 +334,11 @@ func (s DeploymentSpec) GetSyncImage() string { return s.GetImage() } +// IsGatewayEnabled returns true when the deployment has gateways enabled. +func (s DeploymentSpec) IsGatewayEnabled() bool { + return s.Gateway.IsEnabled() +} + // GetImagePullPolicy returns the value of imagePullPolicy. func (s DeploymentSpec) GetImagePullPolicy() core.PullPolicy { return util.TypeOrDefault[core.PullPolicy](s.ImagePullPolicy) @@ -364,8 +377,7 @@ func (s DeploymentSpec) IsSecure() bool { return s.TLS.IsSecure() } -// GetServerGroupSpec returns the server group spec (from this -// deployment spec) for the given group. +// GetServerGroupSpec returns the server group spec (from this deployment spec) for the given group. func (s DeploymentSpec) GetServerGroupSpec(group ServerGroup) ServerGroupSpec { switch group { case ServerGroupSingle: @@ -380,13 +392,14 @@ func (s DeploymentSpec) GetServerGroupSpec(group ServerGroup) ServerGroupSpec { return s.SyncMasters.WithGroup(group) case ServerGroupSyncWorkers: return s.SyncWorkers.WithGroup(group) + case ServerGroupGateways: + return s.Gateways.WithGroup(group) default: return ServerGroupSpec{} } } -// UpdateServerGroupSpec returns the server group spec (from this -// deployment spec) for the given group. +// UpdateServerGroupSpec returns the server group spec (from this deployment spec) for the given group. func (s *DeploymentSpec) UpdateServerGroupSpec(group ServerGroup, gspec ServerGroupSpec) { switch group { case ServerGroupSingle: @@ -401,6 +414,8 @@ func (s *DeploymentSpec) UpdateServerGroupSpec(group ServerGroup, gspec ServerGr s.SyncMasters = gspec case ServerGroupSyncWorkers: s.SyncWorkers = gspec + case ServerGroupGateways: + s.Gateways = gspec.DeepCopy() } } @@ -421,6 +436,11 @@ func (s *DeploymentSpec) SetDefaults(deploymentName string) { if s.GetImagePullPolicy() == "" { s.ImagePullPolicy = util.NewType[core.PullPolicy](core.PullIfNotPresent) } + if s.Gateway.IsEnabled() { + if s.Gateways == nil { + s.Gateways = &ServerGroupSpec{} + } + } s.ExternalAccess.SetDefaults() s.RocksDB.SetDefaults() s.Authentication.SetDefaults(deploymentName + "-jwt") @@ -432,6 +452,7 @@ func (s *DeploymentSpec) SetDefaults(deploymentName string) { s.Coordinators.SetDefaults(ServerGroupCoordinators, s.GetMode().HasCoordinators(), s.GetMode()) s.SyncMasters.SetDefaults(ServerGroupSyncMasters, s.Sync.IsEnabled(), s.GetMode()) s.SyncWorkers.SetDefaults(ServerGroupSyncWorkers, s.Sync.IsEnabled(), s.GetMode()) + s.Gateways.SetDefaults(ServerGroupGateways, s.IsGatewayEnabled(), s.GetMode()) s.Metrics.SetDefaults(deploymentName+"-exporter-jwt-token", s.Authentication.IsAuthenticated()) s.Chaos.SetDefaults() s.Bootstrap.SetDefaults(deploymentName) @@ -480,6 +501,7 @@ func (s *DeploymentSpec) SetDefaultsFrom(source DeploymentSpec) { s.Coordinators.SetDefaultsFrom(source.Coordinators) s.SyncMasters.SetDefaultsFrom(source.SyncMasters) s.SyncWorkers.SetDefaultsFrom(source.SyncWorkers) + s.Gateways.SetDefaultsFrom(source.Gateways.Get()) s.Metrics.SetDefaultsFrom(source.Metrics) s.Lifecycle.SetDefaultsFrom(source.Lifecycle) s.Chaos.SetDefaultsFrom(source.Chaos) @@ -539,6 +561,11 @@ func (s *DeploymentSpec) Validate() error { if err := s.SyncWorkers.Validate(ServerGroupSyncWorkers, s.Sync.IsEnabled(), s.GetMode(), s.GetEnvironment()); err != nil { return errors.WithStack(err) } + if s.IsGatewayEnabled() { + if err := s.Gateways.Validate(ServerGroupGateways, s.IsGatewayEnabled(), s.GetMode(), s.GetEnvironment()); err != nil { + return errors.WithStack(err) + } + } if err := s.Metrics.Validate(); err != nil { return errors.WithStack(errors.Wrap(err, "spec.metrics")) } @@ -554,6 +581,9 @@ func (s *DeploymentSpec) Validate() error { if err := s.Architecture.Validate(); err != nil { return errors.WithStack(errors.Wrap(err, "spec.architecture")) } + if err := s.Gateway.Validate(); err != nil { + return errors.WithStack(errors.Wrap(err, "spec.architecture")) + } return nil } @@ -614,6 +644,14 @@ func (s DeploymentSpec) ResetImmutableFields(target *DeploymentSpec) []string { if l := s.SyncWorkers.ResetImmutableFields(ServerGroupSyncWorkers, "syncworkers", &target.SyncWorkers); l != nil { resetFields = append(resetFields, l...) } + if s.Gateways != nil { + if target.Gateways == nil { + target.Gateways = &ServerGroupSpec{} + } + if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil { + resetFields = append(resetFields, l...) + } + } if l := s.Metrics.ResetImmutableFields("metrics", &target.Metrics); l != nil { resetFields = append(resetFields, l...) } diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go new file mode 100644 index 000000000..fba747bbf --- /dev/null +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go @@ -0,0 +1,37 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v2alpha1 + +type DeploymentSpecGateway struct { + Enabled *bool `json:"enabled,omitempty"` +} + +func (d *DeploymentSpecGateway) IsEnabled() bool { + if d == nil || d.Enabled == nil { + return false + } + + return *d.Enabled +} + +func (d *DeploymentSpecGateway) Validate() error { + return nil +} diff --git a/pkg/apis/deployment/v2alpha1/deployment_status.go b/pkg/apis/deployment/v2alpha1/deployment_status.go index a765df6ba..b348225f5 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_status.go +++ b/pkg/apis/deployment/v2alpha1/deployment_status.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -103,6 +103,7 @@ type DeploymentStatus struct { Coordinators *ServerGroupStatus `json:"coordinators,omitempty"` SyncMasters *ServerGroupStatus `json:"syncmasters,omitempty"` SyncWorkers *ServerGroupStatus `json:"syncworkers,omitempty"` + Gateways *ServerGroupStatus `json:"gateways,omitempty"` } // Equal checks for equality @@ -174,6 +175,8 @@ func (ds DeploymentStatus) getServerGroupStatus(group ServerGroup) *ServerGroupS return ds.SyncMasters.DeepCopy() case ServerGroupSyncWorkers: return ds.SyncWorkers.DeepCopy() + case ServerGroupGateways: + return ds.Gateways.DeepCopy() default: return nil } @@ -195,5 +198,7 @@ func (ds *DeploymentStatus) UpdateServerGroupStatus(group ServerGroup, gspec Ser ds.SyncMasters = &gspec case ServerGroupSyncWorkers: ds.SyncWorkers = &gspec + case ServerGroupGateways: + ds.Gateways = &gspec } } diff --git a/pkg/apis/deployment/v2alpha1/deployment_status_members.go b/pkg/apis/deployment/v2alpha1/deployment_status_members.go index 54518c4f6..acdedb3cf 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_status_members.go +++ b/pkg/apis/deployment/v2alpha1/deployment_status_members.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ type DeploymentStatusMembers struct { Coordinators MemberStatusList `json:"coordinators,omitempty"` SyncMasters MemberStatusList `json:"syncmasters,omitempty"` SyncWorkers MemberStatusList `json:"syncworkers,omitempty"` + Gateways MemberStatusList `json:"gateways,omitempty"` } // Equal checks for equality @@ -44,7 +45,8 @@ func (ds DeploymentStatusMembers) Equal(other DeploymentStatusMembers) bool { ds.DBServers.Equal(other.DBServers) && ds.Coordinators.Equal(other.Coordinators) && ds.SyncMasters.Equal(other.SyncMasters) && - ds.SyncWorkers.Equal(other.SyncWorkers) + ds.SyncWorkers.Equal(other.SyncWorkers) && + ds.Gateways.Equal(other.Gateways) } // ContainsID returns true if the given set of members contains a member with given ID. @@ -54,7 +56,8 @@ func (ds DeploymentStatusMembers) ContainsID(id string) bool { ds.DBServers.ContainsID(id) || ds.Coordinators.ContainsID(id) || ds.SyncMasters.ContainsID(id) || - ds.SyncWorkers.ContainsID(id) + ds.SyncWorkers.ContainsID(id) || + ds.Gateways.ContainsID(id) } // ElementByID returns the element in the given list that has the given ID and true. @@ -78,6 +81,9 @@ func (ds DeploymentStatusMembers) ElementByID(id string) (MemberStatus, ServerGr if result, found := ds.SyncWorkers.ElementByID(id); found { return result, ServerGroupSyncWorkers, true } + if result, found := ds.Gateways.ElementByID(id); found { + return result, ServerGroupGateways, true + } return MemberStatus{}, 0, false } @@ -129,6 +135,10 @@ func (ds DeploymentStatusMembers) ForServerGroup(cb MemberStatusFunc, group Serv if err := cb(ServerGroupSyncWorkers, ds.SyncWorkers); err != nil { return errors.WithStack(err) } + case ServerGroupGateways: + if err := cb(ServerGroupGateways, ds.Gateways); err != nil { + return errors.WithStack(err) + } } return nil } @@ -155,6 +165,9 @@ func (ds DeploymentStatusMembers) MemberStatusByPodName(podName string) (MemberS if result, found := ds.SyncWorkers.ElementByPodName(podName); found { return result, ServerGroupSyncWorkers, true } + if result, found := ds.Gateways.ElementByPodName(podName); found { + return result, ServerGroupGateways, true + } return MemberStatus{}, 0, false } @@ -190,6 +203,8 @@ func (ds *DeploymentStatusMembers) Add(status MemberStatus, group ServerGroup) e err = ds.SyncMasters.add(status) case ServerGroupSyncWorkers: err = ds.SyncWorkers.add(status) + case ServerGroupGateways: + err = ds.Gateways.add(status) default: return errors.WithStack(errors.Wrapf(NotFoundError, "ServerGroup %d is not known", group)) } @@ -215,6 +230,8 @@ func (ds *DeploymentStatusMembers) Update(status MemberStatus, group ServerGroup err = ds.SyncMasters.update(status) case ServerGroupSyncWorkers: err = ds.SyncWorkers.update(status) + case ServerGroupGateways: + err = ds.Gateways.update(status) default: return errors.WithStack(errors.Wrapf(NotFoundError, "ServerGroup %d is not known", group)) } @@ -241,6 +258,8 @@ func (ds *DeploymentStatusMembers) RemoveByID(id string, group ServerGroup) erro err = ds.SyncMasters.removeByID(id) case ServerGroupSyncWorkers: err = ds.SyncWorkers.removeByID(id) + case ServerGroupGateways: + err = ds.Gateways.removeByID(id) default: return errors.WithStack(errors.Wrapf(NotFoundError, "ServerGroup %d is not known", group)) } @@ -250,23 +269,30 @@ func (ds *DeploymentStatusMembers) RemoveByID(id string, group ServerGroup) erro return nil } -// AllMembersReady returns true when all members, that must be ready for the given mode, are in the Ready state. -func (ds DeploymentStatusMembers) AllMembersReady(mode DeploymentMode, syncEnabled bool) bool { +// AllMembersReady returns true when all members, that must be ready for the given mode are in the Ready state. +func (ds DeploymentStatusMembers) AllMembersReady(mode DeploymentMode, syncEnabled, gatewayEnabled bool) bool { syncReady := func() bool { if syncEnabled { return ds.SyncMasters.AllMembersReady() && ds.SyncWorkers.AllMembersReady() } return true } + gatewayReady := func() bool { + if gatewayEnabled { + return ds.Gateways.AllMembersReady() + } + return true + } switch mode { case DeploymentModeSingle: - return ds.Single.MembersReady() > 0 + return ds.Single.MembersReady() > 0 && gatewayReady() case DeploymentModeActiveFailover: return ds.Agents.AllMembersReady() && ds.Single.MembersReady() > 0 case DeploymentModeCluster: return ds.Agents.AllMembersReady() && ds.DBServers.AllMembersReady() && ds.Coordinators.AllMembersReady() && + gatewayReady() && syncReady() default: return false @@ -288,6 +314,8 @@ func (ds DeploymentStatusMembers) MembersOfGroup(group ServerGroup) MemberStatus return ds.SyncMasters case ServerGroupSyncWorkers: return ds.SyncWorkers + case ServerGroupGateways: + return ds.Gateways default: return MemberStatusList{} } diff --git a/pkg/apis/deployment/v2alpha1/deployment_status_members_test.go b/pkg/apis/deployment/v2alpha1/deployment_status_members_test.go index 64237784a..723ef50f0 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_status_members_test.go +++ b/pkg/apis/deployment/v2alpha1/deployment_status_members_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ func newMemberList() DeploymentStatusMembers { Coordinators: MemberStatusList{{ID: ServerGroupCoordinators.AsRole()}}, SyncMasters: MemberStatusList{{ID: ServerGroupSyncMasters.AsRole()}}, SyncWorkers: MemberStatusList{{ID: ServerGroupSyncWorkers.AsRole()}}, + Gateways: MemberStatusList{{ID: ServerGroupGateways.AsRole()}}, } } diff --git a/pkg/apis/deployment/v2alpha1/server_group.go b/pkg/apis/deployment/v2alpha1/server_group.go index bc3c2be6c..1de521e7e 100644 --- a/pkg/apis/deployment/v2alpha1/server_group.go +++ b/pkg/apis/deployment/v2alpha1/server_group.go @@ -84,6 +84,7 @@ const ( ServerGroupCoordinators ServerGroup = 4 ServerGroupSyncMasters ServerGroup = 5 ServerGroupSyncWorkers ServerGroup = 6 + ServerGroupGateways ServerGroup = 7 ServerGroupImageDiscovery ServerGroup = -1 ServerGroupSingleString = "single" @@ -92,6 +93,7 @@ const ( ServerGroupCoordinatorsString = "coordinator" ServerGroupSyncMastersString = "syncmaster" ServerGroupSyncWorkersString = "syncworker" + ServerGroupGatewaysString = "gateways" ServerGroupImageDiscoveryString = "id" ServerGroupSingleAbbreviatedString = "sngl" @@ -100,6 +102,7 @@ const ( ServerGroupCoordinatorsAbbreviatedString = "crdn" ServerGroupSyncMastersAbbreviatedString = "syma" ServerGroupSyncWorkersAbbreviatedString = "sywo" + ServerGroupGatewaysAbbreviatedString = "gway" ServerGroupImageDiscoveryAbbreviatedString = "id" ) @@ -112,6 +115,7 @@ var ( ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers, + ServerGroupGateways, } // AllArangoDServerGroups contains a constant list of all ArangoD server groups AllArangoDServerGroups = []ServerGroup{ @@ -131,6 +135,8 @@ func (g ServerGroup) Type() ServerGroupType { return ServerGroupTypeID case ServerGroupSyncMasters, ServerGroupSyncWorkers: return ServerGroupTypeArangoSync + case ServerGroupGateways: + return ServerGroupTypeGateway default: return ServerGroupTypeUnknown } @@ -151,6 +157,8 @@ func (g ServerGroup) AsRole() string { return ServerGroupSyncMastersString case ServerGroupSyncWorkers: return ServerGroupSyncWorkersString + case ServerGroupGateways: + return ServerGroupGatewaysString case ServerGroupImageDiscovery: return ServerGroupImageDiscoveryString default: @@ -163,14 +171,14 @@ func (g ServerGroup) Enabled(mode DeploymentMode) bool { switch mode { case DeploymentModeSingle: switch g { - case ServerGroupSingle: + case ServerGroupSingle, ServerGroupGateways: return true default: return false } case DeploymentModeCluster: switch g { - case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: + case ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers, ServerGroupGateways: return true default: return false @@ -202,6 +210,8 @@ func (g ServerGroup) AsRoleAbbreviated() string { return ServerGroupSyncMastersAbbreviatedString case ServerGroupSyncWorkers: return ServerGroupSyncWorkersAbbreviatedString + case ServerGroupGateways: + return ServerGroupGatewaysAbbreviatedString case ServerGroupImageDiscovery: return ServerGroupImageDiscoveryAbbreviatedString default: @@ -228,7 +238,7 @@ func (g ServerGroup) DefaultTerminationGracePeriod() time.Duration { // IsStateless returns true when the groups runs servers without a persistent volume. func (g ServerGroup) IsStateless() bool { switch g { - case ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers: + case ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers, ServerGroupGateways: return true default: return false @@ -255,6 +265,16 @@ func (g ServerGroup) IsArangosync() bool { } } +// IsGateway returns true when the group is a gateway group +func (g ServerGroup) IsGateway() bool { + switch g { + case ServerGroupGateways: + return true + default: + return false + } +} + // IsExportMetrics return true when the group can be used with the arangodbexporter func (g ServerGroup) IsExportMetrics() bool { switch g { @@ -280,6 +300,8 @@ func ServerGroupFromAbbreviatedRole(label string) ServerGroup { return ServerGroupSyncMasters case ServerGroupSyncWorkersAbbreviatedString: return ServerGroupSyncWorkers + case ServerGroupGatewaysAbbreviatedString: + return ServerGroupGateways case ServerGroupImageDiscoveryAbbreviatedString: return ServerGroupImageDiscovery default: @@ -287,7 +309,7 @@ func ServerGroupFromAbbreviatedRole(label string) ServerGroup { } } -// ServerGroupFromAbbreviatedRole returns ServerGroup from role +// ServerGroupFromRole returns ServerGroup from role func ServerGroupFromRole(label string) ServerGroup { switch label { case ServerGroupSingleString: @@ -302,6 +324,8 @@ func ServerGroupFromRole(label string) ServerGroup { return ServerGroupSyncMasters case ServerGroupSyncWorkersString: return ServerGroupSyncWorkers + case ServerGroupGatewaysString: + return ServerGroupGateways case ServerGroupImageDiscoveryString: return ServerGroupImageDiscovery default: diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec_test.go b/pkg/apis/deployment/v2alpha1/server_group_spec_test.go index 6383cef37..446db456e 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/server_group_spec_test.go @@ -46,6 +46,7 @@ func TestServerGroupSpecValidateCount(t *testing.T) { assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncMasters).New().Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupSyncWorkers).New().Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2)}.New().WithGroup(ServerGroupGateways).New().Validate(ServerGroupGateways, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](2), MinCount: util.NewType[int](2), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewType[int](1), MaxCount: util.NewType[int](5)}.New().WithGroup(ServerGroupCoordinators).New().Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) @@ -112,6 +113,10 @@ func TestServerGroupSpecDefault(t *testing.T) { assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeActiveFailover).New().GetCount()) assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncWorkers, true, DeploymentModeCluster).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupGateways, false, DeploymentModeSingle).New().GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupGateways, false, DeploymentModeActiveFailover).New().GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupGateways, true, DeploymentModeCluster).New().GetCount()) + for _, g := range AllServerGroups { assert.Equal(t, 0, len(def(ServerGroupSpec{}, g, true, DeploymentModeSingle).Args)) assert.Equal(t, "", def(ServerGroupSpec{}, g, true, DeploymentModeSingle).New().GetStorageClassName()) diff --git a/pkg/apis/deployment/v2alpha1/server_group_test.go b/pkg/apis/deployment/v2alpha1/server_group_test.go index 03eae5314..c9bb251e0 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_test.go +++ b/pkg/apis/deployment/v2alpha1/server_group_test.go @@ -33,6 +33,7 @@ func TestServerGroupAsRole(t *testing.T) { assert.Equal(t, "coordinator", ServerGroupCoordinators.AsRole()) assert.Equal(t, "syncmaster", ServerGroupSyncMasters.AsRole()) assert.Equal(t, "syncworker", ServerGroupSyncWorkers.AsRole()) + assert.Equal(t, "gateways", ServerGroupGateways.AsRole()) } func TestServerGroupAsRoleAbbreviated(t *testing.T) { @@ -42,6 +43,7 @@ func TestServerGroupAsRoleAbbreviated(t *testing.T) { assert.Equal(t, "crdn", ServerGroupCoordinators.AsRoleAbbreviated()) assert.Equal(t, "syma", ServerGroupSyncMasters.AsRoleAbbreviated()) assert.Equal(t, "sywo", ServerGroupSyncWorkers.AsRoleAbbreviated()) + assert.Equal(t, "gway", ServerGroupGateways.AsRoleAbbreviated()) } func TestServerGroupIsArangod(t *testing.T) { @@ -51,6 +53,7 @@ func TestServerGroupIsArangod(t *testing.T) { assert.True(t, ServerGroupCoordinators.IsArangod()) assert.False(t, ServerGroupSyncMasters.IsArangod()) assert.False(t, ServerGroupSyncWorkers.IsArangod()) + assert.False(t, ServerGroupGateways.IsArangod()) } func TestServerGroupIsArangosync(t *testing.T) { @@ -60,6 +63,7 @@ func TestServerGroupIsArangosync(t *testing.T) { assert.False(t, ServerGroupCoordinators.IsArangosync()) assert.True(t, ServerGroupSyncMasters.IsArangosync()) assert.True(t, ServerGroupSyncWorkers.IsArangosync()) + assert.False(t, ServerGroupGateways.IsArangosync()) } func TestServerGroupType(t *testing.T) { @@ -71,4 +75,6 @@ func TestServerGroupType(t *testing.T) { assert.Equal(t, ServerGroupTypeArangoD, ServerGroupCoordinators.Type()) assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncMasters.Type()) assert.Equal(t, ServerGroupTypeArangoSync, ServerGroupSyncWorkers.Type()) + assert.Equal(t, ServerGroupTypeGateway, ServerGroupGateways.Type()) + } diff --git a/pkg/apis/deployment/v2alpha1/server_group_type.go b/pkg/apis/deployment/v2alpha1/server_group_type.go index 4b7c6c559..22088eab4 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_type.go +++ b/pkg/apis/deployment/v2alpha1/server_group_type.go @@ -27,4 +27,5 @@ const ( ServerGroupTypeArangoD ServerGroupTypeArangoSync ServerGroupTypeID + ServerGroupTypeGateway ) diff --git a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go index d68e718fe..1e7d72901 100644 --- a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go @@ -1101,6 +1101,11 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { in.Coordinators.DeepCopyInto(&out.Coordinators) in.SyncMasters.DeepCopyInto(&out.SyncMasters) in.SyncWorkers.DeepCopyInto(&out.SyncWorkers) + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = new(ServerGroupSpec) + (*in).DeepCopyInto(*out) + } if in.MemberPropagationMode != nil { in, out := &in.MemberPropagationMode, &out.MemberPropagationMode *out = new(DeploymentMemberPropagationMode) @@ -1148,6 +1153,11 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { *out = new(string) **out = **in } + if in.Gateway != nil { + in, out := &in.Gateway, &out.Gateway + *out = new(DeploymentSpecGateway) + (*in).DeepCopyInto(*out) + } return } @@ -1161,6 +1171,27 @@ func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecGateway. +func (in *DeploymentSpecGateway) DeepCopy() *DeploymentSpecGateway { + if in == nil { + return nil + } + out := new(DeploymentSpecGateway) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = *in @@ -1291,6 +1322,11 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = new(ServerGroupStatus) (*in).DeepCopyInto(*out) } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = new(ServerGroupStatus) + (*in).DeepCopyInto(*out) + } return } @@ -1521,6 +1557,13 @@ func (in *DeploymentStatusMembers) DeepCopyInto(out *DeploymentStatusMembers) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = make(MemberStatusList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } diff --git a/pkg/crd/crds/database-deployment.schema.generated.yaml b/pkg/crd/crds/database-deployment.schema.generated.yaml index c5fa1403a..609150ca6 100644 --- a/pkg/crd/crds/database-deployment.schema.generated.yaml +++ b/pkg/crd/crds/database-deployment.schema.generated.yaml @@ -6564,8 +6564,14 @@ v1: foxx.queues: type: boolean type: object - id: - description: ServerIDGroupSpec contains the specification for Image Discovery image. + gateway: + description: Gateway defined main Gateway configuration. + properties: + enabled: + type: boolean + type: object + gateways: + description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. properties: affinity: description: Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -6695,6 +6701,28 @@ v1: type: object type: array type: object + allowMemberRecreation: + description: |- + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: + additionalProperties: + type: string + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. + type: object + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations + type: string antiAffinity: description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions properties: @@ -6828,123 +6856,3725 @@ v1: items: type: string type: array + count: + description: |- + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. + format: int32 + type: integer entrypoint: description: Entrypoint overrides container executable type: string - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + envs: + description: Envs allow to specify additional envs in this group. + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. properties: - preferredDuringSchedulingIgnoredDuringExecution: + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume + type: string + type: object + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume + type: string + type: object + type: object + exporterPort: + description: ExporterPort define Port used by exporter + format: int32 + type: integer + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered + type: string + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers items: properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchFields: - items: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object type: object - type: array - type: object - weight: - format: int32 - type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - key: - type: string - operator: + name: type: string - values: - items: - type: string - type: array + optional: + type: boolean type: object - type: array - matchFields: - items: + prefix: + type: string + secretRef: properties: - key: - type: string - operator: + name: type: string - values: - items: - type: string - type: array + optional: + type: boolean type: object - type: array - type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector specifies a set of selectors for nodes - type: object - priorityClassName: - description: PriorityClassName specifies a priority class name - type: string - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: - properties: - name: + type: object + type: array + image: type: string - type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - securityContext: - description: SecurityContext specifies security context for group - properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers - items: - type: string - type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + mode: + description: Mode keep container replace mode + type: string + type: object + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + type: string + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + format: int32 + type: integer + memoryReservation: + description: |- + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: + type: string + type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string + type: object + overrideDetectedNumberOfCores: + description: |- + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. + type: boolean + overrideDetectedTotalMemory: + description: |- + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level + properties: + network: + type: string + pid: + type: string + type: object + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. + type: string + probes: + description: Probes specifies additional behaviour for probes + properties: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + type: object + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group + type: string + securityContext: + description: |- + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. + properties: + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object + type: object + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + format: int32 + type: integer + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator + type: string + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + items: + type: string + type: array + sidecars: + description: Sidecars specifies a list of additional containers to be started + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + type: object + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + type: object + type: array + type: object + id: + description: ServerIDGroupSpec contains the specification for Image Discovery image. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + entrypoint: + description: Entrypoint overrides container executable + type: string + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector specifies a set of selectors for nodes + type: object + priorityClassName: + description: PriorityClassName specifies a priority class name + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + securityContext: + description: SecurityContext specifies security context for group + properties: + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object + type: object + serviceAccountName: + description: ServiceAccountName specifies the name of the service account used for Pods in this group. + type: string + tolerations: + description: Tolerations specifies the tolerations added to Pods in this group. + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + type: object + image: + description: |- + Image specifies the docker image to use for all ArangoDB servers. + In a development environment this setting defaults to arangodb/arangodb:latest. + For production environments this is a required setting without a default value. + It is highly recommend to use explicit version (not latest) for production environments. + type: string + imageDiscoveryMode: + description: ImageDiscoveryMode specifies the image discovery mode. + enum: + - kubelet + - direct + type: string + imagePullPolicy: + description: ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers. + enum: + - Always + - Never + - IfNotPresent + type: string + imagePullSecrets: + description: ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers. + items: + type: string + type: array + labels: + additionalProperties: + type: string + description: Labels specifies the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + enum: + - disabled + - append + - replace + type: string + license: + description: License holds license settings + properties: + secretName: + description: |- + SecretName setting specifies the name of a kubernetes `Secret` that contains + the license key token used for enterprise images. This value is not used for + the Community Edition. + type: string + type: object + lifecycle: + description: Lifecycle holds lifecycle configuration settings + properties: + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + type: object + memberPropagationMode: + description: |- + MemberPropagationMode defines how changes to pod spec should be propogated. + Changes to a pod’s configuration require a restart of that pod in almost all cases. + Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator. + The propagation of the configuration changes can be deferred to the next restart, either triggered manually by the user or by another operation like an upgrade. + This reduces the number of restarts for upgrading both the server and the operator from two to one. + enum: + - always + - on-restart + type: string + metrics: + description: Metrics holds metrics configuration settings + properties: + authentication: + properties: + jwtTokenSecretName: + description: JWTTokenSecretName contains the name of the JWT kubernetes secret used for authentication + type: string + type: object + enabled: + description: |- + Enabled if this is set to `true`, the operator runs a sidecar container for + every Agent, DB-Server, Coordinator and Single server. + type: boolean + extensions: + description: Extensions keeps the information about Metrics Extensions + properties: + usageMetrics: + description: UsageMetrics enables ArangoDB Usage metrics scrape. Affects only DBServers in the Cluster mode. + type: boolean + type: object + image: + description: Image used for the Metrics Sidecar + type: string + mode: + description: Mode define metrics exported mode + type: string + port: + format: int32 + type: integer + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + serviceMonitor: + properties: + enabled: + type: boolean + labels: + additionalProperties: + type: string + type: object + type: object + tls: + description: |- + TLS defines if TLS should be enabled on Metrics exporter endpoint. + This option will enable TLS only if TLS is enabled on ArangoDeployment, + otherwise `true` value will not take any effect. + type: boolean + type: object + mode: + description: Mode specifies the type of ArangoDB deployment to create. + enum: + - Cluster + - ActiveFailover + - Single + type: string + networkAttachedVolumes: + description: |- + NetworkAttachedVolumes + If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation). + Furthermore, the pod will simply be redeployed on a different node, rather than cleaned and retired and replaced by a new member. + You must only set this option to true if your persistent volumes are “movable” in the sense that they can be mounted from a different k8s node, like in the case of network attached volumes. + If your persistent volumes are tied to a specific pod, you must leave this option on false. + type: boolean + rebalancer: + description: Rebalancer defines the rebalancer specification + properties: + enabled: + type: boolean + optimizers: + properties: + leader: + type: boolean + type: object + parallelMoves: + format: int32 + type: integer + readers: + properties: + count: + description: Count Enable Shard Count machanism + type: boolean + type: object + type: object + recovery: + description: Recovery specifies configuration related to cluster recovery. + properties: + autoRecover: + type: boolean + type: object + restoreEncryptionSecret: + description: RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore + type: string + restoreFrom: + description: |- + RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from. + After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key. + It will contain some of the following fields: + - `requestedFrom`: name of the ArangoBackup used to restore from. + - `message`: optional message explaining why the restore failed. + - `state`: state indicating if the restore was successful or not. Possible values: Restoring, Restored, RestoreFailed + If the restoreFrom key is removed from the spec, the restore key is deleted as well. + A new restore attempt is made if and only if either in the status restore is not set or if spec.restoreFrom and status.requestedFrom are different. + type: string + rocksdb: + description: RocksDB holds rocksdb-specific configuration settings + properties: + encryption: + properties: + keySecretName: + description: |- + KeySecretName setting specifies the name of a Kubernetes `Secret` that contains an encryption key used for encrypting all data stored by ArangoDB servers. + When an encryption key is used, encryption of the data in the cluster is enabled, without it encryption is disabled. + The default value is empty. + This requires the Enterprise Edition. + The encryption key cannot be changed after the cluster has been created. + The secret specified by this setting, must have a data field named 'key' containing an encryption key that is exactly 32 bytes long. + type: string + type: object + type: object + single: + description: Single contains specification for servers running in deployment mode `Single` or `ActiveFailover`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + allowMemberRecreation: + description: |- + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: + additionalProperties: + type: string + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. + type: object + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations + type: string + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: + description: |- + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. + format: int32 + type: integer + entrypoint: + description: Entrypoint overrides container executable + type: string + envs: + description: Envs allow to specify additional envs in this group. + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. + properties: + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume + type: string + type: object + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume + type: string + type: object + type: object + exporterPort: + description: ExporterPort define Port used by exporter + format: int32 + type: integer + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered + type: string + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + mode: + description: Mode keep container replace mode + type: string + type: object + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + type: string + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + format: int32 + type: integer + memoryReservation: + description: |- + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: + type: string + type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string + type: object + overrideDetectedNumberOfCores: + description: |- + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. + type: boolean + overrideDetectedTotalMemory: + description: |- + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level + properties: + network: + type: string + pid: + type: string + type: object + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. + type: string + probes: + description: Probes specifies additional behaviour for probes + properties: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + type: object + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group + type: string + securityContext: + description: |- + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. + properties: + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers type: boolean fsGroup: @@ -6953,369 +10583,2027 @@ v1: type: integer privileged: description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object + type: object + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + format: int32 + type: integer + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator + type: string + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + items: + type: string + type: array + sidecars: + description: Sidecars specifies a list of additional containers to be started + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + type: object + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + type: object + type: array + type: object + storageEngine: + description: StorageEngine specifies the type of storage engine used for all servers in the cluster. + enum: + - RocksDB + - MMFiles + type: string + sync: + description: Sync holds Deployment-to-Deployment synchronization configuration settings + properties: + auth: + properties: + clientCASecretName: + description: |- + ClientCASecretName setting specifies the name of a kubernetes `Secret` that contains + a PEM encoded CA certificate used for client certificate verification + in all ArangoSync master servers. + This is a required setting when `spec.sync.enabled` is `true`. + type: string + jwtSecretName: + description: |- + JWTSecretName setting specifies the name of a kubernetes `Secret` that contains + the JWT token used for accessing all ArangoSync master servers. + When not specified, the `spec.auth.jwtSecretName` value is used. + If you specify a name of a `Secret` that does not exist, a random token is created + and stored in a `Secret` with given name. + type: string + type: object + enabled: + description: |- + Enabled setting enables/disables support for data center 2 data center + replication in the cluster. When enabled, the cluster will contain + a number of `syncmaster` & `syncworker` servers. + type: boolean + externalAccess: + properties: + accessPackageSecretNames: + description: |- + AccessPackageSecretNames setting specifies the names of zero of more `Secrets` that will be created by the deployment + operator containing "access packages". An access package contains those `Secrets` that are needed + to access the SyncMasters of this `ArangoDeployment`. + By removing a name from this setting, the corresponding `Secret` is also deleted. + Note that to remove all access packages, leave an empty array in place (`[]`). + Completely removing the setting results in not modifying the list. + items: + type: string + type: array + advertisedEndpoint: + description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint + type: string + loadBalancerIP: + description: |- + LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. + If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. + type: string + loadBalancerSourceRanges: + description: |- + LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type + If specified and supported by the platform, this will restrict traffic through the cloud-provider + load-balancer will be restricted to the specified client IPs. This field will be ignored if the + cloud-provider does not support the feature. + items: + type: string + type: array + managedServiceNames: + description: |- + ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. + It is only relevant when type of service is `managed`. + items: + type: string + type: array + masterEndpoint: + description: |- + MasterEndpoint setting specifies the master endpoint(s) advertised by the ArangoSync SyncMasters. + If not set, this setting defaults to: + - If `spec.sync.externalAccess.loadBalancerIP` is set, it defaults to `https://:<8629>`. + - Otherwise it defaults to `https://:<8629>`. + items: + type: string + type: array + nodePort: + description: |- + NodePort define optional port used in case of Auto or NodePort type. + This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. + If you do not specify this setting, a random port will be chosen automatically. + format: int32 type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + type: + description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. + enum: + - Auto + - None + - LoadBalancer + - NodePort + type: string + type: object + image: + type: string + monitoring: + properties: + tokenSecretName: + description: |- + TokenSecretName setting specifies the name of a kubernetes `Secret` that contains + the bearer token used for accessing all monitoring endpoints of all arangod/arangosync servers. + When not specified, no monitoring token is used. + type: string + type: object + tls: + properties: + altNames: + description: |- + AltNames setting specifies a list of alternate names that will be added to all generated + certificates. These names can be DNS names or email addresses. + The default value is empty. + items: + type: string + type: array + caSecretName: + description: |- + CASecretName setting specifies the name of a kubernetes `Secret` that contains + a standard CA certificate + private key used to sign certificates for individual + ArangoDB servers. + When no name is specified, it defaults to `-ca`. + To disable authentication, set this value to `None`. + If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created + and stored in a `Secret` with given name. + The specified `Secret`, must contain the following data fields: + - `ca.crt` PEM encoded public key of the CA certificate + - `ca.key` PEM encoded private key of the CA certificate + type: string + mode: + type: string + sni: properties: - localhostProfile: - type: string - type: - type: string + mapping: + additionalProperties: + items: + type: string + type: array + type: object type: object - supplementalGroups: + ttl: description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + TTL setting specifies the time to live of all generated server certificates. + When the server certificate is about to expire, it will be automatically replaced + by a new one and the affected server will be restarted. + Note: The time to live of the CA certificate (when created automatically) + will be set to 10 years. + type: string + type: object + type: object + syncmasters: + description: SyncMasters contains specification for Syncmaster pods running in deployment mode `Cluster`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + allowMemberRecreation: + description: |- + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: + additionalProperties: + type: string + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. + type: object + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations + type: string + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: items: - format: int64 - type: integer + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object type: object - serviceAccountName: - description: ServiceAccountName specifies the name of the service account used for Pods in this group. + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: + description: |- + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. + format: int32 + type: integer + entrypoint: + description: Entrypoint overrides container executable type: string - tolerations: - description: Tolerations specifies the tolerations added to Pods in this group. + envs: + description: Envs allow to specify additional envs in this group. items: properties: - effect: - type: string - key: - type: string - operator: + name: type: string - tolerationSeconds: - format: int64 - type: integer value: type: string type: object type: array - type: object - image: - description: |- - Image specifies the docker image to use for all ArangoDB servers. - In a development environment this setting defaults to arangodb/arangodb:latest. - For production environments this is a required setting without a default value. - It is highly recommend to use explicit version (not latest) for production environments. - type: string - imageDiscoveryMode: - description: ImageDiscoveryMode specifies the image discovery mode. - enum: - - kubelet - - direct - type: string - imagePullPolicy: - description: ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers. - enum: - - Always - - Never - - IfNotPresent - type: string - imagePullSecrets: - description: ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers. - items: - type: string - type: array - labels: - additionalProperties: - type: string - description: Labels specifies the labels added to Pods in this group. - type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored - items: - type: string - type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels - enum: - - disabled - - append - - replace - type: string - license: - description: License holds license settings - properties: - secretName: - description: |- - SecretName setting specifies the name of a kubernetes `Secret` that contains - the license key token used for enterprise images. This value is not used for - the Community Edition. - type: string - type: object - lifecycle: - description: Lifecycle holds lifecycle configuration settings - properties: - resources: - description: Resources holds resource requests & limits + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. + properties: + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume + type: string + type: object + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume + type: string + type: object + type: object + exporterPort: + description: ExporterPort define Port used by exporter + format: int32 + type: integer + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered + type: string + initContainers: + description: InitContainers Init containers specification properties: - claims: + containers: + description: Containers contains list of containers items: properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object name: type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - type: object - memberPropagationMode: - description: |- - MemberPropagationMode defines how changes to pod spec should be propogated. - Changes to a pod’s configuration require a restart of that pod in almost all cases. - Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator. - The propagation of the configuration changes can be deferred to the next restart, either triggered manually by the user or by another operation like an upgrade. - This reduces the number of restarts for upgrading both the server and the operator from two to one. - enum: - - always - - on-restart - type: string - metrics: - description: Metrics holds metrics configuration settings - properties: - authentication: - properties: - jwtTokenSecretName: - description: JWTTokenSecretName contains the name of the JWT kubernetes secret used for authentication + mode: + description: Mode keep container replace mode type: string type: object - enabled: - description: |- - Enabled if this is set to `true`, the operator runs a sidecar container for - every Agent, DB-Server, Coordinator and Single server. - type: boolean - extensions: - description: Extensions keeps the information about Metrics Extensions - properties: - usageMetrics: - description: UsageMetrics enables ArangoDB Usage metrics scrape. Affects only DBServers in the Cluster mode. - type: boolean - type: object - image: - description: Image used for the Metrics Sidecar + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members type: string - mode: - description: Mode define metrics exported mode + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels type: string - port: + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. format: int32 type: integer - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - serviceMonitor: - properties: - enabled: - type: boolean - labels: - additionalProperties: - type: string - type: object - type: object - tls: + memoryReservation: description: |- - TLS defines if TLS should be enabled on Metrics exporter endpoint. - This option will enable TLS only if TLS is enabled on ArangoDeployment, - otherwise `true` value will not take any effect. - type: boolean - type: object - mode: - description: Mode specifies the type of ArangoDB deployment to create. - enum: - - Cluster - - ActiveFailover - - Single - type: string - networkAttachedVolumes: - description: |- - NetworkAttachedVolumes - If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation). - Furthermore, the pod will simply be redeployed on a different node, rather than cleaned and retired and replaced by a new member. - You must only set this option to true if your persistent volumes are “movable” in the sense that they can be mounted from a different k8s node, like in the case of network attached volumes. - If your persistent volumes are tied to a specific pod, you must leave this option on false. - type: boolean - rebalancer: - description: Rebalancer defines the rebalancer specification - properties: - enabled: - type: boolean - optimizers: - properties: - leader: - type: boolean - type: object - parallelMoves: + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. format: int32 type: integer - readers: - properties: - count: - description: Count Enable Shard Count machanism - type: boolean - type: object - type: object - recovery: - description: Recovery specifies configuration related to cluster recovery. - properties: - autoRecover: - type: boolean - type: object - restoreEncryptionSecret: - description: RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore - type: string - restoreFrom: - description: |- - RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from. - After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key. - It will contain some of the following fields: - - `requestedFrom`: name of the ArangoBackup used to restore from. - - `message`: optional message explaining why the restore failed. - - `state`: state indicating if the restore was successful or not. Possible values: Restoring, Restored, RestoreFailed - If the restoreFrom key is removed from the spec, the restore key is deleted as well. - A new restore attempt is made if and only if either in the status restore is not set or if spec.restoreFrom and status.requestedFrom are different. - type: string - rocksdb: - description: RocksDB holds rocksdb-specific configuration settings - properties: - encryption: - properties: - keySecretName: - description: |- - KeySecretName setting specifies the name of a Kubernetes `Secret` that contains an encryption key used for encrypting all data stored by ArangoDB servers. - When an encryption key is used, encryption of the data in the cluster is enabled, without it encryption is disabled. - The default value is empty. - This requires the Enterprise Edition. - The encryption key cannot be changed after the cluster has been created. - The secret specified by this setting, must have a data field named 'key' containing an encryption key that is exactly 32 bytes long. - type: string - type: object - type: object - single: - description: Single contains specification for servers running in deployment mode `Single` or `ActiveFailover`. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: - podAffinityTerm: + preference: properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: + matchExpressions: items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: + properties: + key: type: string - type: object - type: object - namespaces: + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - topologyKey: - type: string type: object weight: format: int32 @@ -7323,9 +12611,9 @@ v1: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + properties: + nodeSelectorTerms: + items: properties: matchExpressions: items: @@ -7340,22 +12628,7 @@ v1: type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: + matchFields: items: properties: key: @@ -7368,496 +12641,394 @@ v1: type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: + type: string type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string type: object - allowMemberRecreation: + overrideDetectedNumberOfCores: description: |- - AllowMemberRecreation allows to recreate member. - This setting changes the member recreation logic based on group: - - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) - - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. type: boolean - annotations: - additionalProperties: - type: string + overrideDetectedTotalMemory: description: |- - Annotations specified the annotations added to Pods in this group. - Annotations are merged with `spec.annotations`. + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level + properties: + network: + type: string + pid: + type: string type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode Define annotations mode which should be use while overriding annotations + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. type: string - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + probes: + description: Probes specifies additional behaviour for probes properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - weight: - format: int32 - type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + type: object + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: items: properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: + name: type: string type: object type: array - type: object - args: - description: Args setting specifies additional command-line arguments passed to all servers of this group. - items: - type: string - type: array - count: - description: |- - Count setting specifies the number of servers to start for the given group. - For the Agent group, this value must be a positive, odd number. - The default value is `3` for all groups except `single` (there the default is `1` - for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). - For the `syncworkers` group, it is highly recommended to use the same number - as for the `dbservers` group. - format: int32 - type: integer - entrypoint: - description: Entrypoint overrides container executable - type: string - envs: - description: Envs allow to specify additional envs in this group. - items: - properties: - name: + limits: + additionalProperties: type: string - value: + type: object + requests: + additionalProperties: type: string - type: object - type: array - ephemeralVolumes: - description: EphemeralVolumes keeps information about ephemeral volumes. + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group + type: string + securityContext: + description: |- + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. properties: - apps: - description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container properties: - size: - description: Size define size of the ephemeral volume + level: + type: string + role: + type: string + type: + type: string + user: type: string type: object - temp: - description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. properties: - size: - description: Size define size of the ephemeral volume + localhostProfile: + type: string + type: type: string type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object type: object - exporterPort: - description: ExporterPort define Port used by exporter + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown format: int32 type: integer - extendedRotationCheck: - description: ExtendedRotationCheck extend checks for rotation - type: boolean - externalPortEnabled: - description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members - type: boolean - indexMethod: - description: IndexMethod define group Indexing method - enum: - - random - - ordered + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator type: string - initContainers: - description: InitContainers Init containers specification - properties: - containers: - description: Containers contains list of containers - items: - properties: - args: - items: + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + items: + type: string + type: array + sidecars: + description: Sidecars specifies a list of additional containers to be started + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: type: string - type: array - command: - items: + value: type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: + valueFrom: properties: - configMapRef: + configMapKeyRef: properties: + key: + type: string name: type: string optional: type: boolean type: object - prefix: - type: string - secretRef: + fieldRef: properties: - name: + apiVersion: type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: + fieldPath: type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer name: type: string - protocol: + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: type: string + optional: + type: boolean type: object - type: array - readinessProbe: + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: properties: exec: properties: @@ -7866,17 +13037,6 @@ v1: type: string type: array type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object httpGet: properties: host: @@ -7898,15 +13058,12 @@ v1: scheme: type: string type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer + sleep: + properties: + seconds: + format: int64 + type: integer + type: object tcpSocket: properties: host: @@ -7915,102 +13072,8 @@ v1: type: string x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - restartPolicy: - type: string - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object type: object - startupProbe: + preStop: properties: exec: properties: @@ -8019,17 +13082,6 @@ v1: type: string type: array type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object httpGet: properties: host: @@ -8045,1567 +13097,1616 @@ v1: type: array path: type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: - type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object type: object - type: array - mode: - description: Mode keep container replace mode - type: string - type: object - internalPort: - description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - format: int32 - type: integer - internalPortProtocol: - description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - type: string - labels: - additionalProperties: - type: string - description: Labels specified the labels added to Pods in this group. - type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored - items: - type: string - type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels - type: string - maxCount: - description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. - format: int32 - type: integer - memoryReservation: - description: |- - MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. - If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. - Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. - format: int64 - type: integer - minCount: - description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. - format: int32 - type: integer - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + livenessProbe: properties: - preference: + exec: properties: - matchExpressions: + command: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object + type: string type: array - matchFields: + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - weight: + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: format: int32 type: integer type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: properties: - matchExpressions: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchFields: + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object + type: string type: array type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. - type: object - numactl: - description: Numactl define Numactl options passed to the process - properties: - args: - description: Args define list of the numactl process - items: - type: string - type: array - enabled: - description: Enabled define if numactl should be enabled - type: boolean - path: - description: Path define numactl path within the container - type: string - type: object - overrideDetectedNumberOfCores: - description: |- - OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. - If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. - type: boolean - overrideDetectedTotalMemory: - description: |- - OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. - If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. - type: boolean - podModes: - description: PodModes define additional modes enabled on the Pod level - properties: - network: - type: string - pid: - type: string - type: object - port: - description: Port define Port used by member - format: int32 - type: integer - priorityClassName: - description: |- - PriorityClassName specifies a priority class name - Will be forwarded to the pod spec. - type: string - probes: - description: Probes specifies additional behaviour for probes - properties: - ReadinessProbeDisabled: - description: OldReadinessProbeDisabled if true readinessProbes are disabled - type: boolean - livenessProbeDisabled: - description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - type: boolean - livenessProbeSpec: - description: LivenessProbeSpec override liveness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - readinessProbeDisabled: - description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - type: boolean - readinessProbeSpec: - description: ReadinessProbeSpec override readiness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - startupProbeDisabled: - description: StartupProbeDisabled if true startupProbes are disabled - type: boolean - startupProbeSpec: - description: StartupProbeSpec override startup probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - type: object - pvcResizeMode: - description: VolumeResizeMode specified resize mode for PVCs and PVs - enum: - - runtime - - rotate - type: string - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: - properties: - name: + privileged: + type: boolean + procMount: type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - type: array - limits: - additionalProperties: + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: type: string - type: object - requests: - additionalProperties: + terminationMessagePolicy: type: string - type: object - type: object - schedulerName: - description: SchedulerName define scheduler name used for group + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. type: string - securityContext: + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: description: |- - SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. - This is similar (but not fully compatible) to k8s SecurityContext definition. - properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers - items: + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: type: string - type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: - description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers - type: boolean - fsGroup: - description: FSGroup is a special supplemental group that applies to all containers in a pod. - format: int64 - type: integer - privileged: - description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 - type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: properties: - level: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: type: string - role: + volumeAttributesClassName: type: string - type: + volumeMode: type: string - user: + volumeName: type: string type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + status: properties: - localhostProfile: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + type: object + type: array + currentVolumeAttributesClassName: type: string - type: + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: type: string type: object - supplementalGroups: - description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. - items: - format: int64 - type: integer - type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object type: object - serviceAccountName: - description: |- - ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created - for each server of this group. If empty, it defaults to using the - `default` service account. - Using an alternative `ServiceAccount` is typically used to separate access rights. - The ArangoDB deployments need some very minimal access rights. With the - deployment of the operator, we grant the rights to 'get' all 'pod' resources. - If you are using a different service account, please grant these rights - to that service account. - type: string - shutdownDelay: - description: ShutdownDelay define how long operator should delay finalizer removal after shutdown - format: int32 - type: integer - shutdownMethod: - description: ShutdownMethod describe procedure of member shutdown taken by Operator - type: string - sidecarCoreNames: - description: |- - SidecarCoreNames is a list of sidecar containers which must run in the pod. - Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container items: - type: string + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object type: array - sidecars: - description: Sidecars specifies a list of additional containers to be started + volumes: + description: Volumes define list of volumes mounted to pod items: properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object + key: + type: string + mode: + format: int32 + type: integer + path: + type: string type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: + type: array + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: properties: - name: + key: type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: + mode: + format: int32 + type: integer + path: type: string - optional: - type: boolean type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: + type: array + optional: + type: boolean + secretName: + type: string + type: object + type: object + type: array + type: object + syncworkers: + description: SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: properties: - postStart: + podAffinityTerm: properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: + labelSelector: properties: - host: - type: string - httpHeaders: + matchExpressions: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: + matchLabels: + additionalProperties: type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + type: object type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: + matchLabelKeys: items: type: string type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: + mismatchLabelKeys: items: - properties: - name: - type: string - value: - type: string - type: object + type: string type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: items: type: string type: array + topologyKey: + type: string type: object - failureThreshold: + weight: format: int32 type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: properties: - host: - type: string - httpHeaders: + matchExpressions: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + matchLabels: + additionalProperties: + type: string + type: object type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: - properties: - claims: + matchLabelKeys: items: - properties: - name: - type: string - type: object + type: string type: array - limits: - additionalProperties: + mismatchLabelKeys: + items: type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - requests: - additionalProperties: + namespaces: + items: type: string - type: object + type: array + topologyKey: + type: string type: object - restartPolicy: - type: string - securityContext: + type: array + type: object + allowMemberRecreation: + description: |- + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: + additionalProperties: + type: string + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. + type: object + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations + type: string + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: properties: - allowPrivilegeEscalation: - type: boolean - capabilities: + podAffinityTerm: properties: - add: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: items: type: string type: array - drop: + mismatchLabelKeys: items: type: string type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: items: type: string type: array + topologyKey: + type: string type: object - failureThreshold: + weight: format: int32 type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: properties: - host: - type: string - httpHeaders: + matchExpressions: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + matchLabels: + additionalProperties: + type: string + type: object type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: + matchLabelKeys: + items: type: string - subPathExpr: + type: array + mismatchLabelKeys: + items: type: string - type: object - type: array - workingDir: - type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: - description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume - type: boolean - volumeClaimTemplate: - description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. - properties: - apiVersion: - type: string - kind: - type: string - metadata: - properties: - annotations: - additionalProperties: - type: string - type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: - format: int64 - type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: - type: string - type: array - generateName: - type: string - generation: - format: int64 - type: integer - labels: - additionalProperties: - type: string - type: object - managedFields: - items: + type: array + namespaceSelector: properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string - type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: - items: - properties: - apiVersion: - type: string - blockOwnerDeletion: - type: boolean - controller: - type: boolean - kind: - type: string - name: - type: string - uid: - type: string type: object - type: array - resourceVersion: - type: string - selfLink: - type: string - uid: + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: + description: |- + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. + format: int32 + type: integer + entrypoint: + description: Entrypoint overrides container executable + type: string + envs: + description: Envs allow to specify additional envs in this group. + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. + properties: + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume type: string type: object - spec: + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: + size: + description: Size define size of the ephemeral volume + type: string + type: object + type: object + exporterPort: + description: ExporterPort define Port used by exporter + format: int32 + type: integer + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered + type: string + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers + items: + properties: + args: + items: type: string - namespace: + type: array + command: + items: type: string - type: object - resources: - properties: - limits: - additionalProperties: - type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object type: object - requests: - additionalProperties: - type: string + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object type: object - type: object - selector: - properties: - matchExpressions: - items: + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: properties: - key: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: type: string - operator: + type: object + httpGet: + properties: + host: type: string - values: + httpHeaders: items: - type: string + properties: + name: + type: string + value: + type: string + type: object type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeAttributesClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: - additionalProperties: - type: string - type: object - capacity: - additionalProperties: - type: string - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - type: array - currentVolumeAttributesClassName: - type: string - modifyVolumeStatus: - properties: - status: - type: string - targetVolumeAttributesClassName: - type: string - type: object - phase: - type: string - type: object - type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - volumes: - description: Volumes define list of volumes mounted to pod - items: - properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: + name: + type: string + ports: items: properties: - key: + containerPort: + format: int32 + type: integer + hostIP: type: string - mode: + hostPort: format: int32 type: integer - path: + name: + type: string + protocol: type: string type: object type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath - properties: - path: - type: string - type: - type: string - type: object - name: - description: Name of volume - type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: - type: string - readOnly: - type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: items: properties: - key: + resourceName: type: string - mode: - format: int32 - type: integer - path: + restartPolicy: type: string type: object type: array - optional: - type: boolean - secretName: + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: type: string - type: object - type: object - type: array - type: object - storageEngine: - description: StorageEngine specifies the type of storage engine used for all servers in the cluster. - enum: - - RocksDB - - MMFiles - type: string - sync: - description: Sync holds Deployment-to-Deployment synchronization configuration settings - properties: - auth: - properties: - clientCASecretName: - description: |- - ClientCASecretName setting specifies the name of a kubernetes `Secret` that contains - a PEM encoded CA certificate used for client certificate verification - in all ArangoSync master servers. - This is a required setting when `spec.sync.enabled` is `true`. - type: string - jwtSecretName: - description: |- - JWTSecretName setting specifies the name of a kubernetes `Secret` that contains - the JWT token used for accessing all ArangoSync master servers. - When not specified, the `spec.auth.jwtSecretName` value is used. - If you specify a name of a `Secret` that does not exist, a random token is created - and stored in a `Secret` with given name. - type: string - type: object - enabled: - description: |- - Enabled setting enables/disables support for data center 2 data center - replication in the cluster. When enabled, the cluster will contain - a number of `syncmaster` & `syncworker` servers. - type: boolean - externalAccess: - properties: - accessPackageSecretNames: - description: |- - AccessPackageSecretNames setting specifies the names of zero of more `Secrets` that will be created by the deployment - operator containing "access packages". An access package contains those `Secrets` that are needed - to access the SyncMasters of this `ArangoDeployment`. - By removing a name from this setting, the corresponding `Secret` is also deleted. - Note that to remove all access packages, leave an empty array in place (`[]`). - Completely removing the setting results in not modifying the list. - items: - type: string - type: array - advertisedEndpoint: - description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint - type: string - loadBalancerIP: - description: |- - LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. - If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. - type: string - loadBalancerSourceRanges: - description: |- - LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type - If specified and supported by the platform, this will restrict traffic through the cloud-provider - load-balancer will be restricted to the specified client IPs. This field will be ignored if the - cloud-provider does not support the feature. - items: - type: string - type: array - managedServiceNames: - description: |- - ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. - It is only relevant when type of service is `managed`. - items: - type: string - type: array - masterEndpoint: - description: |- - MasterEndpoint setting specifies the master endpoint(s) advertised by the ArangoSync SyncMasters. - If not set, this setting defaults to: - - If `spec.sync.externalAccess.loadBalancerIP` is set, it defaults to `https://:<8629>`. - - Otherwise it defaults to `https://:<8629>`. - items: - type: string - type: array - nodePort: - description: |- - NodePort define optional port used in case of Auto or NodePort type. - This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. - If you do not specify this setting, a random port will be chosen automatically. - format: int32 - type: integer - type: - description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. - enum: - - Auto - - None - - LoadBalancer - - NodePort - type: string - type: object - image: - type: string - monitoring: - properties: - tokenSecretName: - description: |- - TokenSecretName setting specifies the name of a kubernetes `Secret` that contains - the bearer token used for accessing all monitoring endpoints of all arangod/arangosync servers. - When not specified, no monitoring token is used. - type: string - type: object - tls: - properties: - altNames: - description: |- - AltNames setting specifies a list of alternate names that will be added to all generated - certificates. These names can be DNS names or email addresses. - The default value is empty. - items: - type: string - type: array - caSecretName: - description: |- - CASecretName setting specifies the name of a kubernetes `Secret` that contains - a standard CA certificate + private key used to sign certificates for individual - ArangoDB servers. - When no name is specified, it defaults to `-ca`. - To disable authentication, set this value to `None`. - If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created - and stored in a `Secret` with given name. - The specified `Secret`, must contain the following data fields: - - `ca.crt` PEM encoded public key of the CA certificate - - `ca.key` PEM encoded private key of the CA certificate - type: string - mode: - type: string - sni: - properties: - mapping: - additionalProperties: - items: - type: string - type: array - type: object - type: object - ttl: - description: |- - TTL setting specifies the time to live of all generated server certificates. - When the server certificate is about to expire, it will be automatically replaced - by a new one and the affected server will be restarted. - Note: The time to live of the CA certificate (when created automatically) - will be set to 10 years. - type: string - type: object - type: object - syncmasters: - description: SyncMasters contains specification for Syncmaster pods running in deployment mode `Cluster`. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: properties: - labelSelector: + exec: properties: - matchExpressions: + command: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: type: string - type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + failureThreshold: + format: int32 + type: integer + grpc: properties: - matchExpressions: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - weight: - format: int32 - type: integer + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string type: object type: array - requiredDuringSchedulingIgnoredDuringExecution: + mode: + description: Mode keep container replace mode + type: string + type: object + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + type: string + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + format: int32 + type: integer + memoryReservation: + description: |- + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: items: properties: - labelSelector: + preference: properties: matchExpressions: items: @@ -9620,20 +14721,29 @@ v1: type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: properties: matchExpressions: items: @@ -9648,412 +14758,452 @@ v1: type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: + type: string type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string type: object - allowMemberRecreation: + overrideDetectedNumberOfCores: description: |- - AllowMemberRecreation allows to recreate member. - This setting changes the member recreation logic based on group: - - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) - - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. type: boolean - annotations: - additionalProperties: - type: string + overrideDetectedTotalMemory: description: |- - Annotations specified the annotations added to Pods in this group. - Annotations are merged with `spec.annotations`. + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level + properties: + network: + type: string + pid: + type: string type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode Define annotations mode which should be use while overriding annotations + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. type: string - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + probes: + description: Probes specifies additional behaviour for probes properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - weight: - format: int32 - type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + type: object + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: items: properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: + name: type: string type: object type: array - type: object - args: - description: Args setting specifies additional command-line arguments passed to all servers of this group. - items: - type: string - type: array - count: - description: |- - Count setting specifies the number of servers to start for the given group. - For the Agent group, this value must be a positive, odd number. - The default value is `3` for all groups except `single` (there the default is `1` - for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). - For the `syncworkers` group, it is highly recommended to use the same number - as for the `dbservers` group. - format: int32 - type: integer - entrypoint: - description: Entrypoint overrides container executable - type: string - envs: - description: Envs allow to specify additional envs in this group. - items: - properties: - name: + limits: + additionalProperties: type: string - value: + type: object + requests: + additionalProperties: type: string - type: object - type: array - ephemeralVolumes: - description: EphemeralVolumes keeps information about ephemeral volumes. + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group + type: string + securityContext: + description: |- + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. properties: - apps: - description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container properties: - size: - description: Size define size of the ephemeral volume + level: + type: string + role: + type: string + type: + type: string + user: type: string type: object - temp: - description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. properties: - size: - description: Size define size of the ephemeral volume + localhostProfile: + type: string + type: type: string type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object type: object - exporterPort: - description: ExporterPort define Port used by exporter + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown format: int32 type: integer - extendedRotationCheck: - description: ExtendedRotationCheck extend checks for rotation - type: boolean - externalPortEnabled: - description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members - type: boolean - indexMethod: - description: IndexMethod define group Indexing method - enum: - - random - - ordered + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator type: string - initContainers: - description: InitContainers Init containers specification - properties: - containers: - description: Containers contains list of containers - items: - properties: - args: - items: + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + items: + type: string + type: array + sidecars: + description: Sidecars specifies a list of additional containers to be started + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: type: string - type: array - command: - items: + value: type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: + valueFrom: properties: - configMapRef: + configMapKeyRef: properties: + key: + type: string name: type: string optional: type: boolean type: object - prefix: - type: string - secretRef: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: properties: + key: + type: string name: type: string optional: type: boolean type: object type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: properties: - postStart: + exec: properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object + command: + items: + type: string + type: array type: object - preStop: + httpGet: properties: - exec: - properties: - command: - items: + host: + type: string + httpHeaders: + items: + properties: + name: type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true type: object type: object - livenessProbe: + preStop: properties: exec: properties: @@ -10062,17 +15212,6 @@ v1: type: string type: array type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object httpGet: properties: host: @@ -10094,15 +15233,12 @@ v1: scheme: type: string type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer + sleep: + properties: + seconds: + format: int64 + type: integer + type: object tcpSocket: properties: host: @@ -10111,363 +15247,851 @@ v1: type: string x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 type: integer - timeoutSeconds: + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: format: int32 type: integer + service: + type: string type: object - name: - type: string - ports: + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: items: properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer name: type: string - protocol: + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: type: string - type: object - type: array - readinessProbe: + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: + port: format: int32 type: integer + service: + type: string type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: + httpGet: properties: - claims: + host: + type: string + httpHeaders: items: properties: name: type: string + value: + type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string type: object - restartPolicy: - type: string - securityContext: + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: + apiVersion: type: string - readOnlyRootFilesystem: + blockOwnerDeletion: type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: + controller: type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object + kind: + type: string + name: + type: string + uid: + type: string type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: properties: - port: - format: int32 - type: integer - service: + key: type: string - type: object - httpGet: - properties: - host: + operator: type: string - httpHeaders: + values: items: - properties: - name: - type: string - value: - type: string - type: object + type: string type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: type: string - terminationMessagePolicy: + type: array + allocatedResourceStatuses: + additionalProperties: type: string - tty: - type: boolean - volumeDevices: + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + type: object + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: items: properties: - devicePath: + key: type: string - name: + mode: + format: int32 + type: integer + path: type: string type: object type: array - volumeMounts: + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: items: properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: + key: type: string - subPathExpr: + mode: + format: int32 + type: integer + path: type: string type: object type: array - workingDir: + optional: + type: boolean + secretName: type: string type: object - type: array - mode: - description: Mode keep container replace mode - type: string - type: object - internalPort: - description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - format: int32 - type: integer - internalPortProtocol: - description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - type: string - labels: + type: object + type: array + type: object + timeouts: + description: Timeouts object allows to configure various time-outs + properties: + actions: additionalProperties: - type: string - description: Labels specified the labels added to Pods in this group. + type: object + description: Actions keep map of the actions timeouts. type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + maintenanceGracePeriod: + description: MaintenanceGracePeriod action timeout + type: object + type: object + timezone: + description: |- + Timezone if specified, will set a timezone for deployment. + Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` + type: string + tls: + description: TLS holds TLS configuration settings + properties: + altNames: + description: |- + AltNames setting specifies a list of alternate names that will be added to all generated + certificates. These names can be DNS names or email addresses. + The default value is empty. items: type: string type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels + caSecretName: + description: |- + CASecretName setting specifies the name of a kubernetes `Secret` that contains + a standard CA certificate + private key used to sign certificates for individual + ArangoDB servers. + When no name is specified, it defaults to `-ca`. + To disable authentication, set this value to `None`. + If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created + and stored in a `Secret` with given name. + The specified `Secret`, must contain the following data fields: + - `ca.crt` PEM encoded public key of the CA certificate + - `ca.key` PEM encoded private key of the CA certificate type: string - maxCount: - description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. - format: int32 - type: integer - memoryReservation: + mode: + type: string + sni: + properties: + mapping: + additionalProperties: + items: + type: string + type: array + type: object + type: object + ttl: description: |- - MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. - If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. - Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. - format: int64 - type: integer - minCount: - description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + TTL setting specifies the time to live of all generated server certificates. + When the server certificate is about to expire, it will be automatically replaced + by a new one and the affected server will be restarted. + Note: The time to live of the CA certificate (when created automatically) + will be set to 10 years. + type: string + type: object + topology: + description: Topology define topology adjustment details, Enterprise only + properties: + enabled: + type: boolean + label: + type: string + zones: format: int32 type: integer - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + type: object + upgrade: + description: Upgrade allows to configure upgrade-related options + properties: + autoUpgrade: + description: AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck) + type: boolean + debugLog: + description: |- + DebugLog flag specifies if containers running upgrade process should print more debugging information. + This applies only to init containers. + type: boolean + type: object + type: object + status: + description: Object with preserved fields for backward compatibility + type: object + x-kubernetes-preserve-unknown-fields: true + type: object +v1alpha: + openAPIV3Schema: + properties: + spec: + properties: + ClusterDomain: + description: |- + ClusterDomain define domain used in the kubernetes cluster. + Required only of domain is not set to default (cluster.local) + type: string + agents: + description: Agents contains specification for Agency pods running in deployment mode `Cluster` or `ActiveFailover`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: - preference: + podAffinityTerm: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object + type: object + type: object + matchLabelKeys: + items: + type: string type: array - matchFields: + mismatchLabelKeys: items: - properties: - key: - type: string - operator: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object + type: object + type: object + namespaces: + items: + type: string type: array + topologyKey: + type: string type: object weight: format: int32 @@ -10475,9 +16099,9 @@ v1: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: + items: + properties: + labelSelector: properties: matchExpressions: items: @@ -10492,7 +16116,22 @@ v1: type: array type: object type: array - matchFields: + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: items: properties: key: @@ -10505,394 +16144,412 @@ v1: type: array type: object type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. - type: object - numactl: - description: Numactl define Numactl options passed to the process - properties: - args: - description: Args define list of the numactl process - items: - type: string + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object type: array - enabled: - description: Enabled define if numactl should be enabled - type: boolean - path: - description: Path define numactl path within the container - type: string type: object - overrideDetectedNumberOfCores: - description: |- - OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. - If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. - type: boolean - overrideDetectedTotalMemory: + allowMemberRecreation: description: |- - OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. - If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. type: boolean - podModes: - description: PodModes define additional modes enabled on the Pod level - properties: - network: - type: string - pid: - type: string - type: object - port: - description: Port define Port used by member - format: int32 - type: integer - priorityClassName: - description: |- - PriorityClassName specifies a priority class name - Will be forwarded to the pod spec. - type: string - probes: - description: Probes specifies additional behaviour for probes - properties: - ReadinessProbeDisabled: - description: OldReadinessProbeDisabled if true readinessProbes are disabled - type: boolean - livenessProbeDisabled: - description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - type: boolean - livenessProbeSpec: - description: LivenessProbeSpec override liveness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - readinessProbeDisabled: - description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - type: boolean - readinessProbeSpec: - description: ReadinessProbeSpec override readiness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - startupProbeDisabled: - description: StartupProbeDisabled if true startupProbes are disabled - type: boolean - startupProbeSpec: - description: StartupProbeSpec override startup probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object + annotations: + additionalProperties: + type: string + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. type: object - pvcResizeMode: - description: VolumeResizeMode specified resize mode for PVCs and PVs - enum: - - runtime - - rotate + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations type: string - resources: - description: Resources holds resource requests & limits + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions properties: - claims: + preferredDuringSchedulingIgnoredDuringExecution: items: properties: - name: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object type: object - schedulerName: - description: SchedulerName define scheduler name used for group - type: string - securityContext: + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: description: |- - SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. - This is similar (but not fully compatible) to k8s SecurityContext definition. - properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers - items: + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. + format: int32 + type: integer + entrypoint: + description: Entrypoint overrides container executable + type: string + envs: + description: Envs allow to specify additional envs in this group. + items: + properties: + name: type: string - type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: - description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers - type: boolean - fsGroup: - description: FSGroup is a special supplemental group that applies to all containers in a pod. - format: int64 - type: integer - privileged: - description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 - type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container + value: + type: string + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. + properties: + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - level: - type: string - role: - type: string - type: - type: string - user: + size: + description: Size define size of the ephemeral volume type: string type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - localhostProfile: - type: string - type: + size: + description: Size define size of the ephemeral volume type: string type: object - supplementalGroups: - description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. - items: - format: int64 - type: integer - type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object type: object - serviceAccountName: - description: |- - ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created - for each server of this group. If empty, it defaults to using the - `default` service account. - Using an alternative `ServiceAccount` is typically used to separate access rights. - The ArangoDB deployments need some very minimal access rights. With the - deployment of the operator, we grant the rights to 'get' all 'pod' resources. - If you are using a different service account, please grant these rights - to that service account. - type: string - shutdownDelay: - description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + exporterPort: + description: ExporterPort define Port used by exporter format: int32 type: integer - shutdownMethod: - description: ShutdownMethod describe procedure of member shutdown taken by Operator + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered type: string - sidecarCoreNames: - description: |- - SidecarCoreNames is a list of sidecar containers which must run in the pod. - Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. - items: - type: string - type: array - sidecars: - description: Sidecars specifies a list of additional containers to be started - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers + items: + properties: + args: + items: type: string - value: + type: array + command: + items: type: string - valueFrom: + type: array + env: + items: properties: - configMapKeyRef: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - key: - type: string name: type: string optional: type: boolean type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: + prefix: + type: string + secretRef: properties: - key: - type: string name: type: string optional: type: boolean type: object type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: properties: exec: properties: @@ -10901,6 +16558,17 @@ v1: type: string type: array type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object httpGet: properties: host: @@ -10922,12 +16590,15 @@ v1: scheme: type: string type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer tcpSocket: properties: host: @@ -10936,8 +16607,33 @@ v1: type: string x-kubernetes-int-or-string: true type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - preStop: + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: properties: exec: properties: @@ -10946,6 +16642,17 @@ v1: type: string type: array type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object httpGet: properties: host: @@ -10967,12 +16674,15 @@ v1: scheme: type: string type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer tcpSocket: properties: host: @@ -10980,1624 +16690,1777 @@ v1: port: type: string x-kubernetes-int-or-string: true - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: - properties: - claims: + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: items: properties: - name: + resourceName: + type: string + restartPolicy: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - restartPolicy: - type: string - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: + resources: properties: - add: + claims: items: - type: string + properties: + name: + type: string + type: object type: array - drop: - items: + limits: + additionalProperties: type: string - type: array + type: object + requests: + additionalProperties: + type: string + type: object type: object - privileged: - type: boolean - procMount: + restartPolicy: type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: + securityContext: properties: - localhostProfile: - type: string - type: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object type: object - windowsOptions: + startupProbe: properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string type: object - startupProbe: + type: array + mode: + description: Mode keep container replace mode + type: string + type: object + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + type: string + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + format: int32 + type: integer + memoryReservation: + description: |- + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: properties: - exec: + preference: properties: - command: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: + matchFields: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: + weight: format: int32 type: integer - tcpSocket: + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: + type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string + type: object + overrideDetectedNumberOfCores: description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. type: boolean - volumeClaimTemplate: + overrideDetectedTotalMemory: description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level + properties: + network: + type: string + pid: + type: string + type: object + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. + type: string + probes: + description: Probes specifies additional behaviour for probes properties: - apiVersion: - type: string - kind: - type: string - metadata: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration properties: - annotations: - additionalProperties: - type: string - type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: - format: int64 + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: - type: string - type: array - generateName: - type: string - generation: - format: int64 + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 type: integer - labels: - additionalProperties: + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + type: object + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: type: string - type: object - managedFields: - items: - properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: - type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string - type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: - items: - properties: - apiVersion: - type: string - blockOwnerDeletion: - type: boolean - controller: - type: boolean - kind: - type: string - name: - type: string - uid: - type: string - type: object - type: array - resourceVersion: - type: string - selfLink: - type: string - uid: - type: string + type: object + type: array + limits: + additionalProperties: + type: string type: object - spec: + requests: + additionalProperties: + type: string + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group + type: string + securityContext: + description: |- + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. + properties: + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - type: object - resources: - properties: - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: + level: type: string - volumeAttributesClassName: + role: type: string - volumeMode: + type: type: string - volumeName: + user: type: string type: object - status: + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. properties: - accessModes: - items: - type: string - type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: - additionalProperties: - type: string - type: object - capacity: - additionalProperties: - type: string - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - type: object - type: array - currentVolumeAttributesClassName: + localhostProfile: type: string - modifyVolumeStatus: - properties: - status: - type: string - targetVolumeAttributesClassName: - type: string - type: object - phase: + type: type: string type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + format: int32 + type: integer + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator + type: string + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object + type: string type: array - volumes: - description: Volumes define list of volumes mounted to pod + sidecars: + description: Sidecars specifies a list of additional containers to be started items: properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath - properties: - path: - type: string - type: - type: string - type: object - name: - description: Name of volume - type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: - type: string - readOnly: - type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - key: + name: type: string - mode: - format: int32 - type: integer - path: + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: type: string + optional: + type: boolean type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - type: object - type: array - type: object - syncworkers: - description: SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: properties: - podAffinityTerm: + postStart: properties: - labelSelector: + exec: properties: - matchExpressions: + command: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: type: string - type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - weight: - format: int32 - type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string + sleep: + properties: + seconds: + format: int64 + type: integer type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true type: object type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - type: array - type: object - allowMemberRecreation: - description: |- - AllowMemberRecreation allows to recreate member. - This setting changes the member recreation logic based on group: - - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) - - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. - type: boolean - annotations: - additionalProperties: - type: string - description: |- - Annotations specified the annotations added to Pods in this group. - Annotations are merged with `spec.annotations`. - type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode Define annotations mode which should be use while overriding annotations - type: string - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: + preStop: properties: - labelSelector: + exec: properties: - matchExpressions: + command: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: type: string - type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: items: type: string type: array - topologyKey: - type: string type: object - weight: + failureThreshold: format: int32 type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + grpc: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + port: + format: int32 + type: integer + service: + type: string type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - type: array - type: object - args: - description: Args setting specifies additional command-line arguments passed to all servers of this group. - items: - type: string - type: array - count: - description: |- - Count setting specifies the number of servers to start for the given group. - For the Agent group, this value must be a positive, odd number. - The default value is `3` for all groups except `single` (there the default is `1` - for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). - For the `syncworkers` group, it is highly recommended to use the same number - as for the `dbservers` group. - format: int32 - type: integer - entrypoint: - description: Entrypoint overrides container executable - type: string - envs: - description: Envs allow to specify additional envs in this group. - items: - properties: name: type: string - value: - type: string - type: object - type: array - ephemeralVolumes: - description: EphemeralVolumes keeps information about ephemeral volumes. - properties: - apps: - description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. - properties: - size: - description: Size define size of the ephemeral volume - type: string - type: object - temp: - description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. - properties: - size: - description: Size define size of the ephemeral volume - type: string - type: object - type: object - exporterPort: - description: ExporterPort define Port used by exporter - format: int32 - type: integer - extendedRotationCheck: - description: ExtendedRotationCheck extend checks for rotation - type: boolean - externalPortEnabled: - description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members - type: boolean - indexMethod: - description: IndexMethod define group Indexing method - enum: - - random - - ordered - type: string - initContainers: - description: InitContainers Init containers specification - properties: - containers: - description: Containers contains list of containers - items: + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: properties: - args: - items: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: type: string - type: array - command: - items: + restartPolicy: type: string - type: array - env: + type: object + type: array + resources: + properties: + claims: items: properties: name: type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object type: object type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: type: string - lifecycle: + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object + level: + type: string + role: + type: string + type: + type: string + user: + type: string type: object - livenessProbe: + seccompProfile: properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: format: int32 type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string type: object - name: + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: properties: - port: - format: int32 - type: integer - service: + key: type: string - type: object - httpGet: - properties: - host: + operator: type: string - httpHeaders: + values: items: - properties: - name: - type: string - value: - type: string - type: object + type: string type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string type: object - resizePolicy: + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: items: properties: - resourceName: + key: type: string - restartPolicy: + mode: + format: int32 + type: integer + path: type: string type: object type: array - resources: - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: type: string - type: object - requests: - additionalProperties: + mode: + format: int32 + type: integer + path: type: string - type: object - type: object - restartPolicy: + type: object + type: array + optional: + type: boolean + secretName: type: string - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: + type: object + type: object + type: array + type: object + allowUnsafeUpgrade: + description: AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed + type: boolean + annotations: + additionalProperties: + type: string + description: Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVC’s, PDB’s). + type: object + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode defines annotations mode which should be use while overriding annotations. + enum: + - disabled + - append + - replace + type: string + architecture: + description: |- + Architecture defines the list of supported architectures. + First element on the list is marked as default architecture. + Possible values are: + - `amd64`: Use processors with the x86-64 architecture. + - `arm64`: Use processors with the 64-bit ARM architecture. + The setting expects a list of strings, but you should only specify a single + list item for the architecture, except when you want to migrate from one + architecture to the other. The first list item defines the new default + architecture for the deployment that you want to migrate to. + items: + type: string + type: array + auth: + description: Authentication holds authentication configuration settings + properties: + jwtSecretName: + description: |- + JWTSecretName setting specifies the name of a kubernetes `Secret` that contains a secret key used for generating + JWT tokens to access all ArangoDB servers. + When no name is specified, it defaults to `-jwt`. + To disable authentication, set this value to `None`. + If you specify a name of a `Secret`, that secret must have the key value in a data field named `token`. + If you specify a name of a `Secret` that does not exist, a random key is created and stored in a `Secret` with given name. + Changing secret key results in restarting of a whole cluster. + type: string + type: object + bootstrap: + description: Bootstrap contains information for cluster bootstrapping + properties: + passwordSecretNames: + additionalProperties: + type: string + description: |- + PasswordSecretNames contains a map of username to password-secret-name + This setting specifies a secret name for the credentials per specific users. + When a deployment is created the operator will setup the user accounts + according to the credentials given by the secret. If the secret doesn't exist + the operator creates a secret with a random password. + There are two magic values for the secret name: + - `None` specifies no action. This disables root password randomization. This is the default value. (Thus the root password is empty - not recommended) + - `Auto` specifies automatic name generation, which is `-root-password`. + type: object + type: object + chaos: + description: ChaosSpec can be used for chaos-monkey testing of your ArangoDeployment + properties: + enabled: + description: Enabled switches the chaos monkey for a deployment on or off. + type: boolean + interval: + description: Interval is the time between events + format: int64 + type: integer + kill-pod-probability: + description: KillPodProbability is the chance of a pod being killed during an event + format: int32 + type: integer + type: object + communicationMethod: + description: CommunicationMethod define communication method used in deployment + enum: + - headless + - dns + - short-dns + - headless-dns + - ip + type: string + coordinators: + description: Coordinators contains specification for Coordinator pods running in deployment mode `Cluster` or `ActiveFailover`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: + labelSelector: properties: - port: - format: int32 - type: integer - service: - type: string + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - httpGet: + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: properties: - host: - type: string - httpHeaders: + matchExpressions: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string + matchLabels: + additionalProperties: + type: string + type: object type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: + matchLabelKeys: items: - properties: - devicePath: - type: string - name: - type: string - type: object + type: string type: array - volumeMounts: + mismatchLabelKeys: items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - type: object + type: object + type: object + namespaces: + items: + type: string type: array - workingDir: + topologyKey: type: string type: object type: array - mode: - description: Mode keep container replace mode - type: string type: object - internalPort: - description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - format: int32 - type: integer - internalPortProtocol: - description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - type: string - labels: + allowMemberRecreation: + description: |- + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: additionalProperties: type: string - description: Labels specified the labels added to Pods in this group. + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored items: type: string type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations type: string - maxCount: - description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. - format: int32 - type: integer - memoryReservation: - description: |- - MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. - If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. - Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. - format: int64 - type: integer - minCount: - description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. - format: int32 - type: integer - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: - preference: + podAffinityTerm: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object + type: object + type: object + matchLabelKeys: + items: + type: string type: array - matchFields: + mismatchLabelKeys: items: - properties: - key: - type: string - operator: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object + type: object + type: object + namespaces: + items: + type: string type: array + topologyKey: + type: string type: object weight: format: int32 @@ -12605,9 +18468,9 @@ v1: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: + items: + properties: + labelSelector: properties: matchExpressions: items: @@ -12622,7 +18485,22 @@ v1: type: array type: object type: array - matchFields: + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: items: properties: key: @@ -12635,1327 +18513,676 @@ v1: type: array type: object type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. - type: object - numactl: - description: Numactl define Numactl options passed to the process - properties: - args: - description: Args define list of the numactl process - items: - type: string + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object type: array - enabled: - description: Enabled define if numactl should be enabled - type: boolean - path: - description: Path define numactl path within the container - type: string type: object - overrideDetectedNumberOfCores: - description: |- - OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. - If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. - type: boolean - overrideDetectedTotalMemory: + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: description: |- - OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. - If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. - type: boolean - podModes: - description: PodModes define additional modes enabled on the Pod level - properties: - network: - type: string - pid: - type: string - type: object - port: - description: Port define Port used by member + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. format: int32 type: integer - priorityClassName: - description: |- - PriorityClassName specifies a priority class name - Will be forwarded to the pod spec. - type: string - probes: - description: Probes specifies additional behaviour for probes - properties: - ReadinessProbeDisabled: - description: OldReadinessProbeDisabled if true readinessProbes are disabled - type: boolean - livenessProbeDisabled: - description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - type: boolean - livenessProbeSpec: - description: LivenessProbeSpec override liveness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - readinessProbeDisabled: - description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - type: boolean - readinessProbeSpec: - description: ReadinessProbeSpec override readiness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - startupProbeDisabled: - description: StartupProbeDisabled if true startupProbes are disabled - type: boolean - startupProbeSpec: - description: StartupProbeSpec override startup probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - type: object - pvcResizeMode: - description: VolumeResizeMode specified resize mode for PVCs and PVs - enum: - - runtime - - rotate + entrypoint: + description: Entrypoint overrides container executable type: string - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: + envs: + description: Envs allow to specify additional envs in this group. + items: + properties: + name: type: string - type: object - requests: - additionalProperties: + value: type: string - type: object - type: object - schedulerName: - description: SchedulerName define scheduler name used for group - type: string - securityContext: - description: |- - SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. - This is similar (but not fully compatible) to k8s SecurityContext definition. + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers - items: - type: string - type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: - description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers - type: boolean - fsGroup: - description: FSGroup is a special supplemental group that applies to all containers in a pod. - format: int64 - type: integer - privileged: - description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 - type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - level: - type: string - role: - type: string - type: - type: string - user: + size: + description: Size define size of the ephemeral volume type: string type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - localhostProfile: - type: string - type: + size: + description: Size define size of the ephemeral volume type: string type: object - supplementalGroups: - description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. - items: - format: int64 - type: integer - type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object type: object - serviceAccountName: - description: |- - ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created - for each server of this group. If empty, it defaults to using the - `default` service account. - Using an alternative `ServiceAccount` is typically used to separate access rights. - The ArangoDB deployments need some very minimal access rights. With the - deployment of the operator, we grant the rights to 'get' all 'pod' resources. - If you are using a different service account, please grant these rights - to that service account. - type: string - shutdownDelay: - description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + exporterPort: + description: ExporterPort define Port used by exporter format: int32 type: integer - shutdownMethod: - description: ShutdownMethod describe procedure of member shutdown taken by Operator + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered type: string - sidecarCoreNames: - description: |- - SidecarCoreNames is a list of sidecar containers which must run in the pod. - Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. - items: - type: string - type: array - sidecars: - description: Sidecars specifies a list of additional containers to be started - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers + items: + properties: + args: + items: type: string - value: + type: array + command: + items: type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: + type: array + env: + items: properties: name: type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: + value: type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: + valueFrom: + properties: + configMapKeyRef: properties: + key: + type: string name: type: string - value: + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: type: string type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: + resourceFieldRef: properties: - name: + containerName: type: string - value: + divisor: + type: string + resource: type: string type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: name: type: string - value: + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: type: string + optional: + type: boolean type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: properties: - command: - items: - type: string - type: array + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object type: object - failureThreshold: - format: int32 - type: integer - grpc: + livenessProbe: properties: - port: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: format: int32 type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: - properties: - claims: + name: + type: string + ports: items: properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - restartPolicy: - type: string - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: + containerPort: + format: int32 + type: integer + hostIP: type: string - type: array - drop: - items: + hostPort: + format: int32 + type: integer + name: type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: + protocol: type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: + type: object + type: array + readinessProbe: properties: - port: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: format: int32 type: integer - service: - type: string type: object - httpGet: + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: properties: - host: - type: string - httpHeaders: + claims: items: properties: name: type: string - value: - type: string type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: - type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: - description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume - type: boolean - volumeClaimTemplate: - description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. - properties: - apiVersion: - type: string - kind: - type: string - metadata: - properties: - annotations: - additionalProperties: - type: string - type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: - format: int64 - type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: - type: string - type: array - generateName: - type: string - generation: - format: int64 - type: integer - labels: - additionalProperties: - type: string - type: object - managedFields: - items: - properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: + limits: + additionalProperties: + type: string type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string - type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: - items: + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: properties: - apiVersion: - type: string - blockOwnerDeletion: + allowPrivilegeEscalation: type: boolean - controller: + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: type: boolean - kind: - type: string - name: - type: string - uid: - type: string - type: object - type: array - resourceVersion: - type: string - selfLink: - type: string - uid: - type: string - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - type: object - resources: - properties: - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: + procMount: type: string - type: object - type: object - selector: - properties: - matchExpressions: - items: + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: properties: - key: + level: type: string - operator: + role: type: string - values: + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: items: type: string type: array type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeAttributesClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: - additionalProperties: - type: string - type: object - capacity: - additionalProperties: - type: string - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - type: object - type: array - currentVolumeAttributesClassName: - type: string - modifyVolumeStatus: - properties: - status: - type: string - targetVolumeAttributesClassName: - type: string - type: object - phase: - type: string - type: object - type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - volumes: - description: Volumes define list of volumes mounted to pod - items: - properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: items: properties: - key: + devicePath: type: string - mode: - format: int32 - type: integer - path: + name: type: string type: object type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath - properties: - path: - type: string - type: - type: string - type: object - name: - description: Name of volume - type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: - type: string - readOnly: - type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: + volumeMounts: items: properties: - key: + mountPath: type: string - mode: - format: int32 - type: integer - path: + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: type: string type: object type: array - optional: - type: boolean - secretName: + workingDir: type: string type: object - type: object - type: array - type: object - timeouts: - description: Timeouts object allows to configure various time-outs - properties: - actions: - additionalProperties: - type: object - description: Actions keep map of the actions timeouts. + type: array + mode: + description: Mode keep container replace mode + type: string type: object - maintenanceGracePeriod: - description: MaintenanceGracePeriod action timeout + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. type: object - type: object - timezone: - description: |- - Timezone if specified, will set a timezone for deployment. - Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` - type: string - tls: - description: TLS holds TLS configuration settings - properties: - altNames: - description: |- - AltNames setting specifies a list of alternate names that will be added to all generated - certificates. These names can be DNS names or email addresses. - The default value is empty. + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored items: type: string type: array - caSecretName: - description: |- - CASecretName setting specifies the name of a kubernetes `Secret` that contains - a standard CA certificate + private key used to sign certificates for individual - ArangoDB servers. - When no name is specified, it defaults to `-ca`. - To disable authentication, set this value to `None`. - If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created - and stored in a `Secret` with given name. - The specified `Secret`, must contain the following data fields: - - `ca.crt` PEM encoded public key of the CA certificate - - `ca.key` PEM encoded private key of the CA certificate - type: string - mode: - type: string - sni: - properties: - mapping: - additionalProperties: - items: - type: string - type: array - type: object - type: object - ttl: - description: |- - TTL setting specifies the time to live of all generated server certificates. - When the server certificate is about to expire, it will be automatically replaced - by a new one and the affected server will be restarted. - Note: The time to live of the CA certificate (when created automatically) - will be set to 10 years. - type: string - type: object - topology: - description: Topology define topology adjustment details, Enterprise only - properties: - enabled: - type: boolean - label: + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels type: string - zones: + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. format: int32 type: integer - type: object - upgrade: - description: Upgrade allows to configure upgrade-related options - properties: - autoUpgrade: - description: AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck) - type: boolean - debugLog: + memoryReservation: description: |- - DebugLog flag specifies if containers running upgrade process should print more debugging information. - This applies only to init containers. - type: boolean - type: object - type: object - status: - description: Object with preserved fields for backward compatibility - type: object - x-kubernetes-preserve-unknown-fields: true - type: object -v1alpha: - openAPIV3Schema: - properties: - spec: - properties: - ClusterDomain: - description: |- - ClusterDomain define domain used in the kubernetes cluster. - Required only of domain is not set to default (cluster.local) - type: string - agents: - description: Agents contains specification for Agency pods running in deployment mode `Cluster` or `ActiveFailover`. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - mismatchLabelKeys: + matchFields: items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: + properties: + key: type: string - type: object - type: object - namespaces: - items: - type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - topologyKey: - type: string type: object weight: format: int32 @@ -13963,9 +19190,9 @@ v1alpha: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + properties: + nodeSelectorTerms: + items: properties: matchExpressions: items: @@ -13980,22 +19207,7 @@ v1alpha: type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: + matchFields: items: properties: key: @@ -14008,412 +19220,394 @@ v1alpha: type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: + type: string type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string type: object - allowMemberRecreation: + overrideDetectedNumberOfCores: description: |- - AllowMemberRecreation allows to recreate member. - This setting changes the member recreation logic based on group: - - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) - - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. type: boolean - annotations: - additionalProperties: - type: string + overrideDetectedTotalMemory: description: |- - Annotations specified the annotations added to Pods in this group. - Annotations are merged with `spec.annotations`. + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level + properties: + network: + type: string + pid: + type: string + type: object + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. + type: string + probes: + description: Probes specifies additional behaviour for probes + properties: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode Define annotations mode which should be use while overriding annotations + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate type: string - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + resources: + description: Resources holds resource requests & limits properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - weight: - format: int32 - type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: + claims: items: properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: + name: type: string type: object type: array - type: object - args: - description: Args setting specifies additional command-line arguments passed to all servers of this group. - items: - type: string - type: array - count: - description: |- - Count setting specifies the number of servers to start for the given group. - For the Agent group, this value must be a positive, odd number. - The default value is `3` for all groups except `single` (there the default is `1` - for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). - For the `syncworkers` group, it is highly recommended to use the same number - as for the `dbservers` group. - format: int32 - type: integer - entrypoint: - description: Entrypoint overrides container executable - type: string - envs: - description: Envs allow to specify additional envs in this group. - items: - properties: - name: + limits: + additionalProperties: type: string - value: + type: object + requests: + additionalProperties: type: string - type: object - type: array - ephemeralVolumes: - description: EphemeralVolumes keeps information about ephemeral volumes. + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group + type: string + securityContext: + description: |- + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. properties: - apps: - description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container properties: - size: - description: Size define size of the ephemeral volume + level: + type: string + role: + type: string + type: + type: string + user: type: string type: object - temp: - description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. properties: - size: - description: Size define size of the ephemeral volume + localhostProfile: + type: string + type: type: string type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object type: object - exporterPort: - description: ExporterPort define Port used by exporter + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown format: int32 type: integer - extendedRotationCheck: - description: ExtendedRotationCheck extend checks for rotation - type: boolean - externalPortEnabled: - description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members - type: boolean - indexMethod: - description: IndexMethod define group Indexing method - enum: - - random - - ordered + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator type: string - initContainers: - description: InitContainers Init containers specification - properties: - containers: - description: Containers contains list of containers - items: - properties: - args: - items: + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + items: + type: string + type: array + sidecars: + description: Sidecars specifies a list of additional containers to be started + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: type: string - type: array - command: - items: + value: type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: + valueFrom: properties: - configMapRef: + configMapKeyRef: properties: + key: + type: string name: type: string optional: type: boolean type: object - prefix: - type: string - secretRef: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: properties: + key: + type: string name: type: string optional: type: boolean type: object type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - type: object - livenessProbe: + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: properties: exec: properties: @@ -14422,17 +19616,6 @@ v1alpha: type: string type: array type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object httpGet: properties: host: @@ -14454,15 +19637,12 @@ v1alpha: scheme: type: string type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer + sleep: + properties: + seconds: + format: int64 + type: integer + type: object tcpSocket: properties: host: @@ -14471,33 +19651,8 @@ v1alpha: type: string x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: + preStop: properties: exec: properties: @@ -14506,17 +19661,6 @@ v1alpha: type: string type: array type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object httpGet: properties: host: @@ -14538,15 +19682,12 @@ v1alpha: scheme: type: string type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer + sleep: + properties: + seconds: + format: int64 + type: integer + type: object tcpSocket: properties: host: @@ -14555,279 +19696,758 @@ v1alpha: type: string x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 type: integer - timeoutSeconds: + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: format: int32 type: integer + service: + type: string type: object - resizePolicy: + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: items: properties: - resourceName: - type: string - restartPolicy: + name: type: string type: object type: array - resources: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: properties: - claims: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: name: type: string + value: + type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - restartPolicy: + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: type: string - securityContext: + type: object + managedFields: + items: properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: type: object - privileged: - type: boolean - procMount: + manager: type: string - readOnlyRootFilesystem: + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: + controller: type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object + kind: + type: string + name: + type: string + uid: + type: string type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: properties: - port: - format: int32 - type: integer - service: + key: type: string - type: object - httpGet: - properties: - host: + operator: type: string - httpHeaders: + values: items: - properties: - name: - type: string - value: - type: string - type: object + type: string type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: type: string - terminationMessagePolicy: + type: array + allocatedResourceStatuses: + additionalProperties: type: string - tty: - type: boolean - volumeDevices: + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + type: object + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: items: properties: - devicePath: + key: type: string - name: + mode: + format: int32 + type: integer + path: type: string type: object type: array - volumeMounts: + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: items: properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: + key: type: string - subPathExpr: + mode: + format: int32 + type: integer + path: type: string type: object type: array - workingDir: + optional: + type: boolean + secretName: type: string type: object - type: array - mode: - description: Mode keep container replace mode - type: string - type: object - internalPort: - description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - format: int32 - type: integer - internalPortProtocol: - description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - type: string - labels: - additionalProperties: - type: string - description: Labels specified the labels added to Pods in this group. - type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored - items: - type: string + type: object type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels - type: string - maxCount: - description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. - format: int32 - type: integer - memoryReservation: - description: |- - MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. - If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. - Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. - format: int64 - type: integer - minCount: - description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. - format: int32 - type: integer - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + type: object + database: + description: Database holds information about database state, like maintenance mode + properties: + maintenance: + description: Maintenance manage maintenance mode on Cluster side. Requires maintenance feature to be enabled + type: boolean + type: object + dbservers: + description: DBServers contains specification for DBServer pods running in deployment mode `Cluster` or `ActiveFailover`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: - preference: + podAffinityTerm: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object + type: object + type: object + matchLabelKeys: + items: + type: string type: array - matchFields: + mismatchLabelKeys: items: - properties: - key: - type: string - operator: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object + type: object + type: object + namespaces: + items: + type: string type: array + topologyKey: + type: string type: object weight: format: int32 @@ -14835,9 +20455,9 @@ v1alpha: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: + items: + properties: + labelSelector: properties: matchExpressions: items: @@ -14852,7 +20472,22 @@ v1alpha: type: array type: object type: array - matchFields: + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: items: properties: key: @@ -14865,394 +20500,412 @@ v1alpha: type: array type: object type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. - type: object - numactl: - description: Numactl define Numactl options passed to the process - properties: - args: - description: Args define list of the numactl process - items: - type: string + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object type: array - enabled: - description: Enabled define if numactl should be enabled - type: boolean - path: - description: Path define numactl path within the container - type: string type: object - overrideDetectedNumberOfCores: - description: |- - OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. - If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. - type: boolean - overrideDetectedTotalMemory: + allowMemberRecreation: description: |- - OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. - If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. type: boolean - podModes: - description: PodModes define additional modes enabled on the Pod level - properties: - network: - type: string - pid: - type: string - type: object - port: - description: Port define Port used by member - format: int32 - type: integer - priorityClassName: + annotations: + additionalProperties: + type: string description: |- - PriorityClassName specifies a priority class name - Will be forwarded to the pod spec. - type: string - probes: - description: Probes specifies additional behaviour for probes - properties: - ReadinessProbeDisabled: - description: OldReadinessProbeDisabled if true readinessProbes are disabled - type: boolean - livenessProbeDisabled: - description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - type: boolean - livenessProbeSpec: - description: LivenessProbeSpec override liveness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - readinessProbeDisabled: - description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - type: boolean - readinessProbeSpec: - description: ReadinessProbeSpec override readiness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - startupProbeDisabled: - description: StartupProbeDisabled if true startupProbes are disabled - type: boolean - startupProbeSpec: - description: StartupProbeSpec override startup probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. type: object - pvcResizeMode: - description: VolumeResizeMode specified resize mode for PVCs and PVs - enum: - - runtime - - rotate + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations type: string - resources: - description: Resources holds resource requests & limits + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions properties: - claims: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: items: properties: - name: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object type: object - schedulerName: - description: SchedulerName define scheduler name used for group - type: string - securityContext: + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: description: |- - SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. - This is similar (but not fully compatible) to k8s SecurityContext definition. - properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers - items: + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. + format: int32 + type: integer + entrypoint: + description: Entrypoint overrides container executable + type: string + envs: + description: Envs allow to specify additional envs in this group. + items: + properties: + name: type: string - type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: - description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers - type: boolean - fsGroup: - description: FSGroup is a special supplemental group that applies to all containers in a pod. - format: int64 - type: integer - privileged: - description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 - type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container + value: + type: string + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. + properties: + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - level: - type: string - role: - type: string - type: - type: string - user: + size: + description: Size define size of the ephemeral volume type: string type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - localhostProfile: - type: string - type: + size: + description: Size define size of the ephemeral volume type: string type: object - supplementalGroups: - description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. - items: - format: int64 - type: integer - type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object type: object - serviceAccountName: - description: |- - ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created - for each server of this group. If empty, it defaults to using the - `default` service account. - Using an alternative `ServiceAccount` is typically used to separate access rights. - The ArangoDB deployments need some very minimal access rights. With the - deployment of the operator, we grant the rights to 'get' all 'pod' resources. - If you are using a different service account, please grant these rights - to that service account. - type: string - shutdownDelay: - description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + exporterPort: + description: ExporterPort define Port used by exporter format: int32 type: integer - shutdownMethod: - description: ShutdownMethod describe procedure of member shutdown taken by Operator + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered type: string - sidecarCoreNames: - description: |- - SidecarCoreNames is a list of sidecar containers which must run in the pod. - Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. - items: - type: string - type: array - sidecars: - description: Sidecars specifies a list of additional containers to be started - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers + items: + properties: + args: + items: type: string - value: + type: array + command: + items: type: string - valueFrom: + type: array + env: + items: properties: - configMapKeyRef: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - key: - type: string name: type: string optional: type: boolean type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: + prefix: + type: string + secretRef: properties: - key: - type: string name: type: string optional: type: boolean type: object type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: properties: exec: properties: @@ -15261,6 +20914,17 @@ v1alpha: type: string type: array type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object httpGet: properties: host: @@ -15282,12 +20946,15 @@ v1alpha: scheme: type: string type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer tcpSocket: properties: host: @@ -15296,8 +20963,33 @@ v1alpha: type: string x-kubernetes-int-or-string: true type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - preStop: + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: properties: exec: properties: @@ -15306,6 +20998,17 @@ v1alpha: type: string type: array type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object httpGet: properties: host: @@ -15327,12 +21030,15 @@ v1alpha: scheme: type: string type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer tcpSocket: properties: host: @@ -15341,1712 +21047,1763 @@ v1alpha: type: string x-kubernetes-int-or-string: true type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: format: int32 type: integer - service: - type: string type: object - httpGet: + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: properties: - host: - type: string - httpHeaders: + claims: items: properties: name: type: string - value: - type: string type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: + limits: + additionalProperties: type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string + type: object + requests: + additionalProperties: + type: string + type: object type: object - httpGet: + restartPolicy: + type: string + securityContext: properties: - host: - type: string - httpHeaders: - items: - properties: - name: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: type: string - value: + type: array + drop: + items: type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: + type: array + type: object + privileged: + type: boolean + procMount: type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: + startupProbe: properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: - properties: - claims: + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: items: properties: + devicePath: + type: string name: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string type: object - restartPolicy: - type: string - securityContext: + type: array + mode: + description: Mode keep container replace mode + type: string + type: object + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + type: string + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + format: int32 + type: integer + memoryReservation: + description: |- + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: properties: - allowPrivilegeEscalation: - type: boolean - capabilities: + preference: properties: - add: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - drop: + matchFields: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 + weight: + format: int32 type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object type: object - startupProbe: - properties: - exec: + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: properties: - command: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: + matchFields: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: + type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string + type: object + overrideDetectedNumberOfCores: description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. type: boolean - volumeClaimTemplate: + overrideDetectedTotalMemory: description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level properties: - apiVersion: + network: type: string - kind: + pid: type: string - metadata: + type: object + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. + type: string + probes: + description: Probes specifies additional behaviour for probes + properties: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration properties: - annotations: - additionalProperties: - type: string - type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: - format: int64 + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: - type: string - type: array - generateName: - type: string - generation: - format: int64 + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 type: integer - labels: - additionalProperties: - type: string - type: object - managedFields: - items: - properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: - type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string - type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: - items: - properties: - apiVersion: - type: string - blockOwnerDeletion: - type: boolean - controller: - type: boolean - kind: - type: string - name: - type: string - uid: - type: string - type: object - type: array - resourceVersion: - type: string - selfLink: - type: string - uid: - type: string type: object - spec: + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - type: object - resources: - properties: - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeAttributesClassName: - type: string - volumeMode: - type: string - volumeName: - type: string + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer type: object - status: + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration properties: - accessModes: - items: - type: string - type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: - additionalProperties: - type: string - type: object - capacity: - additionalProperties: - type: string - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - type: object - type: array - currentVolumeAttributesClassName: - type: string - modifyVolumeStatus: - properties: - status: - type: string - targetVolumeAttributesClassName: - type: string - type: object - phase: - type: string + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer type: object type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - volumes: - description: Volumes define list of volumes mounted to pod - items: - properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: properties: - path: - type: string - type: + name: type: string type: object - name: - description: Name of volume + type: array + limits: + additionalProperties: type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: - type: string - readOnly: - type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - type: object - type: array - type: object - allowUnsafeUpgrade: - description: AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed - type: boolean - annotations: - additionalProperties: - type: string - description: Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVC’s, PDB’s). - type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode defines annotations mode which should be use while overriding annotations. - enum: - - disabled - - append - - replace - type: string - architecture: - description: |- - Architecture defines the list of supported architectures. - First element on the list is marked as default architecture. - Possible values are: - - `amd64`: Use processors with the x86-64 architecture. - - `arm64`: Use processors with the 64-bit ARM architecture. - The setting expects a list of strings, but you should only specify a single - list item for the architecture, except when you want to migrate from one - architecture to the other. The first list item defines the new default - architecture for the deployment that you want to migrate to. - items: - type: string - type: array - auth: - description: Authentication holds authentication configuration settings - properties: - jwtSecretName: - description: |- - JWTSecretName setting specifies the name of a kubernetes `Secret` that contains a secret key used for generating - JWT tokens to access all ArangoDB servers. - When no name is specified, it defaults to `-jwt`. - To disable authentication, set this value to `None`. - If you specify a name of a `Secret`, that secret must have the key value in a data field named `token`. - If you specify a name of a `Secret` that does not exist, a random key is created and stored in a `Secret` with given name. - Changing secret key results in restarting of a whole cluster. + type: object + requests: + additionalProperties: + type: string + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group type: string - type: object - bootstrap: - description: Bootstrap contains information for cluster bootstrapping - properties: - passwordSecretNames: - additionalProperties: - type: string + securityContext: description: |- - PasswordSecretNames contains a map of username to password-secret-name - This setting specifies a secret name for the credentials per specific users. - When a deployment is created the operator will setup the user accounts - according to the credentials given by the secret. If the secret doesn't exist - the operator creates a secret with a random password. - There are two magic values for the secret name: - - `None` specifies no action. This disables root password randomization. This is the default value. (Thus the root password is empty - not recommended) - - `Auto` specifies automatic name generation, which is `-root-password`. - type: object - type: object - chaos: - description: ChaosSpec can be used for chaos-monkey testing of your ArangoDeployment - properties: - enabled: - description: Enabled switches the chaos monkey for a deployment on or off. - type: boolean - interval: - description: Interval is the time between events - format: int64 - type: integer - kill-pod-probability: - description: KillPodProbability is the chance of a pod being killed during an event - format: int32 - type: integer - type: object - communicationMethod: - description: CommunicationMethod define communication method used in deployment - enum: - - headless - - dns - - short-dns - - headless-dns - - ip - type: string - coordinators: - description: Coordinators contains specification for Coordinator pods running in deployment mode `Cluster` or `ActiveFailover`. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. properties: - preferredDuringSchedulingIgnoredDuringExecution: + addCapabilities: + description: AddCapabilities add new capabilities to containers items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - weight: - format: int32 - type: integer - type: object + type: string type: array - requiredDuringSchedulingIgnoredDuringExecution: + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. items: - properties: - labelSelector: - properties: - matchExpressions: - items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object + type: object + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + format: int32 + type: integer + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator + type: string + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. + items: + type: string + type: array + sidecars: + description: Sidecars specifies a list of additional containers to be started + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: properties: key: type: string - operator: + name: type: string - values: - items: - type: string - type: array + optional: + type: boolean type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: properties: key: type: string - operator: + name: type: string - values: - items: - type: string - type: array + optional: + type: boolean type: object - type: array - matchLabels: - additionalProperties: + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: type: string - type: object - type: object - namespaces: - items: + optional: + type: boolean + type: object + prefix: type: string - type: array - topologyKey: - type: string - type: object - type: array - type: object - allowMemberRecreation: - description: |- - AllowMemberRecreation allows to recreate member. - This setting changes the member recreation logic based on group: - - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) - - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. - type: boolean - annotations: - additionalProperties: - type: string - description: |- - Annotations specified the annotations added to Pods in this group. - Annotations are merged with `spec.annotations`. - type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode Define annotations mode which should be use while overriding annotations - type: string - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: properties: - podAffinityTerm: + postStart: properties: - labelSelector: + exec: properties: - matchExpressions: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: type: string - type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: items: type: string type: array - topologyKey: - type: string type: object - weight: + failureThreshold: format: int32 type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + grpc: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + port: + format: int32 + type: integer + service: + type: string type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - type: array - type: object - args: - description: Args setting specifies additional command-line arguments passed to all servers of this group. - items: - type: string - type: array - count: - description: |- - Count setting specifies the number of servers to start for the given group. - For the Agent group, this value must be a positive, odd number. - The default value is `3` for all groups except `single` (there the default is `1` - for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). - For the `syncworkers` group, it is highly recommended to use the same number - as for the `dbservers` group. - format: int32 - type: integer - entrypoint: - description: Entrypoint overrides container executable - type: string - envs: - description: Envs allow to specify additional envs in this group. - items: - properties: name: type: string - value: - type: string - type: object - type: array - ephemeralVolumes: - description: EphemeralVolumes keeps information about ephemeral volumes. - properties: - apps: - description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. - properties: - size: - description: Size define size of the ephemeral volume - type: string - type: object - temp: - description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. - properties: - size: - description: Size define size of the ephemeral volume - type: string - type: object - type: object - exporterPort: - description: ExporterPort define Port used by exporter - format: int32 - type: integer - extendedRotationCheck: - description: ExtendedRotationCheck extend checks for rotation - type: boolean - externalPortEnabled: - description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members - type: boolean - indexMethod: - description: IndexMethod define group Indexing method - enum: - - random - - ordered - type: string - initContainers: - description: InitContainers Init containers specification - properties: - containers: - description: Containers contains list of containers - items: + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: properties: - args: - items: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: type: string - type: array - command: - items: + restartPolicy: type: string - type: array - env: + type: object + type: array + resources: + properties: + claims: items: properties: name: type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object type: object type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string type: object - livenessProbe: + seccompProfile: properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: format: int32 type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string type: object - name: + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: properties: - port: - format: int32 - type: integer - service: + key: type: string - type: object - httpGet: - properties: - host: + operator: type: string - httpHeaders: + values: items: - properties: - name: - type: string - value: - type: string - type: object + type: string type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string type: object - resizePolicy: + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: items: properties: - resourceName: + key: type: string - restartPolicy: + mode: + format: int32 + type: integer + path: type: string type: object type: array - resources: - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: type: string - type: object - requests: - additionalProperties: + mode: + format: int32 + type: integer + path: type: string - type: object - type: object - restartPolicy: + type: object + type: array + optional: + type: boolean + secretName: type: string - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: + type: object + type: object + type: array + type: object + disableIPv6: + description: |- + DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. + This setting cannot be changed after the deployment has been created. + type: boolean + downtimeAllowed: + description: |- + DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. + When this setting is set to false, no automatic action that may result in downtime is allowed. + If the need for such an action is detected, an event is added to the ArangoDeployment. + Once this setting is set to true, the automatic action is executed. + Operations that may result in downtime are: + - Rotating TLS CA certificate + Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. + type: boolean + environment: + description: Environment setting specifies the type of environment in which the deployment is created. + enum: + - Development + - Production + type: string + externalAccess: + description: ExternalAccess holds configuration for the external access provided for the deployment. + properties: + advertisedEndpoint: + description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint + type: string + loadBalancerIP: + description: |- + LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. + If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. + type: string + loadBalancerSourceRanges: + description: |- + LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type + If specified and supported by the platform, this will restrict traffic through the cloud-provider + load-balancer will be restricted to the specified client IPs. This field will be ignored if the + cloud-provider does not support the feature. + items: + type: string + type: array + managedServiceNames: + description: |- + ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. + It is only relevant when type of service is `managed`. + items: + type: string + type: array + nodePort: + description: |- + NodePort define optional port used in case of Auto or NodePort type. + This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. + If you do not specify this setting, a random port will be chosen automatically. + format: int32 + type: integer + type: + description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. + enum: + - Auto + - None + - LoadBalancer + - NodePort + type: string + type: object + features: + description: Features allows to configure feature flags + properties: + foxx.queues: + type: boolean + type: object + gateway: + description: Gateway defined main Gateway configuration. + properties: + enabled: + type: boolean + type: object + gateways: + description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: properties: - exec: + labelSelector: properties: - command: + matchExpressions: items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - httpGet: + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: properties: - host: - type: string - httpHeaders: + matchExpressions: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string + matchLabels: + additionalProperties: + type: string + type: object type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: + matchLabelKeys: items: - properties: - devicePath: - type: string - name: - type: string - type: object + type: string type: array - volumeMounts: + mismatchLabelKeys: items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - type: object + type: object + type: object + namespaces: + items: + type: string type: array - workingDir: + topologyKey: type: string type: object type: array - mode: - description: Mode keep container replace mode - type: string type: object - internalPort: - description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - format: int32 - type: integer - internalPortProtocol: - description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - type: string - labels: + allowMemberRecreation: + description: |- + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: additionalProperties: type: string - description: Labels specified the labels added to Pods in this group. + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored items: type: string type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations type: string - maxCount: - description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. - format: int32 - type: integer - memoryReservation: - description: |- - MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. - If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. - Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. - format: int64 - type: integer - minCount: - description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. - format: int32 - type: integer - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: - preference: + podAffinityTerm: properties: - matchExpressions: - items: - properties: - key: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - operator: + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object - type: array - matchFields: + type: object + type: object + namespaces: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object + type: string type: array + topologyKey: + type: string type: object weight: format: int32 @@ -17054,9 +22811,9 @@ v1alpha: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: + items: + properties: + labelSelector: properties: matchExpressions: items: @@ -17071,7 +22828,22 @@ v1alpha: type: array type: object type: array - matchFields: + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: items: properties: key: @@ -17084,439 +22856,499 @@ v1alpha: type: array type: object type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. - type: object - numactl: - description: Numactl define Numactl options passed to the process - properties: - args: - description: Args define list of the numactl process - items: - type: string + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object type: array - enabled: - description: Enabled define if numactl should be enabled - type: boolean - path: - description: Path define numactl path within the container - type: string type: object - overrideDetectedNumberOfCores: - description: |- - OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. - If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. - type: boolean - overrideDetectedTotalMemory: + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: description: |- - OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. - If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. - type: boolean - podModes: - description: PodModes define additional modes enabled on the Pod level - properties: - network: - type: string - pid: - type: string - type: object - port: - description: Port define Port used by member + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. format: int32 type: integer - priorityClassName: - description: |- - PriorityClassName specifies a priority class name - Will be forwarded to the pod spec. - type: string - probes: - description: Probes specifies additional behaviour for probes - properties: - ReadinessProbeDisabled: - description: OldReadinessProbeDisabled if true readinessProbes are disabled - type: boolean - livenessProbeDisabled: - description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - type: boolean - livenessProbeSpec: - description: LivenessProbeSpec override liveness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - readinessProbeDisabled: - description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - type: boolean - readinessProbeSpec: - description: ReadinessProbeSpec override readiness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - startupProbeDisabled: - description: StartupProbeDisabled if true startupProbes are disabled - type: boolean - startupProbeSpec: - description: StartupProbeSpec override startup probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - type: object - pvcResizeMode: - description: VolumeResizeMode specified resize mode for PVCs and PVs - enum: - - runtime - - rotate + entrypoint: + description: Entrypoint overrides container executable type: string - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: + envs: + description: Envs allow to specify additional envs in this group. + items: + properties: + name: type: string - type: object - requests: - additionalProperties: + value: type: string - type: object - type: object - schedulerName: - description: SchedulerName define scheduler name used for group - type: string - securityContext: - description: |- - SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. - This is similar (but not fully compatible) to k8s SecurityContext definition. + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers - items: - type: string - type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: - description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers - type: boolean - fsGroup: - description: FSGroup is a special supplemental group that applies to all containers in a pod. - format: int64 - type: integer - privileged: - description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 - type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - level: - type: string - role: - type: string - type: - type: string - user: + size: + description: Size define size of the ephemeral volume type: string type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. properties: - localhostProfile: - type: string - type: + size: + description: Size define size of the ephemeral volume type: string type: object - supplementalGroups: - description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. - items: - format: int64 - type: integer - type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object type: object - serviceAccountName: - description: |- - ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created - for each server of this group. If empty, it defaults to using the - `default` service account. - Using an alternative `ServiceAccount` is typically used to separate access rights. - The ArangoDB deployments need some very minimal access rights. With the - deployment of the operator, we grant the rights to 'get' all 'pod' resources. - If you are using a different service account, please grant these rights - to that service account. - type: string - shutdownDelay: - description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + exporterPort: + description: ExporterPort define Port used by exporter format: int32 type: integer - shutdownMethod: - description: ShutdownMethod describe procedure of member shutdown taken by Operator + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered type: string - sidecarCoreNames: - description: |- - SidecarCoreNames is a list of sidecar containers which must run in the pod. - Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. - items: - type: string - type: array - sidecars: - description: Sidecars specifies a list of additional containers to be started - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers + items: + properties: + args: + items: type: string - value: + type: array + command: + items: type: string - valueFrom: + type: array + env: + items: properties: - configMapKeyRef: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - key: - type: string name: type: string optional: type: boolean type: object - fieldRef: + prefix: + type: string + secretRef: properties: - apiVersion: - type: string - fieldPath: + name: type: string + optional: + type: boolean type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: type: string - resource: + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: type: string - type: object - secretKeyRef: + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: properties: - key: - type: string name: type: string - optional: - type: boolean type: object - type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: + type: array + limits: + additionalProperties: type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: + type: object + requests: + additionalProperties: type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: + type: object + type: object + restartPolicy: + type: string + securityContext: properties: - exec: + allowPrivilegeEscalation: + type: boolean + capabilities: properties: - command: + add: + items: + type: string + type: array + drop: items: type: string type: array type: object - httpGet: + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: properties: - host: + level: type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: + role: type: string - port: + type: type: string - x-kubernetes-int-or-string: true - scheme: + user: type: string type: object - sleep: + seccompProfile: properties: - seconds: - format: int64 - type: integer + localhostProfile: + type: string + type: + type: string type: object - tcpSocket: + windowsOptions: properties: - host: + gmsaCredentialSpec: type: string - port: + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: type: string - x-kubernetes-int-or-string: true type: object type: object - preStop: + startupProbe: properties: exec: properties: @@ -17525,6 +23357,17 @@ v1alpha: type: string type: array type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object httpGet: properties: host: @@ -17546,12 +23389,15 @@ v1alpha: scheme: type: string type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer tcpSocket: properties: host: @@ -17560,1630 +23406,2071 @@ v1alpha: type: string x-kubernetes-int-or-string: true type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: - properties: - claims: + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: items: properties: + devicePath: + type: string name: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - restartPolicy: - type: string - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: + volumeMounts: + items: + properties: + mountPath: type: string - type: array - drop: - items: + mountPropagation: type: string - type: array - type: object - privileged: - type: boolean - procMount: + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object type: object - startupProbe: + type: array + mode: + description: Mode keep container replace mode + type: string + type: object + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + type: string + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + format: int32 + type: integer + memoryReservation: + description: |- + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: properties: - exec: + preference: properties: - command: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: + matchFields: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: + weight: format: int32 type: integer - tcpSocket: + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: + type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string + type: object + overrideDetectedNumberOfCores: description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. type: boolean - volumeClaimTemplate: + overrideDetectedTotalMemory: description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level properties: - apiVersion: + network: type: string - kind: + pid: type: string - metadata: + type: object + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. + type: string + probes: + description: Probes specifies additional behaviour for probes + properties: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration properties: - annotations: - additionalProperties: - type: string - type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: - format: int64 + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: - type: string - type: array - generateName: - type: string - generation: - format: int64 + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 type: integer - labels: - additionalProperties: + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + type: object + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: type: string - type: object - managedFields: - items: - properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: - type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string - type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: - items: - properties: - apiVersion: - type: string - blockOwnerDeletion: - type: boolean - controller: - type: boolean - kind: - type: string - name: - type: string - uid: - type: string - type: object - type: array - resourceVersion: - type: string - selfLink: - type: string - uid: - type: string + type: object + type: array + limits: + additionalProperties: + type: string type: object - spec: + requests: + additionalProperties: + type: string + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group + type: string + securityContext: + description: |- + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. + properties: + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - type: object - resources: - properties: - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: + level: type: string - volumeAttributesClassName: + role: type: string - volumeMode: + type: type: string - volumeName: + user: type: string type: object - status: + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. properties: - accessModes: - items: - type: string - type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: - additionalProperties: - type: string - type: object - capacity: - additionalProperties: - type: string - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - type: object - type: array - currentVolumeAttributesClassName: + localhostProfile: type: string - modifyVolumeStatus: - properties: - status: - type: string - targetVolumeAttributesClassName: - type: string - type: object - phase: + type: type: string type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. + type: string + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + format: int32 + type: integer + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator + type: string + sidecarCoreNames: + description: |- + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object + type: string type: array - volumes: - description: Volumes define list of volumes mounted to pod + sidecars: + description: Sidecars specifies a list of additional containers to be started items: properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object type: object - type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath - properties: - path: - type: string - type: - type: string - type: object - name: - description: Name of volume - type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: - type: string - readOnly: - type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - key: + name: type: string - mode: - format: int32 - type: integer - path: + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: type: string + optional: + type: boolean type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - type: object - type: array - type: object - database: - description: Database holds information about database state, like maintenance mode - properties: - maintenance: - description: Maintenance manage maintenance mode on Cluster side. Requires maintenance feature to be enabled - type: boolean - type: object - dbservers: - description: DBServers contains specification for DBServer pods running in deployment mode `Cluster` or `ActiveFailover`. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: properties: - podAffinityTerm: + postStart: properties: - labelSelector: + exec: properties: - matchExpressions: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: type: string - type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: items: type: string type: array - topologyKey: - type: string type: object - weight: + failureThreshold: format: int32 type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + grpc: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + port: + format: int32 + type: integer + service: + type: string type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - type: array - type: object - allowMemberRecreation: - description: |- - AllowMemberRecreation allows to recreate member. - This setting changes the member recreation logic based on group: - - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) - - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. - type: boolean - annotations: - additionalProperties: - type: string - description: |- - Annotations specified the annotations added to Pods in this group. - Annotations are merged with `spec.annotations`. - type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode Define annotations mode which should be use while overriding annotations - type: string - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: items: type: string type: array - topologyKey: - type: string type: object - weight: + failureThreshold: format: int32 type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: + grpc: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + port: + format: int32 + type: integer + service: + type: string type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - type: array - type: object - args: - description: Args setting specifies additional command-line arguments passed to all servers of this group. - items: - type: string - type: array - count: - description: |- - Count setting specifies the number of servers to start for the given group. - For the Agent group, this value must be a positive, odd number. - The default value is `3` for all groups except `single` (there the default is `1` - for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). - For the `syncworkers` group, it is highly recommended to use the same number - as for the `dbservers` group. - format: int32 - type: integer - entrypoint: - description: Entrypoint overrides container executable - type: string - envs: - description: Envs allow to specify additional envs in this group. - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - ephemeralVolumes: - description: EphemeralVolumes keeps information about ephemeral volumes. - properties: - apps: - description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. - properties: - size: - description: Size define size of the ephemeral volume - type: string - type: object - temp: - description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. - properties: - size: - description: Size define size of the ephemeral volume - type: string - type: object - type: object - exporterPort: - description: ExporterPort define Port used by exporter - format: int32 - type: integer - extendedRotationCheck: - description: ExtendedRotationCheck extend checks for rotation - type: boolean - externalPortEnabled: - description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members - type: boolean - indexMethod: - description: IndexMethod define group Indexing method - enum: - - random - - ordered - type: string - initContainers: - description: InitContainers Init containers specification - properties: - containers: - description: Containers contains list of containers - items: - properties: - args: - items: + resizePolicy: + items: + properties: + resourceName: type: string - type: array - command: - items: + restartPolicy: type: string - type: array - env: + type: object + type: array + resources: + properties: + claims: items: properties: name: type: string - value: + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: properties: name: type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: + value: type: string - optional: - type: boolean type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string type: object - livenessProbe: + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: properties: - port: - format: int32 - type: integer - service: + key: type: string - type: object - httpGet: - properties: - host: + operator: type: string - httpHeaders: + values: items: - properties: - name: - type: string - value: - type: string - type: object + type: string type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string type: object - name: - type: string - ports: + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: items: properties: - containerPort: + key: + type: string + mode: format: int32 type: integer - hostIP: + path: type: string - hostPort: + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: format: int32 type: integer - name: - type: string - protocol: + path: type: string type: object type: array - readinessProbe: + optional: + type: boolean + secretName: + type: string + type: object + type: object + type: array + type: object + id: + description: ServerIDGroupSpec contains the specification for Image Discovery image. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: properties: - exec: + labelSelector: properties: - command: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array + matchLabels: + additionalProperties: + type: string + type: object type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: properties: - host: - type: string - httpHeaders: + matchExpressions: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string + matchLabels: + additionalProperties: + type: string + type: object type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer type: object - resizePolicy: + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object + type: string type: array - resources: + namespaceSelector: properties: - claims: + matchExpressions: items: properties: - name: + key: + type: string + operator: type: string + values: + items: + type: string + type: array type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: + matchLabels: additionalProperties: type: string type: object type: object - restartPolicy: + namespaces: + items: + type: string + type: array + topologyKey: type: string - securityContext: + type: object + type: array + type: object + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: properties: - allowPrivilegeEscalation: - type: boolean - capabilities: + labelSelector: properties: - add: - items: - type: string - type: array - drop: + matchExpressions: items: - type: string + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: + matchLabels: + additionalProperties: type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string + type: object type: object - httpGet: + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: properties: - host: - type: string - httpHeaders: + matchExpressions: items: properties: - name: + key: type: string - value: + operator: type: string + values: + items: + type: string + type: array type: object type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string + matchLabels: + additionalProperties: + type: string + type: object type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: + matchLabelKeys: items: - properties: - devicePath: - type: string - name: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - type: object - type: array - volumeMounts: + type: object + type: object + namespaces: items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object + type: string type: array - workingDir: + topologyKey: + type: string + type: object + type: array + type: object + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + entrypoint: + description: Entrypoint overrides container executable + type: string + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector specifies a set of selectors for nodes + type: object + priorityClassName: + description: PriorityClassName specifies a priority class name + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + securityContext: + description: SecurityContext specifies security context for group + properties: + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object + type: object + serviceAccountName: + description: ServiceAccountName specifies the name of the service account used for Pods in this group. + type: string + tolerations: + description: Tolerations specifies the tolerations added to Pods in this group. + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + type: object + image: + description: |- + Image specifies the docker image to use for all ArangoDB servers. + In a development environment this setting defaults to arangodb/arangodb:latest. + For production environments this is a required setting without a default value. + It is highly recommend to use explicit version (not latest) for production environments. + type: string + imageDiscoveryMode: + description: ImageDiscoveryMode specifies the image discovery mode. + enum: + - kubelet + - direct + type: string + imagePullPolicy: + description: ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers. + enum: + - Always + - Never + - IfNotPresent + type: string + imagePullSecrets: + description: ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers. + items: + type: string + type: array + labels: + additionalProperties: + type: string + description: Labels specifies the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + enum: + - disabled + - append + - replace + type: string + license: + description: License holds license settings + properties: + secretName: + description: |- + SecretName setting specifies the name of a kubernetes `Secret` that contains + the license key token used for enterprise images. This value is not used for + the Community Edition. + type: string + type: object + lifecycle: + description: Lifecycle holds lifecycle configuration settings + properties: + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: type: string type: object type: array - mode: - description: Mode keep container replace mode + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + type: object + memberPropagationMode: + description: |- + MemberPropagationMode defines how changes to pod spec should be propogated. + Changes to a pod’s configuration require a restart of that pod in almost all cases. + Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator. + The propagation of the configuration changes can be deferred to the next restart, either triggered manually by the user or by another operation like an upgrade. + This reduces the number of restarts for upgrading both the server and the operator from two to one. + enum: + - always + - on-restart + type: string + metrics: + description: Metrics holds metrics configuration settings + properties: + authentication: + properties: + jwtTokenSecretName: + description: JWTTokenSecretName contains the name of the JWT kubernetes secret used for authentication type: string type: object - internalPort: - description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - format: int32 - type: integer - internalPortProtocol: - description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members - type: string - labels: - additionalProperties: - type: string - description: Labels specified the labels added to Pods in this group. + enabled: + description: |- + Enabled if this is set to `true`, the operator runs a sidecar container for + every Agent, DB-Server, Coordinator and Single server. + type: boolean + extensions: + description: Extensions keeps the information about Metrics Extensions + properties: + usageMetrics: + description: UsageMetrics enables ArangoDB Usage metrics scrape. Affects only DBServers in the Cluster mode. + type: boolean type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored - items: - type: string - type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels + image: + description: Image used for the Metrics Sidecar type: string - maxCount: - description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + mode: + description: Mode define metrics exported mode + type: string + port: format: int32 type: integer - memoryReservation: + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + serviceMonitor: + properties: + enabled: + type: boolean + labels: + additionalProperties: + type: string + type: object + type: object + tls: description: |- - MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. - If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. - Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. - format: int64 - type: integer - minCount: - description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + TLS defines if TLS should be enabled on Metrics exporter endpoint. + This option will enable TLS only if TLS is enabled on ArangoDeployment, + otherwise `true` value will not take any effect. + type: boolean + type: object + mode: + description: Mode specifies the type of ArangoDB deployment to create. + enum: + - Cluster + - ActiveFailover + - Single + type: string + networkAttachedVolumes: + description: |- + NetworkAttachedVolumes + If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation). + Furthermore, the pod will simply be redeployed on a different node, rather than cleaned and retired and replaced by a new member. + You must only set this option to true if your persistent volumes are “movable” in the sense that they can be mounted from a different k8s node, like in the case of network attached volumes. + If your persistent volumes are tied to a specific pod, you must leave this option on false. + type: boolean + rebalancer: + description: Rebalancer defines the rebalancer specification + properties: + enabled: + type: boolean + optimizers: + properties: + leader: + type: boolean + type: object + parallelMoves: format: int32 type: integer - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + readers: + properties: + count: + description: Count Enable Shard Count machanism + type: boolean + type: object + type: object + recovery: + description: Recovery specifies configuration related to cluster recovery. + properties: + autoRecover: + type: boolean + type: object + restoreEncryptionSecret: + description: RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore + type: string + restoreFrom: + description: |- + RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from. + After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key. + It will contain some of the following fields: + - `requestedFrom`: name of the ArangoBackup used to restore from. + - `message`: optional message explaining why the restore failed. + - `state`: state indicating if the restore was successful or not. Possible values: Restoring, Restored, RestoreFailed + If the restoreFrom key is removed from the spec, the restore key is deleted as well. + A new restore attempt is made if and only if either in the status restore is not set or if spec.restoreFrom and status.requestedFrom are different. + type: string + rocksdb: + description: RocksDB holds rocksdb-specific configuration settings + properties: + encryption: + properties: + keySecretName: + description: |- + KeySecretName setting specifies the name of a Kubernetes `Secret` that contains an encryption key used for encrypting all data stored by ArangoDB servers. + When an encryption key is used, encryption of the data in the cluster is enabled, without it encryption is disabled. + The default value is empty. + This requires the Enterprise Edition. + The encryption key cannot be changed after the cluster has been created. + The secret specified by this setting, must have a data field named 'key' containing an encryption key that is exactly 32 bytes long. + type: string + type: object + type: object + single: + description: Single contains specification for servers running in deployment mode `Single` or `ActiveFailover`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions properties: preferredDuringSchedulingIgnoredDuringExecution: items: properties: - preference: + podAffinityTerm: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string type: array - matchFields: + mismatchLabelKeys: items: - properties: - key: - type: string - operator: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - values: - items: - type: string - type: array - type: object + type: object + type: object + namespaces: + items: + type: string type: array + topologyKey: + type: string type: object weight: format: int32 @@ -19191,424 +25478,457 @@ v1alpha: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: + items: + properties: + labelSelector: properties: matchExpressions: items: properties: key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. - type: object - numactl: - description: Numactl define Numactl options passed to the process - properties: - args: - description: Args define list of the numactl process - items: - type: string - type: array - enabled: - description: Enabled define if numactl should be enabled - type: boolean - path: - description: Path define numactl path within the container - type: string - type: object - overrideDetectedNumberOfCores: - description: |- - OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. - If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. - type: boolean - overrideDetectedTotalMemory: - description: |- - OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. - If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. - type: boolean - podModes: - description: PodModes define additional modes enabled on the Pod level - properties: - network: - type: string - pid: - type: string - type: object - port: - description: Port define Port used by member - format: int32 - type: integer - priorityClassName: - description: |- - PriorityClassName specifies a priority class name - Will be forwarded to the pod spec. - type: string - probes: - description: Probes specifies additional behaviour for probes - properties: - ReadinessProbeDisabled: - description: OldReadinessProbeDisabled if true readinessProbes are disabled - type: boolean - livenessProbeDisabled: - description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group - type: boolean - livenessProbeSpec: - description: LivenessProbeSpec override liveness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - readinessProbeDisabled: - description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility - type: boolean - readinessProbeSpec: - description: ReadinessProbeSpec override readiness probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - startupProbeDisabled: - description: StartupProbeDisabled if true startupProbes are disabled - type: boolean - startupProbeSpec: - description: StartupProbeSpec override startup probe configuration - properties: - failureThreshold: - description: |- - FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. - Giving up means restarting the container. - Minimum value is 1. - format: int32 - type: integer - initialDelaySeconds: - description: |- - InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. - Minimum value is 0. - format: int32 - type: integer - periodSeconds: - description: |- - PeriodSeconds How often (in seconds) to perform the probe. - Minimum value is 1. - format: int32 - type: integer - successThreshold: - description: |- - SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. - Minimum value is 1. - format: int32 - type: integer - timeoutSeconds: - description: |- - TimeoutSeconds specifies number of seconds after which the probe times out - Minimum value is 1. - format: int32 - type: integer - type: object - type: object - pvcResizeMode: - description: VolumeResizeMode specified resize mode for PVCs and PVs - enum: - - runtime - - rotate - type: string - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: - properties: - name: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object type: object - schedulerName: - description: SchedulerName define scheduler name used for group - type: string - securityContext: + allowMemberRecreation: description: |- - SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. - This is similar (but not fully compatible) to k8s SecurityContext definition. + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: + additionalProperties: + type: string + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. + type: object + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations + type: string + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers + preferredDuringSchedulingIgnoredDuringExecution: items: - type: string + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: - description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers - type: boolean - fsGroup: - description: FSGroup is a special supplemental group that applies to all containers in a pod. - format: int64 - type: integer - privileged: - description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 - type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. - properties: - localhostProfile: - type: string - type: - type: string - type: object - supplementalGroups: - description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + requiredDuringSchedulingIgnoredDuringExecution: items: - format: int64 - type: integer + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object type: object - serviceAccountName: + args: + description: Args setting specifies additional command-line arguments passed to all servers of this group. + items: + type: string + type: array + count: description: |- - ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created - for each server of this group. If empty, it defaults to using the - `default` service account. - Using an alternative `ServiceAccount` is typically used to separate access rights. - The ArangoDB deployments need some very minimal access rights. With the - deployment of the operator, we grant the rights to 'get' all 'pod' resources. - If you are using a different service account, please grant these rights - to that service account. - type: string - shutdownDelay: - description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + Count setting specifies the number of servers to start for the given group. + For the Agent group, this value must be a positive, odd number. + The default value is `3` for all groups except `single` (there the default is `1` + for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). + For the `syncworkers` group, it is highly recommended to use the same number + as for the `dbservers` group. format: int32 type: integer - shutdownMethod: - description: ShutdownMethod describe procedure of member shutdown taken by Operator + entrypoint: + description: Entrypoint overrides container executable type: string - sidecarCoreNames: - description: |- - SidecarCoreNames is a list of sidecar containers which must run in the pod. - Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. - items: - type: string - type: array - sidecars: - description: Sidecars specifies a list of additional containers to be started + envs: + description: Envs allow to specify additional envs in this group. items: properties: - args: - items: + name: + type: string + value: + type: string + type: object + type: array + ephemeralVolumes: + description: EphemeralVolumes keeps information about ephemeral volumes. + properties: + apps: + description: Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume type: string - type: array - command: - items: + type: object + temp: + description: Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled. + properties: + size: + description: Size define size of the ephemeral volume type: string - type: array - env: - items: - properties: - name: + type: object + type: object + exporterPort: + description: ExporterPort define Port used by exporter + format: int32 + type: integer + extendedRotationCheck: + description: ExtendedRotationCheck extend checks for rotation + type: boolean + externalPortEnabled: + description: ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members + type: boolean + indexMethod: + description: IndexMethod define group Indexing method + enum: + - random + - ordered + type: string + initContainers: + description: InitContainers Init containers specification + properties: + containers: + description: Containers contains list of containers + items: + properties: + args: + items: type: string - value: + type: array + command: + items: type: string - valueFrom: + type: array + env: + items: properties: - configMapKeyRef: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - key: - type: string name: type: string optional: type: boolean type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: + prefix: + type: string + secretRef: properties: - key: - type: string name: type: string optional: type: boolean type: object type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: properties: exec: properties: @@ -19617,6 +25937,17 @@ v1alpha: type: string type: array type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object httpGet: properties: host: @@ -19638,12 +25969,15 @@ v1alpha: scheme: type: string type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer tcpSocket: properties: host: @@ -19652,8 +25986,33 @@ v1alpha: type: string x-kubernetes-int-or-string: true type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - preStop: + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: properties: exec: properties: @@ -19662,6 +26021,17 @@ v1alpha: type: string type: array type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object httpGet: properties: host: @@ -19670,1472 +26040,1654 @@ v1alpha: items: properties: name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: format: int32 type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: - properties: - resourceName: - type: string - restartPolicy: - type: string - type: object - type: array - resources: - properties: - claims: + resizePolicy: items: properties: - name: + resourceName: + type: string + restartPolicy: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - restartPolicy: - type: string - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: + resources: properties: - add: + claims: items: - type: string + properties: + name: + type: string + type: object type: array - drop: - items: + limits: + additionalProperties: type: string - type: array + type: object + requests: + additionalProperties: + type: string + type: object type: object - privileged: - type: boolean - procMount: + restartPolicy: type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: + securityContext: properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: + allowPrivilegeEscalation: type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: + capabilities: + properties: + add: + items: type: string - value: + type: array + drop: + items: type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: + type: array + type: object + privileged: + type: boolean + procMount: type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: + startupProbe: properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: - type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: - description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume - type: boolean - volumeClaimTemplate: - description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. - properties: - apiVersion: - type: string - kind: - type: string - metadata: - properties: - annotations: - additionalProperties: + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: type: string - type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: - format: int64 - type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: + terminationMessagePolicy: type: string - type: array - generateName: - type: string - generation: - format: int64 - type: integer - labels: - additionalProperties: + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: type: string - type: object - managedFields: - items: + type: object + type: array + mode: + description: Mode keep container replace mode + type: string + type: object + internalPort: + description: InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + format: int32 + type: integer + internalPortProtocol: + description: InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members + type: string + labels: + additionalProperties: + type: string + description: Labels specified the labels added to Pods in this group. + type: object + labelsIgnoreList: + description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored + items: + type: string + type: array + labelsMode: + description: LabelsMode Define labels mode which should be use while overriding labels + type: string + maxCount: + description: MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. + format: int32 + type: integer + memoryReservation: + description: |- + MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. + If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. + Accepted Range <0, 50>. If the value is outside the accepted range, it is adjusted to the closest value. + format: int64 + type: integer + minCount: + description: MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. + format: int32 + type: integer + nodeAffinity: + description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: - type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: items: properties: - apiVersion: - type: string - blockOwnerDeletion: - type: boolean - controller: - type: boolean - kind: - type: string - name: - type: string - uid: - type: string + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array type: object type: array - resourceVersion: - type: string - selfLink: - type: string - uid: - type: string type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - type: object - resources: - properties: - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeAttributesClassName: - type: string - volumeMode: - type: string - volumeName: - type: string + type: object + nodeSelector: + additionalProperties: + type: string + description: NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. + type: object + numactl: + description: Numactl define Numactl options passed to the process + properties: + args: + description: Args define list of the numactl process + items: + type: string + type: array + enabled: + description: Enabled define if numactl should be enabled + type: boolean + path: + description: Path define numactl path within the container + type: string + type: object + overrideDetectedNumberOfCores: + description: |- + OverrideDetectedNumberOfCores determines if number of cores should be overridden based on values in resources. + If is set to true and Container CPU Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` to the value from the Container CPU Limits. + type: boolean + overrideDetectedTotalMemory: + description: |- + OverrideDetectedTotalMemory determines if memory should be overridden based on values in resources. + If is set to true and Container Memory Limits are set, it sets Container Environment Variable `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` to the value from the Container Memory Limits. + type: boolean + podModes: + description: PodModes define additional modes enabled on the Pod level + properties: + network: + type: string + pid: + type: string + type: object + port: + description: Port define Port used by member + format: int32 + type: integer + priorityClassName: + description: |- + PriorityClassName specifies a priority class name + Will be forwarded to the pod spec. + type: string + probes: + description: Probes specifies additional behaviour for probes + properties: + ReadinessProbeDisabled: + description: OldReadinessProbeDisabled if true readinessProbes are disabled + type: boolean + livenessProbeDisabled: + description: LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group + type: boolean + livenessProbeSpec: + description: LivenessProbeSpec override liveness probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer type: object - status: + readinessProbeDisabled: + description: ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility + type: boolean + readinessProbeSpec: + description: ReadinessProbeSpec override readiness probe configuration properties: - accessModes: - items: - type: string - type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: - additionalProperties: - type: string - type: object - capacity: - additionalProperties: - type: string - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - type: object - type: array - currentVolumeAttributesClassName: - type: string - modifyVolumeStatus: - properties: - status: - type: string - targetVolumeAttributesClassName: - type: string - type: object - phase: - type: string + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer + type: object + startupProbeDisabled: + description: StartupProbeDisabled if true startupProbes are disabled + type: boolean + startupProbeSpec: + description: StartupProbeSpec override startup probe configuration + properties: + failureThreshold: + description: |- + FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. + Giving up means restarting the container. + Minimum value is 1. + format: int32 + type: integer + initialDelaySeconds: + description: |- + InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. + Minimum value is 0. + format: int32 + type: integer + periodSeconds: + description: |- + PeriodSeconds How often (in seconds) to perform the probe. + Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: |- + SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. + Minimum value is 1. + format: int32 + type: integer + timeoutSeconds: + description: |- + TimeoutSeconds specifies number of seconds after which the probe times out + Minimum value is 1. + format: int32 + type: integer type: object type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - volumes: - description: Volumes define list of volumes mounted to pod - items: - properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath - properties: - path: - type: string - type: - type: string - type: object - name: - description: Name of volume - type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: - type: string - readOnly: - type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - optional: - type: boolean - secretName: + pvcResizeMode: + description: VolumeResizeMode specified resize mode for PVCs and PVs + enum: + - runtime + - rotate + type: string + resources: + description: Resources holds resource requests & limits + properties: + claims: + items: + properties: + name: type: string type: object - type: object - type: array - type: object - disableIPv6: - description: |- - DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. - This setting cannot be changed after the deployment has been created. - type: boolean - downtimeAllowed: - description: |- - DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. - When this setting is set to false, no automatic action that may result in downtime is allowed. - If the need for such an action is detected, an event is added to the ArangoDeployment. - Once this setting is set to true, the automatic action is executed. - Operations that may result in downtime are: - - Rotating TLS CA certificate - Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. - type: boolean - environment: - description: Environment setting specifies the type of environment in which the deployment is created. - enum: - - Development - - Production - type: string - externalAccess: - description: ExternalAccess holds configuration for the external access provided for the deployment. - properties: - advertisedEndpoint: - description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + schedulerName: + description: SchedulerName define scheduler name used for group type: string - loadBalancerIP: + securityContext: description: |- - LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. - If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. + SecurityContext specifies additional `securityContext` settings in ArangoDB Pod definitions. + This is similar (but not fully compatible) to k8s SecurityContext definition. + properties: + addCapabilities: + description: AddCapabilities add new capabilities to containers + items: + type: string + type: array + allowPrivilegeEscalation: + description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. + type: boolean + dropAllCapabilities: + description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers + type: boolean + fsGroup: + description: FSGroup is a special supplemental group that applies to all containers in a pod. + format: int64 + type: integer + privileged: + description: |- + Privileged If true, runs container in privileged mode. Processes in privileged containers are + essentially equivalent to root on the host. + type: boolean + readOnlyRootFilesystem: + description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. + type: boolean + runAsGroup: + description: RunAsGroup is the GID to run the entrypoint of the container process. + format: int64 + type: integer + runAsNonRoot: + description: RunAsNonRoot if true, indicates that the container must run as a non-root user. + type: boolean + runAsUser: + description: RunAsUser is the UID to run the entrypoint of the container process. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to the container + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + description: |- + SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. + items: + format: int64 + type: integer + type: array + sysctls: + additionalProperties: + type: string + x-kubernetes-int-or-string: true + description: |- + Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail to launch. + Map Value can be String or Int + type: object + type: object + serviceAccountName: + description: |- + ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created + for each server of this group. If empty, it defaults to using the + `default` service account. + Using an alternative `ServiceAccount` is typically used to separate access rights. + The ArangoDB deployments need some very minimal access rights. With the + deployment of the operator, we grant the rights to 'get' all 'pod' resources. + If you are using a different service account, please grant these rights + to that service account. type: string - loadBalancerSourceRanges: + shutdownDelay: + description: ShutdownDelay define how long operator should delay finalizer removal after shutdown + format: int32 + type: integer + shutdownMethod: + description: ShutdownMethod describe procedure of member shutdown taken by Operator + type: string + sidecarCoreNames: description: |- - LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type - If specified and supported by the platform, this will restrict traffic through the cloud-provider - load-balancer will be restricted to the specified client IPs. This field will be ignored if the - cloud-provider does not support the feature. + SidecarCoreNames is a list of sidecar containers which must run in the pod. + Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. items: type: string type: array - managedServiceNames: - description: |- - ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. - It is only relevant when type of service is `managed`. + sidecars: + description: Sidecars specifies a list of additional containers to be started items: - type: string - type: array - nodePort: - description: |- - NodePort define optional port used in case of Auto or NodePort type. - This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. - If you do not specify this setting, a random port will be chosen automatically. - format: int32 - type: integer - type: - description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. - enum: - - Auto - - None - - LoadBalancer - - NodePort - type: string - type: object - features: - description: Features allows to configure feature flags - properties: - foxx.queues: - type: boolean - type: object - id: - description: ServerIDGroupSpec contains the specification for Image Discovery image. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - type: object - weight: - format: int32 - type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: properties: key: type: string - operator: + name: type: string - values: - items: - type: string - type: array + optional: + type: boolean type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: properties: key: type: string - operator: + name: type: string - values: - items: - type: string - type: array + optional: + type: boolean type: object - type: array - matchLabels: - additionalProperties: + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: type: string - type: object - type: object - namespaces: - items: + optional: + type: boolean + type: object + prefix: type: string - type: array - topologyKey: - type: string - type: object - type: array - type: object - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: properties: - podAffinityTerm: + postStart: properties: - labelSelector: + exec: properties: - matchExpressions: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: type: string - type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: items: type: string type: array - topologyKey: + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: type: string type: object - weight: + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: format: int32 type: integer type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: properties: - labelSelector: + exec: properties: - matchExpressions: + command: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: type: string - type: object + type: array type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + failureThreshold: + format: int32 + type: integer + grpc: properties: - matchExpressions: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - namespaces: - items: + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object type: array - topologyKey: - type: string + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object type: object - type: array - type: object - args: - description: Args setting specifies additional command-line arguments passed to all servers of this group. - items: - type: string - type: array - entrypoint: - description: Entrypoint overrides container executable - type: string - nodeAffinity: - description: NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: + restartPolicy: + type: string + securityContext: properties: - preference: + allowPrivilegeEscalation: + type: boolean + capabilities: properties: - matchExpressions: + add: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object + type: string type: array - matchFields: + drop: items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string type: array type: object - weight: + failureThreshold: format: int32 type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: + grpc: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchFields: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - type: array - type: object - type: object - nodeSelector: - additionalProperties: - type: string - description: NodeSelector specifies a set of selectors for nodes - type: object - priorityClassName: - description: PriorityClassName specifies a priority class name - type: string - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: - properties: - name: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - type: array - limits: - additionalProperties: + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: type: string - type: object - requests: - additionalProperties: + terminationMessagePolicy: type: string - type: object - type: object - securityContext: - description: SecurityContext specifies security context for group - properties: - addCapabilities: - description: AddCapabilities add new capabilities to containers - items: + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: type: string - type: array - allowPrivilegeEscalation: - description: AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. - type: boolean - dropAllCapabilities: - description: DropAllCapabilities specifies if capabilities should be dropped for this pod containers - type: boolean - fsGroup: - description: FSGroup is a special supplemental group that applies to all containers in a pod. - format: int64 - type: integer - privileged: - description: |- - Privileged If true, runs container in privileged mode. Processes in privileged containers are - essentially equivalent to root on the host. - type: boolean - readOnlyRootFilesystem: - description: ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. - type: boolean - runAsGroup: - description: RunAsGroup is the GID to run the entrypoint of the container process. - format: int64 - type: integer - runAsNonRoot: - description: RunAsNonRoot if true, indicates that the container must run as a non-root user. - type: boolean - runAsUser: - description: RunAsUser is the UID to run the entrypoint of the container process. - format: int64 - type: integer - seLinuxOptions: - description: SELinuxOptions are the labels to be applied to the container + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: properties: - level: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: type: string - role: + namespace: type: string - type: + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: type: string - user: + selfLink: + type: string + uid: type: string type: object - seccompProfile: - description: SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. + spec: properties: - localhostProfile: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: type: string - type: + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: type: string type: object - supplementalGroups: - description: |- - SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, - the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. - items: - format: int64 - type: integer - type: array - sysctls: - additionalProperties: - type: string - x-kubernetes-int-or-string: true - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Map Value can be String or Int - type: object - type: object - serviceAccountName: - description: ServiceAccountName specifies the name of the service account used for Pods in this group. - type: string - tolerations: - description: Tolerations specifies the tolerations added to Pods in this group. - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - type: object - image: - description: |- - Image specifies the docker image to use for all ArangoDB servers. - In a development environment this setting defaults to arangodb/arangodb:latest. - For production environments this is a required setting without a default value. - It is highly recommend to use explicit version (not latest) for production environments. - type: string - imageDiscoveryMode: - description: ImageDiscoveryMode specifies the image discovery mode. - enum: - - kubelet - - direct - type: string - imagePullPolicy: - description: ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers. - enum: - - Always - - Never - - IfNotPresent - type: string - imagePullSecrets: - description: ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers. - items: - type: string - type: array - labels: - additionalProperties: - type: string - description: Labels specifies the labels added to Pods in this group. - type: object - labelsIgnoreList: - description: LabelsIgnoreList list regexp or plain definitions which labels should be ignored - items: - type: string - type: array - labelsMode: - description: LabelsMode Define labels mode which should be use while overriding labels - enum: - - disabled - - append - - replace - type: string - license: - description: License holds license settings - properties: - secretName: - description: |- - SecretName setting specifies the name of a kubernetes `Secret` that contains - the license key token used for enterprise images. This value is not used for - the Community Edition. - type: string - type: object - lifecycle: - description: Lifecycle holds lifecycle configuration settings - properties: - resources: - description: Resources holds resource requests & limits - properties: - claims: - items: + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + type: object + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: + type: string + targetVolumeAttributesClassName: + type: string + type: object + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array name: type: string + optional: + type: boolean type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume type: string - type: object - type: object + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + type: object + type: array type: object - memberPropagationMode: - description: |- - MemberPropagationMode defines how changes to pod spec should be propogated. - Changes to a pod’s configuration require a restart of that pod in almost all cases. - Pods are restarted eagerly by default, which can cause more restarts than desired, especially when updating arangod as well as the operator. - The propagation of the configuration changes can be deferred to the next restart, either triggered manually by the user or by another operation like an upgrade. - This reduces the number of restarts for upgrading both the server and the operator from two to one. + storageEngine: + description: StorageEngine specifies the type of storage engine used for all servers in the cluster. enum: - - always - - on-restart + - RocksDB + - MMFiles type: string - metrics: - description: Metrics holds metrics configuration settings + sync: + description: Sync holds Deployment-to-Deployment synchronization configuration settings properties: - authentication: + auth: properties: - jwtTokenSecretName: - description: JWTTokenSecretName contains the name of the JWT kubernetes secret used for authentication + clientCASecretName: + description: |- + ClientCASecretName setting specifies the name of a kubernetes `Secret` that contains + a PEM encoded CA certificate used for client certificate verification + in all ArangoSync master servers. + This is a required setting when `spec.sync.enabled` is `true`. + type: string + jwtSecretName: + description: |- + JWTSecretName setting specifies the name of a kubernetes `Secret` that contains + the JWT token used for accessing all ArangoSync master servers. + When not specified, the `spec.auth.jwtSecretName` value is used. + If you specify a name of a `Secret` that does not exist, a random token is created + and stored in a `Secret` with given name. type: string type: object enabled: description: |- - Enabled if this is set to `true`, the operator runs a sidecar container for - every Agent, DB-Server, Coordinator and Single server. + Enabled setting enables/disables support for data center 2 data center + replication in the cluster. When enabled, the cluster will contain + a number of `syncmaster` & `syncworker` servers. type: boolean - extensions: - description: Extensions keeps the information about Metrics Extensions - properties: - usageMetrics: - description: UsageMetrics enables ArangoDB Usage metrics scrape. Affects only DBServers in the Cluster mode. - type: boolean - type: object - image: - description: Image used for the Metrics Sidecar - type: string - mode: - description: Mode define metrics exported mode - type: string - port: - format: int32 - type: integer - resources: - description: Resources holds resource requests & limits + externalAccess: properties: - claims: + accessPackageSecretNames: + description: |- + AccessPackageSecretNames setting specifies the names of zero of more `Secrets` that will be created by the deployment + operator containing "access packages". An access package contains those `Secrets` that are needed + to access the SyncMasters of this `ArangoDeployment`. + By removing a name from this setting, the corresponding `Secret` is also deleted. + Note that to remove all access packages, leave an empty array in place (`[]`). + Completely removing the setting results in not modifying the list. items: - properties: - name: - type: string - type: object + type: string type: array - limits: - additionalProperties: + advertisedEndpoint: + description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint + type: string + loadBalancerIP: + description: |- + LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. + If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. + type: string + loadBalancerSourceRanges: + description: |- + LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type + If specified and supported by the platform, this will restrict traffic through the cloud-provider + load-balancer will be restricted to the specified client IPs. This field will be ignored if the + cloud-provider does not support the feature. + items: type: string - type: object - requests: - additionalProperties: + type: array + managedServiceNames: + description: |- + ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. + It is only relevant when type of service is `managed`. + items: type: string - type: object - type: object - serviceMonitor: - properties: - enabled: - type: boolean - labels: - additionalProperties: + type: array + masterEndpoint: + description: |- + MasterEndpoint setting specifies the master endpoint(s) advertised by the ArangoSync SyncMasters. + If not set, this setting defaults to: + - If `spec.sync.externalAccess.loadBalancerIP` is set, it defaults to `https://:<8629>`. + - Otherwise it defaults to `https://:<8629>`. + items: type: string - type: object - type: object - tls: - description: |- - TLS defines if TLS should be enabled on Metrics exporter endpoint. - This option will enable TLS only if TLS is enabled on ArangoDeployment, - otherwise `true` value will not take any effect. - type: boolean - type: object - mode: - description: Mode specifies the type of ArangoDB deployment to create. - enum: - - Cluster - - ActiveFailover - - Single - type: string - networkAttachedVolumes: - description: |- - NetworkAttachedVolumes - If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation). - Furthermore, the pod will simply be redeployed on a different node, rather than cleaned and retired and replaced by a new member. - You must only set this option to true if your persistent volumes are “movable” in the sense that they can be mounted from a different k8s node, like in the case of network attached volumes. - If your persistent volumes are tied to a specific pod, you must leave this option on false. - type: boolean - rebalancer: - description: Rebalancer defines the rebalancer specification - properties: - enabled: - type: boolean - optimizers: - properties: - leader: - type: boolean + type: array + nodePort: + description: |- + NodePort define optional port used in case of Auto or NodePort type. + This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. + If you do not specify this setting, a random port will be chosen automatically. + format: int32 + type: integer + type: + description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. + enum: + - Auto + - None + - LoadBalancer + - NodePort + type: string type: object - parallelMoves: - format: int32 - type: integer - readers: + image: + type: string + monitoring: properties: - count: - description: Count Enable Shard Count machanism - type: boolean + tokenSecretName: + description: |- + TokenSecretName setting specifies the name of a kubernetes `Secret` that contains + the bearer token used for accessing all monitoring endpoints of all arangod/arangosync servers. + When not specified, no monitoring token is used. + type: string type: object - type: object - recovery: - description: Recovery specifies configuration related to cluster recovery. - properties: - autoRecover: - type: boolean - type: object - restoreEncryptionSecret: - description: RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore - type: string - restoreFrom: - description: |- - RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from. - After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key. - It will contain some of the following fields: - - `requestedFrom`: name of the ArangoBackup used to restore from. - - `message`: optional message explaining why the restore failed. - - `state`: state indicating if the restore was successful or not. Possible values: Restoring, Restored, RestoreFailed - If the restoreFrom key is removed from the spec, the restore key is deleted as well. - A new restore attempt is made if and only if either in the status restore is not set or if spec.restoreFrom and status.requestedFrom are different. - type: string - rocksdb: - description: RocksDB holds rocksdb-specific configuration settings - properties: - encryption: + tls: properties: - keySecretName: + altNames: description: |- - KeySecretName setting specifies the name of a Kubernetes `Secret` that contains an encryption key used for encrypting all data stored by ArangoDB servers. - When an encryption key is used, encryption of the data in the cluster is enabled, without it encryption is disabled. + AltNames setting specifies a list of alternate names that will be added to all generated + certificates. These names can be DNS names or email addresses. The default value is empty. - This requires the Enterprise Edition. - The encryption key cannot be changed after the cluster has been created. - The secret specified by this setting, must have a data field named 'key' containing an encryption key that is exactly 32 bytes long. + items: + type: string + type: array + caSecretName: + description: |- + CASecretName setting specifies the name of a kubernetes `Secret` that contains + a standard CA certificate + private key used to sign certificates for individual + ArangoDB servers. + When no name is specified, it defaults to `-ca`. + To disable authentication, set this value to `None`. + If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created + and stored in a `Secret` with given name. + The specified `Secret`, must contain the following data fields: + - `ca.crt` PEM encoded public key of the CA certificate + - `ca.key` PEM encoded private key of the CA certificate + type: string + mode: + type: string + sni: + properties: + mapping: + additionalProperties: + items: + type: string + type: array + type: object + type: object + ttl: + description: |- + TTL setting specifies the time to live of all generated server certificates. + When the server certificate is about to expire, it will be automatically replaced + by a new one and the affected server will be restarted. + Note: The time to live of the CA certificate (when created automatically) + will be set to 10 years. type: string type: object type: object - single: - description: Single contains specification for servers running in deployment mode `Single` or `ActiveFailover`. + syncmasters: + description: SyncMasters contains specification for Syncmaster pods running in deployment mode `Cluster`. properties: affinity: description: Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -23264,158 +29816,8 @@ v1alpha: type: object type: array type: object - storageEngine: - description: StorageEngine specifies the type of storage engine used for all servers in the cluster. - enum: - - RocksDB - - MMFiles - type: string - sync: - description: Sync holds Deployment-to-Deployment synchronization configuration settings - properties: - auth: - properties: - clientCASecretName: - description: |- - ClientCASecretName setting specifies the name of a kubernetes `Secret` that contains - a PEM encoded CA certificate used for client certificate verification - in all ArangoSync master servers. - This is a required setting when `spec.sync.enabled` is `true`. - type: string - jwtSecretName: - description: |- - JWTSecretName setting specifies the name of a kubernetes `Secret` that contains - the JWT token used for accessing all ArangoSync master servers. - When not specified, the `spec.auth.jwtSecretName` value is used. - If you specify a name of a `Secret` that does not exist, a random token is created - and stored in a `Secret` with given name. - type: string - type: object - enabled: - description: |- - Enabled setting enables/disables support for data center 2 data center - replication in the cluster. When enabled, the cluster will contain - a number of `syncmaster` & `syncworker` servers. - type: boolean - externalAccess: - properties: - accessPackageSecretNames: - description: |- - AccessPackageSecretNames setting specifies the names of zero of more `Secrets` that will be created by the deployment - operator containing "access packages". An access package contains those `Secrets` that are needed - to access the SyncMasters of this `ArangoDeployment`. - By removing a name from this setting, the corresponding `Secret` is also deleted. - Note that to remove all access packages, leave an empty array in place (`[]`). - Completely removing the setting results in not modifying the list. - items: - type: string - type: array - advertisedEndpoint: - description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint - type: string - loadBalancerIP: - description: |- - LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. - If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. - type: string - loadBalancerSourceRanges: - description: |- - LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type - If specified and supported by the platform, this will restrict traffic through the cloud-provider - load-balancer will be restricted to the specified client IPs. This field will be ignored if the - cloud-provider does not support the feature. - items: - type: string - type: array - managedServiceNames: - description: |- - ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. - It is only relevant when type of service is `managed`. - items: - type: string - type: array - masterEndpoint: - description: |- - MasterEndpoint setting specifies the master endpoint(s) advertised by the ArangoSync SyncMasters. - If not set, this setting defaults to: - - If `spec.sync.externalAccess.loadBalancerIP` is set, it defaults to `https://:<8629>`. - - Otherwise it defaults to `https://:<8629>`. - items: - type: string - type: array - nodePort: - description: |- - NodePort define optional port used in case of Auto or NodePort type. - This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. - If you do not specify this setting, a random port will be chosen automatically. - format: int32 - type: integer - type: - description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. - enum: - - Auto - - None - - LoadBalancer - - NodePort - type: string - type: object - image: - type: string - monitoring: - properties: - tokenSecretName: - description: |- - TokenSecretName setting specifies the name of a kubernetes `Secret` that contains - the bearer token used for accessing all monitoring endpoints of all arangod/arangosync servers. - When not specified, no monitoring token is used. - type: string - type: object - tls: - properties: - altNames: - description: |- - AltNames setting specifies a list of alternate names that will be added to all generated - certificates. These names can be DNS names or email addresses. - The default value is empty. - items: - type: string - type: array - caSecretName: - description: |- - CASecretName setting specifies the name of a kubernetes `Secret` that contains - a standard CA certificate + private key used to sign certificates for individual - ArangoDB servers. - When no name is specified, it defaults to `-ca`. - To disable authentication, set this value to `None`. - If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created - and stored in a `Secret` with given name. - The specified `Secret`, must contain the following data fields: - - `ca.crt` PEM encoded public key of the CA certificate - - `ca.key` PEM encoded private key of the CA certificate - type: string - mode: - type: string - sni: - properties: - mapping: - additionalProperties: - items: - type: string - type: array - type: object - type: object - ttl: - description: |- - TTL setting specifies the time to live of all generated server certificates. - When the server certificate is about to expire, it will be automatically replaced - by a new one and the affected server will be restarted. - Note: The time to live of the CA certificate (when created automatically) - will be set to 10 years. - type: string - type: object - type: object - syncmasters: - description: SyncMasters contains specification for Syncmaster pods running in deployment mode `Cluster`. + syncworkers: + description: SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`. properties: affinity: description: Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -25544,8 +31946,108 @@ v1alpha: type: object type: array type: object - syncworkers: - description: SyncWorkers contains specification for Syncworker pods running in deployment mode `Cluster`. + timeouts: + description: Timeouts object allows to configure various time-outs + properties: + actions: + additionalProperties: + type: object + description: Actions keep map of the actions timeouts. + type: object + maintenanceGracePeriod: + description: MaintenanceGracePeriod action timeout + type: object + type: object + timezone: + description: |- + Timezone if specified, will set a timezone for deployment. + Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` + type: string + tls: + description: TLS holds TLS configuration settings + properties: + altNames: + description: |- + AltNames setting specifies a list of alternate names that will be added to all generated + certificates. These names can be DNS names or email addresses. + The default value is empty. + items: + type: string + type: array + caSecretName: + description: |- + CASecretName setting specifies the name of a kubernetes `Secret` that contains + a standard CA certificate + private key used to sign certificates for individual + ArangoDB servers. + When no name is specified, it defaults to `-ca`. + To disable authentication, set this value to `None`. + If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created + and stored in a `Secret` with given name. + The specified `Secret`, must contain the following data fields: + - `ca.crt` PEM encoded public key of the CA certificate + - `ca.key` PEM encoded private key of the CA certificate + type: string + mode: + type: string + sni: + properties: + mapping: + additionalProperties: + items: + type: string + type: array + type: object + type: object + ttl: + description: |- + TTL setting specifies the time to live of all generated server certificates. + When the server certificate is about to expire, it will be automatically replaced + by a new one and the affected server will be restarted. + Note: The time to live of the CA certificate (when created automatically) + will be set to 10 years. + type: string + type: object + topology: + description: Topology define topology adjustment details, Enterprise only + properties: + enabled: + type: boolean + label: + type: string + zones: + format: int32 + type: integer + type: object + upgrade: + description: Upgrade allows to configure upgrade-related options + properties: + autoUpgrade: + description: AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck) + type: boolean + debugLog: + description: |- + DebugLog flag specifies if containers running upgrade process should print more debugging information. + This applies only to init containers. + type: boolean + type: object + type: object + status: + description: Object with preserved fields for backward compatibility + type: object + x-kubernetes-preserve-unknown-fields: true + type: object +v2alpha1: + openAPIV3Schema: + properties: + spec: + properties: + ClusterDomain: + description: |- + ClusterDomain define domain used in the kubernetes cluster. + Required only of domain is not set to default (cluster.local) + type: string + agents: + description: Agents contains specification for Agency pods running in deployment mode `Cluster` or `ActiveFailover`. properties: affinity: description: Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -27674,108 +34176,97 @@ v1alpha: type: object type: array type: object - timeouts: - description: Timeouts object allows to configure various time-outs - properties: - actions: - additionalProperties: - type: object - description: Actions keep map of the actions timeouts. - type: object - maintenanceGracePeriod: - description: MaintenanceGracePeriod action timeout - type: object + allowUnsafeUpgrade: + description: AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed + type: boolean + annotations: + additionalProperties: + type: string + description: Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVC’s, PDB’s). type: object - timezone: - description: |- - Timezone if specified, will set a timezone for deployment. - Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode defines annotations mode which should be use while overriding annotations. + enum: + - disabled + - append + - replace type: string - tls: - description: TLS holds TLS configuration settings + architecture: + description: |- + Architecture defines the list of supported architectures. + First element on the list is marked as default architecture. + Possible values are: + - `amd64`: Use processors with the x86-64 architecture. + - `arm64`: Use processors with the 64-bit ARM architecture. + The setting expects a list of strings, but you should only specify a single + list item for the architecture, except when you want to migrate from one + architecture to the other. The first list item defines the new default + architecture for the deployment that you want to migrate to. + items: + type: string + type: array + auth: + description: Authentication holds authentication configuration settings properties: - altNames: - description: |- - AltNames setting specifies a list of alternate names that will be added to all generated - certificates. These names can be DNS names or email addresses. - The default value is empty. - items: - type: string - type: array - caSecretName: + jwtSecretName: description: |- - CASecretName setting specifies the name of a kubernetes `Secret` that contains - a standard CA certificate + private key used to sign certificates for individual - ArangoDB servers. - When no name is specified, it defaults to `-ca`. + JWTSecretName setting specifies the name of a kubernetes `Secret` that contains a secret key used for generating + JWT tokens to access all ArangoDB servers. + When no name is specified, it defaults to `-jwt`. To disable authentication, set this value to `None`. - If you specify a name of a `Secret` that does not exist, a self-signed CA certificate + key is created - and stored in a `Secret` with given name. - The specified `Secret`, must contain the following data fields: - - `ca.crt` PEM encoded public key of the CA certificate - - `ca.key` PEM encoded private key of the CA certificate - type: string - mode: + If you specify a name of a `Secret`, that secret must have the key value in a data field named `token`. + If you specify a name of a `Secret` that does not exist, a random key is created and stored in a `Secret` with given name. + Changing secret key results in restarting of a whole cluster. type: string - sni: - properties: - mapping: - additionalProperties: - items: - type: string - type: array - type: object - type: object - ttl: + type: object + bootstrap: + description: Bootstrap contains information for cluster bootstrapping + properties: + passwordSecretNames: + additionalProperties: + type: string description: |- - TTL setting specifies the time to live of all generated server certificates. - When the server certificate is about to expire, it will be automatically replaced - by a new one and the affected server will be restarted. - Note: The time to live of the CA certificate (when created automatically) - will be set to 10 years. - type: string + PasswordSecretNames contains a map of username to password-secret-name + This setting specifies a secret name for the credentials per specific users. + When a deployment is created the operator will setup the user accounts + according to the credentials given by the secret. If the secret doesn't exist + the operator creates a secret with a random password. + There are two magic values for the secret name: + - `None` specifies no action. This disables root password randomization. This is the default value. (Thus the root password is empty - not recommended) + - `Auto` specifies automatic name generation, which is `-root-password`. + type: object type: object - topology: - description: Topology define topology adjustment details, Enterprise only + chaos: + description: ChaosSpec can be used for chaos-monkey testing of your ArangoDeployment properties: enabled: + description: Enabled switches the chaos monkey for a deployment on or off. type: boolean - label: - type: string - zones: - format: int32 + interval: + description: Interval is the time between events + format: int64 type: integer - type: object - upgrade: - description: Upgrade allows to configure upgrade-related options - properties: - autoUpgrade: - description: AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck) - type: boolean - debugLog: - description: |- - DebugLog flag specifies if containers running upgrade process should print more debugging information. - This applies only to init containers. - type: boolean - type: object - type: object - status: - description: Object with preserved fields for backward compatibility - type: object - x-kubernetes-preserve-unknown-fields: true - type: object -v2alpha1: - openAPIV3Schema: - properties: - spec: - properties: - ClusterDomain: - description: |- - ClusterDomain define domain used in the kubernetes cluster. - Required only of domain is not set to default (cluster.local) + kill-pod-probability: + description: KillPodProbability is the chance of a pod being killed during an event + format: int32 + type: integer + type: object + communicationMethod: + description: CommunicationMethod define communication method used in deployment + enum: + - headless + - dns + - short-dns + - headless-dns + - ip type: string - agents: - description: Agents contains specification for Agency pods running in deployment mode `Cluster` or `ActiveFailover`. + coordinators: + description: Coordinators contains specification for Coordinator pods running in deployment mode `Cluster` or `ActiveFailover`. properties: affinity: description: Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -29904,97 +36395,15 @@ v2alpha1: type: object type: array type: object - allowUnsafeUpgrade: - description: AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed - type: boolean - annotations: - additionalProperties: - type: string - description: Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVC’s, PDB’s). - type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode defines annotations mode which should be use while overriding annotations. - enum: - - disabled - - append - - replace - type: string - architecture: - description: |- - Architecture defines the list of supported architectures. - First element on the list is marked as default architecture. - Possible values are: - - `amd64`: Use processors with the x86-64 architecture. - - `arm64`: Use processors with the 64-bit ARM architecture. - The setting expects a list of strings, but you should only specify a single - list item for the architecture, except when you want to migrate from one - architecture to the other. The first list item defines the new default - architecture for the deployment that you want to migrate to. - items: - type: string - type: array - auth: - description: Authentication holds authentication configuration settings - properties: - jwtSecretName: - description: |- - JWTSecretName setting specifies the name of a kubernetes `Secret` that contains a secret key used for generating - JWT tokens to access all ArangoDB servers. - When no name is specified, it defaults to `-jwt`. - To disable authentication, set this value to `None`. - If you specify a name of a `Secret`, that secret must have the key value in a data field named `token`. - If you specify a name of a `Secret` that does not exist, a random key is created and stored in a `Secret` with given name. - Changing secret key results in restarting of a whole cluster. - type: string - type: object - bootstrap: - description: Bootstrap contains information for cluster bootstrapping - properties: - passwordSecretNames: - additionalProperties: - type: string - description: |- - PasswordSecretNames contains a map of username to password-secret-name - This setting specifies a secret name for the credentials per specific users. - When a deployment is created the operator will setup the user accounts - according to the credentials given by the secret. If the secret doesn't exist - the operator creates a secret with a random password. - There are two magic values for the secret name: - - `None` specifies no action. This disables root password randomization. This is the default value. (Thus the root password is empty - not recommended) - - `Auto` specifies automatic name generation, which is `-root-password`. - type: object - type: object - chaos: - description: ChaosSpec can be used for chaos-monkey testing of your ArangoDeployment + database: + description: Database holds information about database state, like maintenance mode properties: - enabled: - description: Enabled switches the chaos monkey for a deployment on or off. + maintenance: + description: Maintenance manage maintenance mode on Cluster side. Requires maintenance feature to be enabled type: boolean - interval: - description: Interval is the time between events - format: int64 - type: integer - kill-pod-probability: - description: KillPodProbability is the chance of a pod being killed during an event - format: int32 - type: integer type: object - communicationMethod: - description: CommunicationMethod define communication method used in deployment - enum: - - headless - - dns - - short-dns - - headless-dns - - ip - type: string - coordinators: - description: Coordinators contains specification for Coordinator pods running in deployment mode `Cluster` or `ActiveFailover`. + dbservers: + description: DBServers contains specification for DBServer pods running in deployment mode `Cluster` or `ActiveFailover`. properties: affinity: description: Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -32123,15 +38532,84 @@ v2alpha1: type: object type: array type: object - database: - description: Database holds information about database state, like maintenance mode + disableIPv6: + description: |- + DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. + This setting cannot be changed after the deployment has been created. + type: boolean + downtimeAllowed: + description: |- + DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. + When this setting is set to false, no automatic action that may result in downtime is allowed. + If the need for such an action is detected, an event is added to the ArangoDeployment. + Once this setting is set to true, the automatic action is executed. + Operations that may result in downtime are: + - Rotating TLS CA certificate + Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. + type: boolean + environment: + description: Environment setting specifies the type of environment in which the deployment is created. + enum: + - Development + - Production + type: string + externalAccess: + description: ExternalAccess holds configuration for the external access provided for the deployment. properties: - maintenance: - description: Maintenance manage maintenance mode on Cluster side. Requires maintenance feature to be enabled + advertisedEndpoint: + description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint + type: string + loadBalancerIP: + description: |- + LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. + If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. + type: string + loadBalancerSourceRanges: + description: |- + LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type + If specified and supported by the platform, this will restrict traffic through the cloud-provider + load-balancer will be restricted to the specified client IPs. This field will be ignored if the + cloud-provider does not support the feature. + items: + type: string + type: array + managedServiceNames: + description: |- + ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. + It is only relevant when type of service is `managed`. + items: + type: string + type: array + nodePort: + description: |- + NodePort define optional port used in case of Auto or NodePort type. + This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. + If you do not specify this setting, a random port will be chosen automatically. + format: int32 + type: integer + type: + description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. + enum: + - Auto + - None + - LoadBalancer + - NodePort + type: string + type: object + features: + description: Features allows to configure feature flags + properties: + foxx.queues: type: boolean type: object - dbservers: - description: DBServers contains specification for DBServer pods running in deployment mode `Cluster` or `ActiveFailover`. + gateway: + description: Gateway defined main Gateway configuration. + properties: + enabled: + type: boolean + type: object + gateways: + description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. properties: affinity: description: Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -34260,76 +40738,6 @@ v2alpha1: type: object type: array type: object - disableIPv6: - description: |- - DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. - This setting cannot be changed after the deployment has been created. - type: boolean - downtimeAllowed: - description: |- - DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. - When this setting is set to false, no automatic action that may result in downtime is allowed. - If the need for such an action is detected, an event is added to the ArangoDeployment. - Once this setting is set to true, the automatic action is executed. - Operations that may result in downtime are: - - Rotating TLS CA certificate - Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. - type: boolean - environment: - description: Environment setting specifies the type of environment in which the deployment is created. - enum: - - Development - - Production - type: string - externalAccess: - description: ExternalAccess holds configuration for the external access provided for the deployment. - properties: - advertisedEndpoint: - description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint - type: string - loadBalancerIP: - description: |- - LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. - If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. - type: string - loadBalancerSourceRanges: - description: |- - LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type - If specified and supported by the platform, this will restrict traffic through the cloud-provider - load-balancer will be restricted to the specified client IPs. This field will be ignored if the - cloud-provider does not support the feature. - items: - type: string - type: array - managedServiceNames: - description: |- - ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. - It is only relevant when type of service is `managed`. - items: - type: string - type: array - nodePort: - description: |- - NodePort define optional port used in case of Auto or NodePort type. - This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. - If you do not specify this setting, a random port will be chosen automatically. - format: int32 - type: integer - type: - description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. - enum: - - Auto - - None - - LoadBalancer - - NodePort - type: string - type: object - features: - description: Features allows to configure feature flags - properties: - foxx.queues: - type: boolean - type: object id: description: ServerIDGroupSpec contains the specification for Image Discovery image. properties: diff --git a/pkg/deployment/features/gateway.go b/pkg/deployment/features/gateway.go new file mode 100644 index 000000000..40173ef50 --- /dev/null +++ b/pkg/deployment/features/gateway.go @@ -0,0 +1,37 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package features + +func init() { + registerFeature(gateway) +} + +var gateway = &feature{ + name: "gateway", + description: "Defines if gateway extension is enabled", + enterpriseRequired: false, + enabledByDefault: false, + hidden: true, +} + +func Gateway() Feature { + return gateway +} diff --git a/pkg/deployment/images.go b/pkg/deployment/images.go index 2dccae605..2f1e016e0 100644 --- a/pkg/deployment/images.go +++ b/pkg/deployment/images.go @@ -81,6 +81,11 @@ type ArangoSyncIdentity struct { interfaces.ContainerCreator } +// GatewayIdentity helps to resolve the Gateway identity, e.g.: image ID, version of the entrypoint. +type GatewayIdentity struct { + interfaces.ContainerCreator +} + type imagesBuilder struct { Log logging.Logger Context resources.Context diff --git a/pkg/deployment/members.go b/pkg/deployment/members.go index a3d20daa4..88982aaa2 100644 --- a/pkg/deployment/members.go +++ b/pkg/deployment/members.go @@ -210,6 +210,16 @@ func (d *Deployment) renderMember(spec api.DeploymentSpec, status *api.Deploymen Image: apiObject.Status.CurrentImage, Architecture: &arch, }, nil + case api.ServerGroupGateways: + d.log.Str("id", id).Debug("Adding gateway") + return &api.MemberStatus{ + ID: id, + UID: uuid.NewUUID(), + CreatedAt: meta.Now(), + Phase: api.MemberPhaseNone, + Image: apiObject.Status.CurrentImage, + Architecture: &arch, + }, nil default: return nil, errors.WithStack(errors.Errorf("Unknown server group %d", group)) } diff --git a/pkg/deployment/pod/utils.go b/pkg/deployment/pod/utils.go index 3ffa5ffa4..f868a3b1f 100644 --- a/pkg/deployment/pod/utils.go +++ b/pkg/deployment/pod/utils.go @@ -43,7 +43,7 @@ func GenerateMemberEndpoint(services service.Inspector, apiObject meta.Object, s func GenerateMemberEndpointFromService(svc *core.Service, apiObject meta.Object, spec api.DeploymentSpec, group api.ServerGroup, member api.MemberStatus) (string, error) { switch group.Type() { - case api.ServerGroupTypeArangoD: + case api.ServerGroupTypeArangoD, api.ServerGroupTypeGateway: switch method := spec.CommunicationMethod.Get(); method { case api.DeploymentCommunicationMethodDNS, api.DeploymentCommunicationMethodHeadlessDNS: return k8sutil.CreateServiceDNSNameWithDomain(svc, spec.ClusterDomain), nil diff --git a/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go b/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go index de7fc772b..cf76139f2 100644 --- a/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go +++ b/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import ( "time" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" ) func (r *Reconciler) createRebalancerV2GeneratePlan(spec api.DeploymentSpec, status api.DeploymentStatus) api.Plan { @@ -44,7 +45,7 @@ func (r *Reconciler) createRebalancerV2GeneratePlan(spec api.DeploymentSpec, sta r.metrics.Rebalancer.SetEnabled(true) - if !status.Members.AllMembersReady(spec.Mode.Get(), spec.Sync.IsEnabled()) { + if !status.Members.AllMembersReady(spec.Mode.Get(), spec.Sync.IsEnabled(), features.Gateway().Enabled() && spec.IsGatewayEnabled()) { return nil } diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go index acda2247f..e652d1f4e 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go @@ -49,6 +49,7 @@ var ( api.ServerGroupDBServers, api.ServerGroupSyncMasters, api.ServerGroupSyncWorkers, + api.ServerGroupGateways, } ) diff --git a/pkg/deployment/reconcile/plan_builder_scale.go b/pkg/deployment/reconcile/plan_builder_scale.go index 86110481f..8ae98d66f 100644 --- a/pkg/deployment/reconcile/plan_builder_scale.go +++ b/pkg/deployment/reconcile/plan_builder_scale.go @@ -25,6 +25,7 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" sharedReconcile "github.com/arangodb/kube-arangodb/pkg/deployment/reconcile/shared" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) @@ -69,6 +70,11 @@ func (r *Reconciler) createScaleMemberPlan(ctx context.Context, apiObject k8suti plan = append(plan, r.createScalePlan(status, status.Members.SyncWorkers, api.ServerGroupSyncWorkers, 0, context)...) } } + if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + plan = append(plan, r.createScalePlan(status, status.Members.Gateways, api.ServerGroupGateways, spec.Gateways.GetCount(), context)...) + } else { + plan = append(plan, r.createScalePlan(status, status.Members.Gateways, api.ServerGroupGateways, 0, context)...) + } return plan } diff --git a/pkg/deployment/resilience/member_failure.go b/pkg/deployment/resilience/member_failure.go index 91529cd8e..0dd546f97 100644 --- a/pkg/deployment/resilience/member_failure.go +++ b/pkg/deployment/resilience/member_failure.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -132,6 +132,9 @@ func (r *Resilience) isMemberFailureAcceptable(group api.ServerGroup, m api.Memb case api.ServerGroupSyncMasters, api.ServerGroupSyncWorkers: // Sync masters & workers can be replaced at will return true, "" + case api.ServerGroupGateways: + // Gateways can be replaced at will + return true, "" case api.ServerGroupSingle: return false, "ServerGroupSingle can not marked as a failed" default: diff --git a/pkg/deployment/resources/pdbs.go b/pkg/deployment/resources/pdbs.go index afdf41dec..36530396c 100644 --- a/pkg/deployment/resources/pdbs.go +++ b/pkg/deployment/resources/pdbs.go @@ -29,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" @@ -72,6 +73,12 @@ func (r *Resources) EnsurePDBs(ctx context.Context) error { currSyncWorker = status.Members.SyncWorkers.MembersReady() } + minGateways, currGateways := 0, 0 + if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + minGateways = spec.GetServerGroupSpec(api.ServerGroupGateways).New().GetCount() - 1 + currGateways = status.Members.Gateways.MembersReady() + } + // Ensure all PDBs as calculated if err := r.ensurePDBForGroup(ctx, api.ServerGroupAgents, minAgents, currAgents); err != nil { return err @@ -88,6 +95,9 @@ func (r *Resources) EnsurePDBs(ctx context.Context) error { if err := r.ensurePDBForGroup(ctx, api.ServerGroupSyncWorkers, minSyncWorker, currSyncWorker); err != nil { return err } + if err := r.ensurePDBForGroup(ctx, api.ServerGroupGateways, minGateways, currGateways); err != nil { + return err + } } return nil diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index 5befe8a2c..36f0ecc27 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -286,6 +286,15 @@ func createArangoSyncArgs(apiObject meta.Object, spec api.DeploymentSpec, group return args } +func createArangoGatewayArgs(groupSpec api.ServerGroupSpec) []string { + args := []string{"--config-path", GatewayConfigFilePath} + if len(groupSpec.Args) > 0 { + args = append(args, groupSpec.Args...) + } + + return args +} + // CreatePodTolerations creates a list of tolerations for a pod created for the given group. func (r *Resources) CreatePodTolerations(group api.ServerGroup, groupSpec api.ServerGroupSpec) []core.Toleration { return tolerations.MergeTolerationsIfNotFound(tolerations.CreatePodTolerations(r.context.GetMode(), group), groupSpec.GetTolerations()) @@ -379,6 +388,21 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec memberStatus: m, cachedStatus: cache, } + case api.ServerGroupTypeGateway: + imageInfo.Image = r.context.GetOperatorImage() + + podCreator = &MemberGatewayPod{ + podName: podName, + groupSpec: groupSpec, + spec: spec, + group: group, + resources: r, + imageInfo: imageInfo, + arangoMember: *member, + apiObject: apiObject, + memberStatus: m, + cachedStatus: cache, + } default: return nil, assertion.InvalidGroupKey.Assert(true, "Unable to render pod for an unknown group: %s", group.AsRole()) } @@ -548,6 +572,27 @@ func (r *Resources) createPodForMember(ctx context.Context, cachedStatus inspect m.Pod.Propagate(&m) log.Str("pod-name", pod.Name).Debug("Created pod") + case api.ServerGroupTypeGateway: + ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) + defer cancel() + podName, uid, err := CreateArangoPod(ctxChild, cachedStatus.PodsModInterface().V1(), apiObject, spec, group, CreatePodFromTemplate(template.PodSpec)) + if err != nil { + if uErr := r.context.WithMemberStatusUpdateErr(ctx, m.ID, group, updateMemberPhase(api.MemberPhaseCreationFailed)); uErr != nil { + return errors.WithStack(uErr) + } + return errors.WithStack(err) + } + + var pod api.MemberPodStatus + + pod.Name = podName + pod.UID = uid + pod.SpecVersion = template.PodSpecChecksum + + m.Pod = &pod + m.Pod.Propagate(&m) + + log.Str("pod-name", pod.Name).Debug("Created Gateway pod") default: return assertion.InvalidGroupKey.Assert(true, "Unable to create pod for an unknown group: %s", group.AsRole()) } diff --git a/pkg/deployment/resources/pod_creator_gateway.go b/pkg/deployment/resources/pod_creator_gateway.go new file mode 100644 index 000000000..e46415ccf --- /dev/null +++ b/pkg/deployment/resources/pod_creator_gateway.go @@ -0,0 +1,346 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "context" + "fmt" + "math" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/collection" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" + kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" +) + +const ( + ArangoGatewayExecutor string = "/usr/local/bin/envoy" + GatewayVolumeMountDir = "/etc/gateway/" + GatewayVolumeName = "gateway" + GatewayConfigFileName = "gateway.yaml" + GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName +) + +type ArangoGatewayContainer struct { + groupSpec api.ServerGroupSpec + spec api.DeploymentSpec + group api.ServerGroup + resources *Resources + imageInfo api.ImageInfo + apiObject meta.Object + memberStatus api.MemberStatus + arangoMember api.ArangoMember +} + +var _ interfaces.PodCreator = &MemberGatewayPod{} +var _ interfaces.ContainerCreator = &ArangoGatewayContainer{} + +type MemberGatewayPod struct { + podName string + + groupSpec api.ServerGroupSpec + spec api.DeploymentSpec + group api.ServerGroup + arangoMember api.ArangoMember + resources *Resources + imageInfo api.ImageInfo + apiObject meta.Object + memberStatus api.MemberStatus + cachedStatus interfaces.Inspector +} + +func GetGatewayConfigMapName(name string) string { + return fmt.Sprintf("%s-gateway", name) +} + +func (a *ArangoGatewayContainer) GetCommand() ([]string, error) { + cmd := make([]string, 0, 128) + cmd = append(cmd, a.GetExecutor()) + cmd = append(cmd, createArangoGatewayArgs(a.groupSpec)...) + return cmd, nil +} + +func (a *ArangoGatewayContainer) GetName() string { + return shared.ServerContainerName +} + +func (a *ArangoGatewayContainer) GetPorts() []core.ContainerPort { + port := shared.ArangoPort + + return []core.ContainerPort{ + { + Name: shared.ServerContainerName, + ContainerPort: int32(port), + Protocol: core.ProtocolTCP, + }, + } +} + +func (a *ArangoGatewayContainer) GetExecutor() string { + return a.groupSpec.GetEntrypoint(ArangoGatewayExecutor) +} + +func (a *ArangoGatewayContainer) GetSecurityContext() *core.SecurityContext { + return k8sutil.CreateSecurityContext(a.groupSpec.SecurityContext) +} + +func (a *ArangoGatewayContainer) GetProbes() (*core.Probe, *core.Probe, *core.Probe, error) { + var liveness, readiness, startup *core.Probe + + probeLivenessConfig, err := a.resources.getLivenessProbe(a.spec, a.group, a.imageInfo) + if err != nil { + return nil, nil, nil, err + } + + probeReadinessConfig, err := a.resources.getReadinessProbe(a.spec, a.group, a.imageInfo) + if err != nil { + return nil, nil, nil, err + } + + probeStartupConfig, err := a.resources.getReadinessProbe(a.spec, a.group, a.imageInfo) + if err != nil { + return nil, nil, nil, err + } + + if probeLivenessConfig != nil { + liveness = probeLivenessConfig.Create() + } + + if probeReadinessConfig != nil { + readiness = probeReadinessConfig.Create() + } + + if probeStartupConfig != nil { + startup = probeStartupConfig.Create() + } + + return liveness, readiness, startup, nil +} + +func (a *ArangoGatewayContainer) GetResourceRequirements() core.ResourceRequirements { + return kresources.ExtractPodAcceptedResourceRequirement(a.arangoMember.Spec.Overrides.GetResources(&a.groupSpec)) +} + +func (a *ArangoGatewayContainer) GetLifecycle() (*core.Lifecycle, error) { + return k8sutil.NewLifecycleFinalizers() +} + +func (a *ArangoGatewayContainer) GetImagePullPolicy() core.PullPolicy { + return a.spec.GetImagePullPolicy() +} + +func (a *ArangoGatewayContainer) GetImage() string { + return a.imageInfo.Image +} + +func (a *ArangoGatewayContainer) GetEnvs() ([]core.EnvVar, []core.EnvFromSource) { + envs := NewEnvBuilder() + + envs.Add(true, k8sutil.GetLifecycleEnv()...) + + if len(a.groupSpec.Envs) > 0 { + for _, env := range a.groupSpec.Envs { + // Do not override preset envs + envs.Add(false, core.EnvVar{ + Name: env.Name, + Value: env.Value, + }) + } + } + + return envs.GetEnvList(), nil +} + +func (a *ArangoGatewayContainer) GetVolumeMounts() []core.VolumeMount { + return createGatewayVolumes(a.apiObject.GetName()).VolumeMounts() +} + +func (m *MemberGatewayPod) GetName() string { + return m.resources.context.GetAPIObject().GetName() +} + +func (m *MemberGatewayPod) GetRole() string { + return m.group.AsRole() +} + +func (m *MemberGatewayPod) GetImagePullSecrets() []string { + return m.spec.ImagePullSecrets +} + +func (m *MemberGatewayPod) GetPodAntiAffinity() *core.PodAntiAffinity { + a := &core.PodAntiAffinity{} + + pod.AppendPodAntiAffinityDefault(m, a) + + a = kresources.MergePodAntiAffinity(a, m.groupSpec.AntiAffinity) + + return kresources.OptionalPodAntiAffinity(a) +} + +func (m *MemberGatewayPod) GetPodAffinity() *core.PodAffinity { + a := &core.PodAffinity{} + + pod.AppendAffinityWithRole(m, a, api.ServerGroupDBServers.AsRole()) + + a = kresources.MergePodAffinity(a, m.groupSpec.Affinity) + + return kresources.OptionalPodAffinity(a) +} + +func (m *MemberGatewayPod) GetNodeAffinity() *core.NodeAffinity { + a := &core.NodeAffinity{} + + pod.AppendArchSelector(a, m.memberStatus.Architecture.Default(m.spec.Architecture.GetDefault()).AsNodeSelectorRequirement()) + + a = kresources.MergeNodeAffinity(a, m.groupSpec.NodeAffinity) + + return kresources.OptionalNodeAffinity(a) +} + +func (m *MemberGatewayPod) GetNodeSelector() map[string]string { + return m.groupSpec.GetNodeSelector() +} + +func (m *MemberGatewayPod) GetServiceAccountName() string { + return m.groupSpec.GetServiceAccountName() +} + +func (m *MemberGatewayPod) GetSidecars(pod *core.Pod) error { + // A sidecar provided by the user + sidecars := m.groupSpec.GetSidecars() + if len(sidecars) > 0 { + addLifecycleSidecar(m.groupSpec.SidecarCoreNames, sidecars) + pod.Spec.Containers = append(pod.Spec.Containers, sidecars...) + } + + return nil +} + +func (m *MemberGatewayPod) GetVolumes() []core.Volume { + return createGatewayVolumes(m.apiObject.GetName()).Volumes() +} + +func (m *MemberGatewayPod) IsDeploymentMode() bool { + return m.spec.IsDevelopment() +} + +func (m *MemberGatewayPod) GetInitContainers(cachedStatus interfaces.Inspector) ([]core.Container, error) { + var initContainers []core.Container + if c := m.groupSpec.InitContainers.GetContainers(); len(c) > 0 { + initContainers = append(initContainers, c...) + } + + res := kresources.ExtractPodInitContainerAcceptedResourceRequirement(m.GetContainerCreator().GetResourceRequirements()) + + initContainers = applyInitContainersResourceResources(initContainers, res) + initContainers = upscaleInitContainersResourceResources(initContainers, res) + + return initContainers, nil +} + +func (m *MemberGatewayPod) GetFinalizers() []string { + return nil +} + +func (m *MemberGatewayPod) GetTolerations() []core.Toleration { + return m.resources.CreatePodTolerations(m.group, m.groupSpec) +} + +func (m *MemberGatewayPod) GetContainerCreator() interfaces.ContainerCreator { + return &ArangoGatewayContainer{ + groupSpec: m.groupSpec, + spec: m.spec, + group: m.group, + resources: m.resources, + imageInfo: m.imageInfo, + apiObject: m.apiObject, + memberStatus: m.memberStatus, + arangoMember: m.arangoMember, + } +} + +func (m *MemberGatewayPod) GetRestartPolicy() core.RestartPolicy { + if features.RestartPolicyAlways().Enabled() { + return core.RestartPolicyAlways + } + return core.RestartPolicyNever +} + +func (m *MemberGatewayPod) Init(ctx context.Context, cachedStatus interfaces.Inspector, pod *core.Pod) error { + terminationGracePeriodSeconds := int64(math.Ceil(m.groupSpec.GetTerminationGracePeriod(m.group).Seconds())) + pod.Spec.TerminationGracePeriodSeconds = &terminationGracePeriodSeconds + pod.Spec.PriorityClassName = m.groupSpec.PriorityClassName + + return nil +} + +func (m *MemberGatewayPod) Validate(_ interfaces.Inspector) error { + if err := validateSidecars(m.groupSpec.SidecarCoreNames, m.groupSpec.GetSidecars()); err != nil { + return err + } + + return nil +} + +func (m *MemberGatewayPod) ApplyPodSpec(spec *core.PodSpec) error { + if s := m.groupSpec.SchedulerName; s != nil { + spec.SchedulerName = *s + } + + m.groupSpec.PodModes.Apply(spec) + + return nil +} + +func (m *MemberGatewayPod) Annotations() map[string]string { + return collection.MergeAnnotations(m.spec.Annotations, m.groupSpec.Annotations) +} + +func (m *MemberGatewayPod) Labels() map[string]string { + return collection.ReservedLabels().Filter(collection.MergeAnnotations(m.spec.Labels, m.groupSpec.Labels)) +} + +func createGatewayVolumes(memberName string) pod.Volumes { + volumes := pod.NewVolumes() + + volumes.AddVolume(k8sutil.LifecycleVolume()) + volumes.AddVolumeMount(k8sutil.LifecycleVolumeMount()) + + volumes.AddVolume(k8sutil.CreateVolumeWithConfigMap(GatewayVolumeName, GetGatewayConfigMapName(memberName))) + volumes.AddVolumeMount(GatewayVolumeMount()) + + return volumes +} + +func GatewayVolumeMount() core.VolumeMount { + return core.VolumeMount{ + Name: GatewayVolumeName, + MountPath: GatewayVolumeMountDir, + ReadOnly: true, + } +} diff --git a/pkg/deployment/resources/pod_inspector.go b/pkg/deployment/resources/pod_inspector.go index 3f50c35dc..1a51f28e3 100644 --- a/pkg/deployment/resources/pod_inspector.go +++ b/pkg/deployment/resources/pod_inspector.go @@ -33,6 +33,7 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/agency/state" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/metrics" "github.com/arangodb/kube-arangodb/pkg/util" @@ -530,7 +531,7 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter } spec := r.context.GetSpec() - allMembersReady := status.Members.AllMembersReady(spec.GetMode(), r.context.IsSyncEnabled()) + allMembersReady := status.Members.AllMembersReady(spec.GetMode(), r.context.IsSyncEnabled(), features.Gateway().Enabled() && spec.IsGatewayEnabled()) status.Conditions.Update(api.ConditionTypeReady, allMembersReady, "", "") // Update conditions diff --git a/pkg/deployment/resources/services.go b/pkg/deployment/resources/services.go index 45fef63b7..869e6b488 100644 --- a/pkg/deployment/resources/services.go +++ b/pkg/deployment/resources/services.go @@ -82,6 +82,10 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn defer metrics.SetDuration(inspectServicesDurationGauges.WithLabelValues(deploymentName), start) counterMetric := inspectedServicesCounters.WithLabelValues(deploymentName) + if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + role = api.ServerGroupGateways.AsRole() + } + // Fetch existing services svcs := cachedStatus.ServicesModInterface().V1() amInspector := cachedStatus.ArangoMember().V1() diff --git a/pkg/util/k8sutil/pods.go b/pkg/util/k8sutil/pods.go index b2215843a..91359295b 100644 --- a/pkg/util/k8sutil/pods.go +++ b/pkg/util/k8sutil/pods.go @@ -641,6 +641,18 @@ func CreateVolumeWithSecret(name, secretName string) core.Volume { }, } } +func CreateVolumeWithConfigMap(name, configMapName string) core.Volume { + return core.Volume{ + Name: name, + VolumeSource: core.VolumeSource{ + ConfigMap: &core.ConfigMapVolumeSource{ + LocalObjectReference: core.LocalObjectReference{ + Name: configMapName, + }, + }, + }, + } +} func CreateVolumeWithPersitantVolumeClaim(name, claimName string) core.Volume { return core.Volume{ diff --git a/pkg/util/k8sutil/tolerations/tolerations.go b/pkg/util/k8sutil/tolerations/tolerations.go index d574f4e59..e0bfa0656 100644 --- a/pkg/util/k8sutil/tolerations/tolerations.go +++ b/pkg/util/k8sutil/tolerations/tolerations.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -134,6 +134,9 @@ func CreatePodTolerations(mode api.DeploymentMode, group api.ServerGroup) []core case api.ServerGroupSyncWorkers: notReadyDur.TimeSpan = 1 * time.Minute unreachableDur.TimeSpan = 1 * time.Minute + case api.ServerGroupGateways: + notReadyDur.TimeSpan = 15 * time.Second + unreachableDur.TimeSpan = 15 * time.Second } return []core.Toleration{NewNoExecuteToleration(TolerationKeyNodeNotReady, notReadyDur), NewNoExecuteToleration(TolerationKeyNodeUnreachable, unreachableDur), diff --git a/pkg/util/k8sutil/util.go b/pkg/util/k8sutil/util.go index 34ffd78cd..3a8a98419 100644 --- a/pkg/util/k8sutil/util.go +++ b/pkg/util/k8sutil/util.go @@ -44,7 +44,7 @@ const ( LabelKeyArangoScheduled = "deployment.arangodb.com/scheduled" // LabelKeyArangoTopology is the key of the label used to store the ArangoDeployment topology ID in LabelKeyArangoTopology = "deployment.arangodb.com/topology" - // LabelKeyArangoLeader is the key of the label used to store the current leader of a group instances. + // LabelKeyArangoLeader is the key of the label used to store the current leader of a group instances. AF only. LabelKeyArangoLeader = "deployment.arangodb.com/leader" // LabelKeyArangoActive is the key of the label used to mark members as active. LabelKeyArangoActive = "deployment.arangodb.com/active" From e97e425485c884ee94158258234b79f32a6c73f9 Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Mon, 26 Aug 2024 12:06:47 +0200 Subject: [PATCH 15/50] OAS-9906 Gateway config loader (#1703) --- CHANGELOG.md | 1 + go.mod | 5 +- go.sum | 72 +---- pkg/deployment/resources/config_maps.go | 113 ++++++++ pkg/deployment/resources/gateway_config.go | 268 ++++++++++++++++++ .../resources/pod_creator_gateway.go | 11 +- pkg/deployment/resources/resources.go | 3 +- pkg/util/dict.go | 27 ++ pkg/util/k8sutil/configmaps.go | 41 +++ 9 files changed, 463 insertions(+), 78 deletions(-) create mode 100644 pkg/deployment/resources/config_maps.go create mode 100644 pkg/deployment/resources/gateway_config.go create mode 100644 pkg/util/k8sutil/configmaps.go diff --git a/CHANGELOG.md b/CHANGELOG.md index f1e06163c..ab2099914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - (Feature) Envoy AuthV3 Integration - (Maintenance) Switch to ubuntu:24.04 base image - (Feature) Gateway Group for ArangoDeployment +- (Feature) Gateway config loader ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/go.mod b/go.mod index 879007750..abba2e954 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/coreos/go-semver v0.3.1 github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9 + github.com/envoyproxy/go-control-plane v0.11.1 github.com/fsnotify/fsnotify v1.7.0 github.com/gin-gonic/gin v1.9.1 github.com/golang-jwt/jwt v3.2.2+incompatible @@ -69,13 +70,12 @@ require ( sigs.k8s.io/yaml v1.4.0 ) -require github.com/envoyproxy/go-control-plane v0.11.1 - require ( github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bytedance/sonic v1.9.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect @@ -131,6 +131,7 @@ require ( golang.org/x/term v0.18.0 // indirect golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index fed513951..8d68fe4f6 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= -github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680 h1:5YCGq0gkf/sCEkDFIsMBPj59GOm5cMibGqDBH2OWWfQ= github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680/go.mod h1:xDyzBwyYzcEhsaDXtmxCNM4p5BrtuoVYYsRTuJqmCeg= github.com/arangodb-helper/go-helper v0.4.2 h1:Ekf8EtPYQdhlwtqJAEn17i7zbtuavksWamasxcyOGWQ= @@ -22,10 +16,8 @@ github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2 github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -34,6 +26,7 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -41,14 +34,11 @@ github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -58,7 +48,6 @@ github.com/dchest/siphash v1.2.2 h1:9DFz8tQwl9pTVt5iok/9zKyzA1Q6bRGiF3HPiEEVr9I= github.com/dchest/siphash v1.2.2/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9 h1:74lLNRzvsdIlkTgfDSMuaPjBr4cf6k7pwQQANm/yLKU= github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9/go.mod h1:GgB8SF9nRG+GqaDtLcwJZsQFhcogVCJ79j4EdT0c2V4= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= 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= @@ -69,8 +58,6 @@ github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBF github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= 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/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= @@ -79,13 +66,9 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 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-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 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/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= @@ -110,9 +93,7 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -122,8 +103,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.17.7/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= 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= @@ -141,23 +120,16 @@ github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15 h1:cW/amwGEJK5MSKntPXRjX4dxs/nGxGT8gXKIsKFmHGc= github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15/go.mod h1:Fdm/oWRW+CH8PRbLntksCNtmcCBximKPkVQYvmMl80k= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josephburnett/jd v1.6.1 h1:Uzqhcje4WqvVyp85F3Oj0ezISPTlnhnr/KaLZIy8qh0= github.com/josephburnett/jd v1.6.1/go.mod h1:R8ZnZnLt2D4rhW4NvBc/USTo6mzyNT6fYNIIWOJA9GY= 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/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= 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/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= @@ -195,7 +167,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 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/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= @@ -206,7 +177,6 @@ github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible h1:Jd6xfriVlJ6hWPvYO github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible/go.mod h1:xlUlxe/2ItGlQyMTstqeDv9r3U4obH7xYd26TbDQutY= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -236,49 +206,21 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.19.0 h1:hYz4ZVdUgjXTBUmrkrw55j1nHx68LfOKIQk5IYtyScg= github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= -go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= -go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= -go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= -go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs= -go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc= -go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0/go.mod h1:5z+/ZWJQKXa9YT34fQNx5K8Hd1EoIhvtUygUQPqEOgQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -289,14 +231,12 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230125214544-b3c2aaf6208d/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -361,15 +301,13 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= @@ -387,7 +325,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= 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= @@ -401,20 +338,15 @@ k8s.io/apiextensions-apiserver v0.29.6 h1:tUu1N6Zt9GT8KVcPF5aGDqfISz1mveM4yFh7eL k8s.io/apiextensions-apiserver v0.29.6/go.mod h1:iw1EbwZat08I219qrQKoFMHGo7J9KxPqMpVKxCbNbCs= k8s.io/apimachinery v0.29.6 h1:CLjJ5b0hWW7531n/njRE3rnusw3rhVGCFftPfnG54CI= k8s.io/apimachinery v0.29.6/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= -k8s.io/apiserver v0.29.6/go.mod h1:HrQwfPWxhwEa+n8/+5YwSF5yT2WXbeyFjqq6KEXHTX8= k8s.io/client-go v0.29.6 h1:5E2ebuB/p0F0THuQatyvhDvPL2SIeqwTPrtnrwKob/8= k8s.io/client-go v0.29.6/go.mod h1:jHZcrQqDplyv20v7eu+iFM4gTpglZSZoMVcKrh8sRGg= -k8s.io/component-base v0.29.6/go.mod h1:kIahZm8aw9lV8Vw17LF89REmeBrv5+QEl3v7HsrmITY= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kms v0.29.6/go.mod h1:vWVImKkJd+1BQY4tBwdfSwjQBiLrnbNtHADcDEDQFtk= k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a h1:ZeIPbyHHqahGIbeyLJJjAUhnxCKqXaDY+n89Ms8szyA= k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/pkg/deployment/resources/config_maps.go b/pkg/deployment/resources/config_maps.go new file mode 100644 index 000000000..f1e5cf6d0 --- /dev/null +++ b/pkg/deployment/resources/config_maps.go @@ -0,0 +1,113 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "context" + "fmt" + "time" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/metrics" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" + configMapsV1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" +) + +var ( + inspectedConfigMapsCounters = metrics.MustRegisterCounterVec(metricsComponent, "inspected_config_maps", "Number of ConfigMaps inspections per deployment", metrics.DeploymentName) + inspectConfigMapsDurationGauges = metrics.MustRegisterGaugeVec(metricsComponent, "inspect_config_maps_duration", "Amount of time taken by a single inspection of all ConfigMaps for a deployment (in sec)", metrics.DeploymentName) +) + +// EnsureConfigMaps creates all ConfigMaps needed to run the given deployment +func (r *Resources) EnsureConfigMaps(ctx context.Context, cachedStatus inspectorInterface.Inspector) error { + start := time.Now() + spec := r.context.GetSpec() + configMaps := cachedStatus.ConfigMapsModInterface().V1() + apiObject := r.context.GetAPIObject() + deploymentName := apiObject.GetName() + + defer metrics.SetDuration(inspectConfigMapsDurationGauges.WithLabelValues(deploymentName), start) + counterMetric := inspectedConfigMapsCounters.WithLabelValues(deploymentName) + + reconcileRequired := k8sutil.NewReconcile(cachedStatus) + + if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + counterMetric.Inc() + if err := reconcileRequired.WithError(r.ensureGatewayConfig(ctx, cachedStatus, configMaps)); err != nil { + return errors.Section(err, "Gateway ConfigMap") + } + } + return reconcileRequired.Reconcile(ctx) +} + +func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspectorInterface.Inspector, configMaps configMapsV1.ModInterface) error { + deploymentName := r.context.GetAPIObject().GetName() + configMapName := GetGatewayConfigMapName(deploymentName) + + if _, exists := cachedStatus.ConfigMap().V1().GetSimple(configMapName); !exists { + // Find serving service (single/crdn) + spec := r.context.GetSpec() + svcServingName := fmt.Sprintf("%s-%s", deploymentName, spec.Mode.Get().ServingGroup().AsRole()) + + svc, svcExist := cachedStatus.Service().V1().GetSimple(svcServingName) + if !svcExist { + return errors.Errorf("Service %s not found", svcServingName) + } + + gatewayCfgYaml, err := RenderGatewayConfigYAML(svc.Spec.ClusterIP) + if err != nil { + return errors.WithStack(errors.Wrapf(err, "Failed to render gateway config")) + } + cm := &core.ConfigMap{ + ObjectMeta: meta.ObjectMeta{ + Name: configMapName, + }, + Data: map[string]string{ + GatewayConfigFileName: string(gatewayCfgYaml), + GatewayConfigChecksumName: util.SHA256(gatewayCfgYaml), + }, + } + + owner := r.context.GetAPIObject().AsOwner() + + err = globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { + return k8sutil.CreateConfigMap(ctxChild, configMaps, cm, &owner) + }) + if kerrors.IsAlreadyExists(err) { + // CM added while we tried it also + return nil + } else if err != nil { + // Failed to create + return errors.WithStack(err) + } + + return errors.Reconcile() + } + return nil +} diff --git a/pkg/deployment/resources/gateway_config.go b/pkg/deployment/resources/gateway_config.go new file mode 100644 index 000000000..38408e4ea --- /dev/null +++ b/pkg/deployment/resources/gateway_config.go @@ -0,0 +1,268 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "fmt" + "net/url" + "strconv" + "time" + + bootstrapAPI "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3" + clusterAPI "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" + coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + endpointAPI "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" + listenerAPI "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" + routeAPI "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + routerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3" + httpConnectionManagerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/durationpb" + "sigs.k8s.io/yaml" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +type Redirect util.KV[string, []string] + +func WithRedirect(prefix string, target ...string) Redirect { + return Redirect{ + K: prefix, + V: target, + } +} + +func RenderGatewayConfigYAML(dbServiceAddress string, redirects ...Redirect) ([]byte, error) { + cfg, err := RenderConfig(dbServiceAddress, redirects...) + if err != nil { + return nil, err + } + + data, err := protojson.MarshalOptions{ + UseProtoNames: true, + }.Marshal(cfg) + if err != nil { + return nil, err + } + + data, err = yaml.JSONToYAML(data) + return data, err +} + +func RenderConfig(dbServiceAddress string, redirects ...Redirect) (*bootstrapAPI.Bootstrap, error) { + clusters := []*clusterAPI.Cluster{ + { + Name: "arangodb", + ConnectTimeout: durationpb.New(250 * time.Millisecond), + LbPolicy: clusterAPI.Cluster_ROUND_ROBIN, + LoadAssignment: &endpointAPI.ClusterLoadAssignment{ + ClusterName: "arangodb", + Endpoints: []*endpointAPI.LocalityLbEndpoints{ + { + LbEndpoints: []*endpointAPI.LbEndpoint{ + { + HostIdentifier: &endpointAPI.LbEndpoint_Endpoint{ + Endpoint: &endpointAPI.Endpoint{ + Address: &coreAPI.Address{ + Address: &coreAPI.Address_SocketAddress{ + SocketAddress: &coreAPI.SocketAddress{ + Address: dbServiceAddress, + PortSpecifier: &coreAPI.SocketAddress_PortValue{ + PortValue: shared.ArangoPort, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + + routes := []*routeAPI.Route{ + { + Match: &routeAPI.RouteMatch{ + PathSpecifier: &routeAPI.RouteMatch_Prefix{ + Prefix: "/", + }, + }, + Action: &routeAPI.Route_Route{ + Route: &routeAPI.RouteAction{ + ClusterSpecifier: &routeAPI.RouteAction_Cluster{ + Cluster: "arangodb", + }, + PrefixRewrite: "/", + }, + }, + }, + } + + for id, redirect := range redirects { + var endpoints []*endpointAPI.LbEndpoint + + for _, target := range redirect.V { + req, err := url.Parse(target) + if err != nil { + return nil, err + } + + port, err := strconv.Atoi(req.Port()) + if err != nil { + return nil, err + } + + endpoints = append(endpoints, &endpointAPI.LbEndpoint{ + HostIdentifier: &endpointAPI.LbEndpoint_Endpoint{ + Endpoint: &endpointAPI.Endpoint{ + Address: &coreAPI.Address{ + Address: &coreAPI.Address_SocketAddress{ + SocketAddress: &coreAPI.SocketAddress{ + Address: req.Hostname(), + PortSpecifier: &coreAPI.SocketAddress_PortValue{ + PortValue: uint32(port), + }, + }, + }, + }, + }, + }, + }, + ) + } + + cluster := &clusterAPI.Cluster{ + Name: fmt.Sprintf("cluster_%05d", id), + ConnectTimeout: durationpb.New(250 * time.Millisecond), + LbPolicy: clusterAPI.Cluster_ROUND_ROBIN, + LoadAssignment: &endpointAPI.ClusterLoadAssignment{ + ClusterName: fmt.Sprintf("cluster_%05d", id), + Endpoints: []*endpointAPI.LocalityLbEndpoints{ + { + LbEndpoints: endpoints, + }, + }, + }, + } + + route := &routeAPI.Route{ + Match: &routeAPI.RouteMatch{ + PathSpecifier: &routeAPI.RouteMatch_Prefix{ + Prefix: redirect.K, + }, + }, + Action: &routeAPI.Route_Route{ + Route: &routeAPI.RouteAction{ + ClusterSpecifier: &routeAPI.RouteAction_Cluster{ + Cluster: fmt.Sprintf("cluster_%05d", id), + }, + PrefixRewrite: "/", + }, + }, + } + + clusters = append(clusters, cluster) + routes = append(routes, route) + } + + routes = util.Sort(routes, func(i, j *routeAPI.Route) bool { + return i.Match.GetPrefix() > j.Match.GetPrefix() + }) + + httpFilterConfigType, err := anypb.New(&routerAPI.Router{}) + if err != nil { + return nil, err + } + + filterConfigType, err := anypb.New(&httpConnectionManagerAPI.HttpConnectionManager{ + StatPrefix: "ingress_http", + CodecType: httpConnectionManagerAPI.HttpConnectionManager_AUTO, + RouteSpecifier: &httpConnectionManagerAPI.HttpConnectionManager_RouteConfig{ + RouteConfig: &routeAPI.RouteConfiguration{ + Name: "local_route", + VirtualHosts: []*routeAPI.VirtualHost{ + { + Name: "local_service", + Domains: []string{"*"}, + Routes: routes, + }, + }, + }, + }, + HttpFilters: []*httpConnectionManagerAPI.HttpFilter{ + { + Name: "envoy.filters.http.routerAPI", + ConfigType: &httpConnectionManagerAPI.HttpFilter_TypedConfig{ + TypedConfig: httpFilterConfigType, + }, + }, + }, + }) + if err != nil { + return nil, err + } + + return &bootstrapAPI.Bootstrap{ + Admin: &bootstrapAPI.Admin{ + Address: &coreAPI.Address{ + Address: &coreAPI.Address_SocketAddress{ + SocketAddress: &coreAPI.SocketAddress{ + Address: "127.0.0.1", + PortSpecifier: &coreAPI.SocketAddress_PortValue{PortValue: 9901}, + }, + }, + }, + }, + StaticResources: &bootstrapAPI.Bootstrap_StaticResources{ + Listeners: []*listenerAPI.Listener{ + { + Name: "listener_0", + Address: &coreAPI.Address{ + Address: &coreAPI.Address_SocketAddress{ + SocketAddress: &coreAPI.SocketAddress{ + Address: "0.0.0.0", + PortSpecifier: &coreAPI.SocketAddress_PortValue{PortValue: shared.ArangoPort}, + }, + }, + }, + FilterChains: []*listenerAPI.FilterChain{ + { + Filters: []*listenerAPI.Filter{ + { + Name: "envoy.filters.network.httpConnectionManagerAPI", + ConfigType: &listenerAPI.Filter_TypedConfig{ + TypedConfig: filterConfigType, + }, + }, + }, + }, + }, + }, + }, + Clusters: clusters, + }, + }, nil +} diff --git a/pkg/deployment/resources/pod_creator_gateway.go b/pkg/deployment/resources/pod_creator_gateway.go index e46415ccf..30988305c 100644 --- a/pkg/deployment/resources/pod_creator_gateway.go +++ b/pkg/deployment/resources/pod_creator_gateway.go @@ -39,11 +39,12 @@ import ( ) const ( - ArangoGatewayExecutor string = "/usr/local/bin/envoy" - GatewayVolumeMountDir = "/etc/gateway/" - GatewayVolumeName = "gateway" - GatewayConfigFileName = "gateway.yaml" - GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName + ArangoGatewayExecutor string = "/usr/local/bin/envoy" + GatewayVolumeMountDir = "/etc/gateway/" + GatewayVolumeName = "gateway" + GatewayConfigFileName = "gateway.yaml" + GatewayConfigChecksumName = "gateway.yaml-checksum" + GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName ) type ArangoGatewayContainer struct { diff --git a/pkg/deployment/resources/resources.go b/pkg/deployment/resources/resources.go index fbd1b9d66..e4407c5bb 100644 --- a/pkg/deployment/resources/resources.go +++ b/pkg/deployment/resources/resources.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -56,6 +56,7 @@ func (r *Resources) EnsureCoreResources(ctx context.Context, cachedStatus inspec return errors.Errors(errors.Section(r.EnsureLeader(ctx, cachedStatus), "EnsureLeader"), errors.Section(r.EnsureArangoMembers(ctx, cachedStatus), "EnsureArangoMembers"), errors.Section(r.EnsureServices(ctx, cachedStatus), "EnsureServices"), + errors.Section(r.EnsureConfigMaps(ctx, cachedStatus), "EnsureConfigMaps"), errors.Section(r.EnsureSecrets(ctx, cachedStatus), "EnsureSecrets")) } diff --git a/pkg/util/dict.go b/pkg/util/dict.go index bf2c775bd..7643d36fa 100644 --- a/pkg/util/dict.go +++ b/pkg/util/dict.go @@ -26,6 +26,33 @@ import ( "sort" ) +type KV[K comparable, V any] struct { + K K + V V +} + +func Extract[K comparable, V any](in map[K]V) []KV[K, V] { + r := make([]KV[K, V], 0, len(in)) + + for k, v := range in { + r = append(r, KV[K, V]{ + K: k, + V: v, + }) + } + + return r +} + +func Sort[IN any](in []IN, cmp func(i, j IN) bool) []IN { + r := make([]IN, len(in)) + copy(r, in) + sort.Slice(r, func(i, j int) bool { + return cmp(r[i], r[j]) + }) + return r +} + func SortKeys(m interface{}) []string { if m == nil { return []string{} diff --git a/pkg/util/k8sutil/configmaps.go b/pkg/util/k8sutil/configmaps.go new file mode 100644 index 000000000..1741c89e9 --- /dev/null +++ b/pkg/util/k8sutil/configmaps.go @@ -0,0 +1,41 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package k8sutil + +import ( + "context" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + configMapsV1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" +) + +func CreateConfigMap(ctx context.Context, configMaps configMapsV1.ModInterface, cm *core.ConfigMap, ownerRef *meta.OwnerReference) error { + AddOwnerRefToObject(cm, ownerRef) + + if _, err := configMaps.Create(ctx, cm, meta.CreateOptions{}); err != nil { + // Failed to create secret + return kerrors.NewResourceError(err, cm) + } + return nil +} From 25d636e2b5f704eddb073993ab0f9084eb46fbbe Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:57:50 +0200 Subject: [PATCH 16/50] [Feature] ConfigV1 Integration Service (#1704) --- .golangci.yaml | 4 + CHANGELOG.md | 1 + Makefile | 14 +- README.md | 2 +- .../authentication/v1/implementation_test.go | 9 +- integrations/config/v1/config.go | 40 ++ integrations/config/v1/config_test.go | 80 +++ integrations/config/v1/consts.go | 25 + .../config/v1/definition/config.pb.go | 652 ++++++++++++++++++ .../config/v1/definition/config.proto | 106 +++ .../config/v1/definition/config_grpc.pb.go | 178 +++++ integrations/config/v1/file_details_test.go | 179 +++++ integrations/config/v1/impl.go | 197 ++++++ integrations/config/v1/impl_darwin.go | 80 +++ integrations/config/v1/impl_linux.go | 80 +++ integrations/config/v1/logger.go | 25 + integrations/config/v1/module_details_test.go | 192 ++++++ integrations/config/v1/module_test.go | 75 ++ integrations/config/v1/service_test.go | 46 ++ integrations/scheduler/v1/consts.go | 25 + pkg/integrations/authentication_v1.go | 2 +- pkg/integrations/authorization_v0.go | 2 +- pkg/integrations/config_v1.go | 77 +++ pkg/integrations/envoy_auth_v3.go | 2 +- pkg/integrations/register.go | 24 +- pkg/integrations/scheduler_v1.go | 4 +- pkg/integrations/shutdown_v1.go | 2 +- pkg/integrations/storage_v1.go | 4 +- pkg/ml/storage/consts.go | 23 + pkg/upgrade/upgrade_test.go | 4 +- pkg/util/checksum.go | 23 + pkg/util/dict.go | 29 +- pkg/util/registerer.go | 71 ++ pkg/util/strings/strings.go | 17 + pkg/util/svc/error.go | 21 +- pkg/util/tests/path.go | 95 +++ pkg/util/tests/tgrpc/grpc.go | 32 + 37 files changed, 2385 insertions(+), 57 deletions(-) create mode 100644 integrations/config/v1/config.go create mode 100644 integrations/config/v1/config_test.go create mode 100644 integrations/config/v1/consts.go create mode 100644 integrations/config/v1/definition/config.pb.go create mode 100644 integrations/config/v1/definition/config.proto create mode 100644 integrations/config/v1/definition/config_grpc.pb.go create mode 100644 integrations/config/v1/file_details_test.go create mode 100644 integrations/config/v1/impl.go create mode 100644 integrations/config/v1/impl_darwin.go create mode 100644 integrations/config/v1/impl_linux.go create mode 100644 integrations/config/v1/logger.go create mode 100644 integrations/config/v1/module_details_test.go create mode 100644 integrations/config/v1/module_test.go create mode 100644 integrations/config/v1/service_test.go create mode 100644 integrations/scheduler/v1/consts.go create mode 100644 pkg/integrations/config_v1.go create mode 100644 pkg/ml/storage/consts.go create mode 100644 pkg/util/registerer.go create mode 100644 pkg/util/tests/path.go diff --git a/.golangci.yaml b/.golangci.yaml index 406b638b5..a95470b9b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -99,6 +99,10 @@ linters-settings: alias: pbAuthorizationV0 - pkg: github.com/arangodb/kube-arangodb/integrations/authorization/v0 alias: pbImplAuthorizationV0 + - pkg: github.com/arangodb/kube-arangodb/integrations/config/v1/definition + alias: pbConfigV1 + - pkg: github.com/arangodb/kube-arangodb/integrations/config/v1 + alias: pbImplConfigV1 - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1/definition alias: pbSharedV1 - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index ab2099914..af0c001b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - (Maintenance) Switch to ubuntu:24.04 base image - (Feature) Gateway Group for ArangoDeployment - (Feature) Gateway config loader +- (Feature) ConfigV1 Integration Service ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index d33c24fc9..b576c01ec 100644 --- a/Makefile +++ b/Makefile @@ -726,19 +726,9 @@ manifest-verify-helm-ee: manifests-verify-env-reset .PHONY: run-unit-tests run-unit-tests: $(SOURCES) go test --count=1 --tags "$(GOBUILDTAGS)" $(TESTVERBOSEOPTIONS) \ - $(REPOPATH)/pkg/apis/shared/... \ - $(REPOPATH)/pkg/apis/backup/... \ - $(REPOPATH)/pkg/apis/deployment/... \ - $(REPOPATH)/pkg/apis/replication/... \ - $(REPOPATH)/pkg/apis/storage/... \ - $(REPOPATH)/pkg/apis/ml/... \ - $(REPOPATH)/pkg/deployment/... \ - $(REPOPATH)/pkg/storage/... \ - $(REPOPATH)/pkg/crd/... \ - $(REPOPATH)/pkg/util/... \ - $(REPOPATH)/pkg/generated/metric_descriptions/... \ + $(REPOPATH)/pkg/... \ $(REPOPATH)/cmd/... \ - $(REPOPATH)/pkg/handlers/... + $(REPOPATH)/integrations/... # Release building diff --git a/README.md b/README.md index f863b2e4e..f22305d20 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integrations, k8s-client, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes diff --git a/integrations/authentication/v1/implementation_test.go b/integrations/authentication/v1/implementation_test.go index 20b8271d3..0502cbd39 100644 --- a/integrations/authentication/v1/implementation_test.go +++ b/integrations/authentication/v1/implementation_test.go @@ -40,10 +40,11 @@ func Test_Basic(t *testing.T) { ctx, c := context.WithCancel(context.Background()) defer c() - s, err := newInternal(ctx, Configuration{ - Path: directory, - TTL: time.Duration(0), - }) + s, err := newInternal(ctx, NewConfiguration().With(func(c Configuration) Configuration { + c.Path = directory + c.TTL = 0 + return c + })) require.NoError(t, err) // Create token diff --git a/integrations/config/v1/config.go b/integrations/config/v1/config.go new file mode 100644 index 000000000..3497f380c --- /dev/null +++ b/integrations/config/v1/config.go @@ -0,0 +1,40 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +type Config struct { + Modules ModuleDefinitions `json:"modules,omitempty"` +} + +func (c *Config) Init() { + for k := range c.Modules { + m := c.Modules[k] + m.Name = k + c.Modules[k] = m + } +} + +type ModuleDefinitions map[string]ModuleDefinition + +type ModuleDefinition struct { + Name string `json:"-"` + Path string `json:"path"` +} diff --git a/integrations/config/v1/config_test.go b/integrations/config/v1/config_test.go new file mode 100644 index 000000000..d4ce2da7b --- /dev/null +++ b/integrations/config/v1/config_test.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "fmt" + "os" + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_ConfigCreation(t *testing.T) { + create := func(config Config) error { + _, err := New(config) + return err + } + + dir := t.TempDir() + + require.NoError(t, os.WriteFile(fmt.Sprintf("%s/file", dir), []byte{}, 0644)) + + require.EqualError(t, create(Config{}), "Requires at least 1 module") + + require.EqualError(t, create(Config{ + Modules: map[string]ModuleDefinition{ + "test": {}, + }, + }), "Path for module `test` cannot be empty") + + require.EqualError(t, create(Config{ + Modules: map[string]ModuleDefinition{ + "test": { + Path: "some/relative/path", + }, + }, + }), "Path `some/relative/path` for module `test` needs to be absolute") + + require.EqualError(t, create(Config{ + Modules: map[string]ModuleDefinition{ + "test": { + Path: fmt.Sprintf("%s/non-existent", dir), + }, + }, + }), fmt.Sprintf("Path `%s/non-existent` for module `test` does not exists", dir)) + + require.EqualError(t, create(Config{ + Modules: map[string]ModuleDefinition{ + "test": { + Path: fmt.Sprintf("%s/file", dir), + }, + }, + }), fmt.Sprintf("Path `%s/file` for module `test` is not a directory", dir)) + + require.NoError(t, create(Config{ + Modules: map[string]ModuleDefinition{ + "test": { + Path: dir, + }, + }, + })) +} diff --git a/integrations/config/v1/consts.go b/integrations/config/v1/consts.go new file mode 100644 index 000000000..f936a513e --- /dev/null +++ b/integrations/config/v1/consts.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +const ( + Name = "config.v1" +) diff --git a/integrations/config/v1/definition/config.pb.go b/integrations/config/v1/definition/config.pb.go new file mode 100644 index 000000000..eb38dd889 --- /dev/null +++ b/integrations/config/v1/definition/config.pb.go @@ -0,0 +1,652 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.21.1 +// source: integrations/config/v1/definition/config.proto + +package definition + +import ( + definition "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ConfigV1 Modules Call Response +type ConfigV1ModulesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of registered modules + Modules []string `protobuf:"bytes,1,rep,name=modules,proto3" json:"modules,omitempty"` +} + +func (x *ConfigV1ModulesResponse) Reset() { + *x = ConfigV1ModulesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigV1ModulesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigV1ModulesResponse) ProtoMessage() {} + +func (x *ConfigV1ModulesResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigV1ModulesResponse.ProtoReflect.Descriptor instead. +func (*ConfigV1ModulesResponse) Descriptor() ([]byte, []int) { + return file_integrations_config_v1_definition_config_proto_rawDescGZIP(), []int{0} +} + +func (x *ConfigV1ModulesResponse) GetModules() []string { + if x != nil { + return x.Modules + } + return nil +} + +// ConfigV1 ModuleDetails Call Request +type ConfigV1ModuleDetailsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the module + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + // Define if checksum of module should be returned + Checksum *bool `protobuf:"varint,2,opt,name=checksum,proto3,oneof" json:"checksum,omitempty"` +} + +func (x *ConfigV1ModuleDetailsRequest) Reset() { + *x = ConfigV1ModuleDetailsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigV1ModuleDetailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigV1ModuleDetailsRequest) ProtoMessage() {} + +func (x *ConfigV1ModuleDetailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigV1ModuleDetailsRequest.ProtoReflect.Descriptor instead. +func (*ConfigV1ModuleDetailsRequest) Descriptor() ([]byte, []int) { + return file_integrations_config_v1_definition_config_proto_rawDescGZIP(), []int{1} +} + +func (x *ConfigV1ModuleDetailsRequest) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *ConfigV1ModuleDetailsRequest) GetChecksum() bool { + if x != nil && x.Checksum != nil { + return *x.Checksum + } + return false +} + +// ConfigV1 ModuleDetails Call Response +type ConfigV1ModuleDetailsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the module + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + // List of the files + Files []*ConfigV1File `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty"` + // Sha256Sum of the module (if requested) + Checksum *string `protobuf:"bytes,3,opt,name=checksum,proto3,oneof" json:"checksum,omitempty"` +} + +func (x *ConfigV1ModuleDetailsResponse) Reset() { + *x = ConfigV1ModuleDetailsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigV1ModuleDetailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigV1ModuleDetailsResponse) ProtoMessage() {} + +func (x *ConfigV1ModuleDetailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigV1ModuleDetailsResponse.ProtoReflect.Descriptor instead. +func (*ConfigV1ModuleDetailsResponse) Descriptor() ([]byte, []int) { + return file_integrations_config_v1_definition_config_proto_rawDescGZIP(), []int{2} +} + +func (x *ConfigV1ModuleDetailsResponse) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *ConfigV1ModuleDetailsResponse) GetFiles() []*ConfigV1File { + if x != nil { + return x.Files + } + return nil +} + +func (x *ConfigV1ModuleDetailsResponse) GetChecksum() string { + if x != nil && x.Checksum != nil { + return *x.Checksum + } + return "" +} + +// ConfigV1 ModuleDetails Call Request +type ConfigV1FileDetailsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the module + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + // Name of the file + File string `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"` + // Define if checksum of module should be returned + Checksum *bool `protobuf:"varint,3,opt,name=checksum,proto3,oneof" json:"checksum,omitempty"` +} + +func (x *ConfigV1FileDetailsRequest) Reset() { + *x = ConfigV1FileDetailsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigV1FileDetailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigV1FileDetailsRequest) ProtoMessage() {} + +func (x *ConfigV1FileDetailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigV1FileDetailsRequest.ProtoReflect.Descriptor instead. +func (*ConfigV1FileDetailsRequest) Descriptor() ([]byte, []int) { + return file_integrations_config_v1_definition_config_proto_rawDescGZIP(), []int{3} +} + +func (x *ConfigV1FileDetailsRequest) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *ConfigV1FileDetailsRequest) GetFile() string { + if x != nil { + return x.File + } + return "" +} + +func (x *ConfigV1FileDetailsRequest) GetChecksum() bool { + if x != nil && x.Checksum != nil { + return *x.Checksum + } + return false +} + +// ConfigV1 ModuleDetails Call Response +type ConfigV1FileDetailsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the module + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + // Spec of the file + File *ConfigV1File `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"` +} + +func (x *ConfigV1FileDetailsResponse) Reset() { + *x = ConfigV1FileDetailsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigV1FileDetailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigV1FileDetailsResponse) ProtoMessage() {} + +func (x *ConfigV1FileDetailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigV1FileDetailsResponse.ProtoReflect.Descriptor instead. +func (*ConfigV1FileDetailsResponse) Descriptor() ([]byte, []int) { + return file_integrations_config_v1_definition_config_proto_rawDescGZIP(), []int{4} +} + +func (x *ConfigV1FileDetailsResponse) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *ConfigV1FileDetailsResponse) GetFile() *ConfigV1File { + if x != nil { + return x.File + } + return nil +} + +// Information about configuration file +type ConfigV1File struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Relative path of the config file + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // Size of the config file in bytes + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + // Sha256Sum of the file (if requested) + Checksum *string `protobuf:"bytes,3,opt,name=checksum,proto3,oneof" json:"checksum,omitempty"` + // Timestamp of the file creation + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + // Timestamp of the file update + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *ConfigV1File) Reset() { + *x = ConfigV1File{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigV1File) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigV1File) ProtoMessage() {} + +func (x *ConfigV1File) ProtoReflect() protoreflect.Message { + mi := &file_integrations_config_v1_definition_config_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigV1File.ProtoReflect.Descriptor instead. +func (*ConfigV1File) Descriptor() ([]byte, []int) { + return file_integrations_config_v1_definition_config_proto_rawDescGZIP(), []int{5} +} + +func (x *ConfigV1File) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *ConfigV1File) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *ConfigV1File) GetChecksum() string { + if x != nil && x.Checksum != nil { + return *x.Checksum + } + return "" +} + +func (x *ConfigV1File) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ConfigV1File) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +var File_integrations_config_v1_definition_config_proto protoreflect.FileDescriptor + +var file_integrations_config_v1_definition_config_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x76, + 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x56, 0x31, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x64, 0x0a, + 0x1c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x22, 0x91, 0x01, 0x0a, 0x1d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x2a, 0x0a, + 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x46, 0x69, + 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x76, 0x0a, 0x1a, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x56, 0x31, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x69, 0x6c, + 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x88, + 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, + 0x5f, 0x0a, 0x1b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x46, 0x69, 0x6c, 0x65, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, + 0x22, 0xda, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x46, 0x69, 0x6c, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x32, 0xfb, 0x01, + 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x12, 0x39, 0x0a, 0x07, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x0d, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x56, 0x31, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x31, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x45, 0x5a, 0x43, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, + 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_integrations_config_v1_definition_config_proto_rawDescOnce sync.Once + file_integrations_config_v1_definition_config_proto_rawDescData = file_integrations_config_v1_definition_config_proto_rawDesc +) + +func file_integrations_config_v1_definition_config_proto_rawDescGZIP() []byte { + file_integrations_config_v1_definition_config_proto_rawDescOnce.Do(func() { + file_integrations_config_v1_definition_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_integrations_config_v1_definition_config_proto_rawDescData) + }) + return file_integrations_config_v1_definition_config_proto_rawDescData +} + +var file_integrations_config_v1_definition_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_integrations_config_v1_definition_config_proto_goTypes = []interface{}{ + (*ConfigV1ModulesResponse)(nil), // 0: config.ConfigV1ModulesResponse + (*ConfigV1ModuleDetailsRequest)(nil), // 1: config.ConfigV1ModuleDetailsRequest + (*ConfigV1ModuleDetailsResponse)(nil), // 2: config.ConfigV1ModuleDetailsResponse + (*ConfigV1FileDetailsRequest)(nil), // 3: config.ConfigV1FileDetailsRequest + (*ConfigV1FileDetailsResponse)(nil), // 4: config.ConfigV1FileDetailsResponse + (*ConfigV1File)(nil), // 5: config.ConfigV1File + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*definition.Empty)(nil), // 7: shared.Empty +} +var file_integrations_config_v1_definition_config_proto_depIdxs = []int32{ + 5, // 0: config.ConfigV1ModuleDetailsResponse.files:type_name -> config.ConfigV1File + 5, // 1: config.ConfigV1FileDetailsResponse.file:type_name -> config.ConfigV1File + 6, // 2: config.ConfigV1File.created_at:type_name -> google.protobuf.Timestamp + 6, // 3: config.ConfigV1File.updated_at:type_name -> google.protobuf.Timestamp + 7, // 4: config.ConfigV1.Modules:input_type -> shared.Empty + 1, // 5: config.ConfigV1.ModuleDetails:input_type -> config.ConfigV1ModuleDetailsRequest + 3, // 6: config.ConfigV1.FileDetails:input_type -> config.ConfigV1FileDetailsRequest + 0, // 7: config.ConfigV1.Modules:output_type -> config.ConfigV1ModulesResponse + 2, // 8: config.ConfigV1.ModuleDetails:output_type -> config.ConfigV1ModuleDetailsResponse + 4, // 9: config.ConfigV1.FileDetails:output_type -> config.ConfigV1FileDetailsResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_integrations_config_v1_definition_config_proto_init() } +func file_integrations_config_v1_definition_config_proto_init() { + if File_integrations_config_v1_definition_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_integrations_config_v1_definition_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigV1ModulesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_config_v1_definition_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigV1ModuleDetailsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_config_v1_definition_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigV1ModuleDetailsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_config_v1_definition_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigV1FileDetailsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_config_v1_definition_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigV1FileDetailsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_config_v1_definition_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigV1File); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_integrations_config_v1_definition_config_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_integrations_config_v1_definition_config_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_integrations_config_v1_definition_config_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_integrations_config_v1_definition_config_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_integrations_config_v1_definition_config_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_integrations_config_v1_definition_config_proto_goTypes, + DependencyIndexes: file_integrations_config_v1_definition_config_proto_depIdxs, + MessageInfos: file_integrations_config_v1_definition_config_proto_msgTypes, + }.Build() + File_integrations_config_v1_definition_config_proto = out.File + file_integrations_config_v1_definition_config_proto_rawDesc = nil + file_integrations_config_v1_definition_config_proto_goTypes = nil + file_integrations_config_v1_definition_config_proto_depIdxs = nil +} diff --git a/integrations/config/v1/definition/config.proto b/integrations/config/v1/definition/config.proto new file mode 100644 index 000000000..72c280549 --- /dev/null +++ b/integrations/config/v1/definition/config.proto @@ -0,0 +1,106 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +syntax = "proto3"; + +package config; + +import "google/protobuf/timestamp.proto"; + +import "integrations/shared/v1/definition/empty.proto"; + +option go_package = "github.com/arangodb/kube-arangodb/integrations/config/v1/definition"; + +// ConfigV1 Service implementation +service ConfigV1 { + rpc Modules(shared.Empty) returns (ConfigV1ModulesResponse); + rpc ModuleDetails(ConfigV1ModuleDetailsRequest) returns (ConfigV1ModuleDetailsResponse); + rpc FileDetails(ConfigV1FileDetailsRequest) returns (ConfigV1FileDetailsResponse); +} + +// Calls + +// ConfigV1 Modules Call Response +message ConfigV1ModulesResponse { + // List of registered modules + repeated string modules = 1; +} + +// ConfigV1 ModuleDetails Call Request +message ConfigV1ModuleDetailsRequest { + // Name of the module + string module = 1; + + // Define if checksum of module should be returned + optional bool checksum = 2; +} + +// ConfigV1 ModuleDetails Call Response +message ConfigV1ModuleDetailsResponse { + // Name of the module + string module = 1; + + // List of the files + repeated ConfigV1File files = 2; + + // Sha256Sum of the module (if requested) + optional string checksum = 3; +} + +// ConfigV1 ModuleDetails Call Request +message ConfigV1FileDetailsRequest { + // Name of the module + string module = 1; + + // Name of the file + string file = 2; + + // Define if checksum of module should be returned + optional bool checksum = 3; +} + +// ConfigV1 ModuleDetails Call Response +message ConfigV1FileDetailsResponse { + // Name of the module + string module = 1; + + // Spec of the file + ConfigV1File file = 3; +} + +// Types + +// Information about configuration file +message ConfigV1File { + // Relative path of the config file + string path = 1; + + // Size of the config file in bytes + int64 size = 2; + + // Sha256Sum of the file (if requested) + optional string checksum = 3; + + // Timestamp of the file creation + google.protobuf.Timestamp created_at = 4; + + // Timestamp of the file update + google.protobuf.Timestamp updated_at = 5; +} \ No newline at end of file diff --git a/integrations/config/v1/definition/config_grpc.pb.go b/integrations/config/v1/definition/config_grpc.pb.go new file mode 100644 index 000000000..61215d82f --- /dev/null +++ b/integrations/config/v1/definition/config_grpc.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.1 +// source: integrations/config/v1/definition/config.proto + +package definition + +import ( + context "context" + definition "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ConfigV1Client is the client API for ConfigV1 service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ConfigV1Client interface { + Modules(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*ConfigV1ModulesResponse, error) + ModuleDetails(ctx context.Context, in *ConfigV1ModuleDetailsRequest, opts ...grpc.CallOption) (*ConfigV1ModuleDetailsResponse, error) + FileDetails(ctx context.Context, in *ConfigV1FileDetailsRequest, opts ...grpc.CallOption) (*ConfigV1FileDetailsResponse, error) +} + +type configV1Client struct { + cc grpc.ClientConnInterface +} + +func NewConfigV1Client(cc grpc.ClientConnInterface) ConfigV1Client { + return &configV1Client{cc} +} + +func (c *configV1Client) Modules(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*ConfigV1ModulesResponse, error) { + out := new(ConfigV1ModulesResponse) + err := c.cc.Invoke(ctx, "/config.ConfigV1/Modules", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configV1Client) ModuleDetails(ctx context.Context, in *ConfigV1ModuleDetailsRequest, opts ...grpc.CallOption) (*ConfigV1ModuleDetailsResponse, error) { + out := new(ConfigV1ModuleDetailsResponse) + err := c.cc.Invoke(ctx, "/config.ConfigV1/ModuleDetails", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configV1Client) FileDetails(ctx context.Context, in *ConfigV1FileDetailsRequest, opts ...grpc.CallOption) (*ConfigV1FileDetailsResponse, error) { + out := new(ConfigV1FileDetailsResponse) + err := c.cc.Invoke(ctx, "/config.ConfigV1/FileDetails", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ConfigV1Server is the server API for ConfigV1 service. +// All implementations must embed UnimplementedConfigV1Server +// for forward compatibility +type ConfigV1Server interface { + Modules(context.Context, *definition.Empty) (*ConfigV1ModulesResponse, error) + ModuleDetails(context.Context, *ConfigV1ModuleDetailsRequest) (*ConfigV1ModuleDetailsResponse, error) + FileDetails(context.Context, *ConfigV1FileDetailsRequest) (*ConfigV1FileDetailsResponse, error) + mustEmbedUnimplementedConfigV1Server() +} + +// UnimplementedConfigV1Server must be embedded to have forward compatible implementations. +type UnimplementedConfigV1Server struct { +} + +func (UnimplementedConfigV1Server) Modules(context.Context, *definition.Empty) (*ConfigV1ModulesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Modules not implemented") +} +func (UnimplementedConfigV1Server) ModuleDetails(context.Context, *ConfigV1ModuleDetailsRequest) (*ConfigV1ModuleDetailsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModuleDetails not implemented") +} +func (UnimplementedConfigV1Server) FileDetails(context.Context, *ConfigV1FileDetailsRequest) (*ConfigV1FileDetailsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FileDetails not implemented") +} +func (UnimplementedConfigV1Server) mustEmbedUnimplementedConfigV1Server() {} + +// UnsafeConfigV1Server may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ConfigV1Server will +// result in compilation errors. +type UnsafeConfigV1Server interface { + mustEmbedUnimplementedConfigV1Server() +} + +func RegisterConfigV1Server(s grpc.ServiceRegistrar, srv ConfigV1Server) { + s.RegisterService(&ConfigV1_ServiceDesc, srv) +} + +func _ConfigV1_Modules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(definition.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigV1Server).Modules(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/config.ConfigV1/Modules", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigV1Server).Modules(ctx, req.(*definition.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigV1_ModuleDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigV1ModuleDetailsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigV1Server).ModuleDetails(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/config.ConfigV1/ModuleDetails", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigV1Server).ModuleDetails(ctx, req.(*ConfigV1ModuleDetailsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigV1_FileDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigV1FileDetailsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigV1Server).FileDetails(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/config.ConfigV1/FileDetails", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigV1Server).FileDetails(ctx, req.(*ConfigV1FileDetailsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ConfigV1_ServiceDesc is the grpc.ServiceDesc for ConfigV1 service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ConfigV1_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "config.ConfigV1", + HandlerType: (*ConfigV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Modules", + Handler: _ConfigV1_Modules_Handler, + }, + { + MethodName: "ModuleDetails", + Handler: _ConfigV1_ModuleDetails_Handler, + }, + { + MethodName: "FileDetails", + Handler: _ConfigV1_FileDetails_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "integrations/config/v1/definition/config.proto", +} diff --git a/integrations/config/v1/file_details_test.go b/integrations/config/v1/file_details_test.go new file mode 100644 index 000000000..4d434697d --- /dev/null +++ b/integrations/config/v1/file_details_test.go @@ -0,0 +1,179 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + + pbConfigV1 "github.com/arangodb/kube-arangodb/integrations/config/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Test_Files_Details_Missing(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + _, err := client.FileDetails(ctx, &pbConfigV1.ConfigV1FileDetailsRequest{ + Module: "test", + File: "non-existent", + }) + tgrpc.AsGRPCError(t, err).Code(t, codes.NotFound).Errorf(t, "File `non-existent` not found within module `test`") +} + +func Test_Files_Details_Empty(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + tests.NewFileGenerator(t, dir).FileR(t, "file", 0) + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + resp, err := client.FileDetails(ctx, &pbConfigV1.ConfigV1FileDetailsRequest{ + Module: "test", + File: "file", + }) + require.NoError(t, err) + require.Equal(t, "test", resp.GetModule()) + require.NotNil(t, resp.GetFile()) + require.Equal(t, "file", resp.GetFile().GetPath()) + require.EqualValues(t, 0, resp.GetFile().GetSize()) + require.Empty(t, resp.GetFile().GetChecksum()) +} + +func Test_Files_Details_Empty_WC(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + tests.NewFileGenerator(t, dir).FileR(t, "file", 0) + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + resp, err := client.FileDetails(ctx, &pbConfigV1.ConfigV1FileDetailsRequest{ + Module: "test", + File: "file", + Checksum: util.NewType(true), + }) + require.NoError(t, err) + require.Equal(t, "test", resp.GetModule()) + require.NotNil(t, resp.GetFile()) + require.Equal(t, "file", resp.GetFile().GetPath()) + require.EqualValues(t, 0, resp.GetFile().GetSize()) + require.Equal(t, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", resp.GetFile().GetChecksum()) +} + +func Test_Files_Details_Data(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + tests.NewFileGenerator(t, dir).File(t, "file", []byte("DATA")) + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + resp, err := client.FileDetails(ctx, &pbConfigV1.ConfigV1FileDetailsRequest{ + Module: "test", + File: "file", + }) + require.NoError(t, err) + require.Equal(t, "test", resp.GetModule()) + require.NotNil(t, resp.GetFile()) + require.Equal(t, "file", resp.GetFile().GetPath()) + require.EqualValues(t, 4, resp.GetFile().GetSize()) + require.Empty(t, resp.GetFile().GetChecksum()) +} + +func Test_Files_Details_Data_WC(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + tests.NewFileGenerator(t, dir).File(t, "file", []byte("DATA")) + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + resp, err := client.FileDetails(ctx, &pbConfigV1.ConfigV1FileDetailsRequest{ + Module: "test", + File: "file", + Checksum: util.NewType(true), + }) + require.NoError(t, err) + require.Equal(t, "test", resp.GetModule()) + require.NotNil(t, resp.GetFile()) + require.Equal(t, "file", resp.GetFile().GetPath()) + require.EqualValues(t, 4, resp.GetFile().GetSize()) + require.Equal(t, "c97c29c7a71b392b437ee03fd17f09bb10b75e879466fc0eb757b2c4a78ac938", resp.GetFile().GetChecksum()) +} diff --git a/integrations/config/v1/impl.go b/integrations/config/v1/impl.go new file mode 100644 index 000000000..bad17c564 --- /dev/null +++ b/integrations/config/v1/impl.go @@ -0,0 +1,197 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "fmt" + "io/fs" + "os" + "path" + "path/filepath" + "sort" + "strings" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + pbConfigV1 "github.com/arangodb/kube-arangodb/integrations/config/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/svc" +) + +func New(config Config) (svc.Handler, error) { + config.Init() + + if len(config.Modules) == 0 { + return nil, errors.Errorf("Requires at least 1 module") + } + + for module, moduleConfig := range config.Modules { + if moduleConfig.Path == "" { + return nil, errors.Errorf("Path for module `%s` cannot be empty", module) + } + + if !path.IsAbs(moduleConfig.Path) { + return nil, errors.Errorf("Path `%s` for module `%s` needs to be absolute", moduleConfig.Path, module) + } + + info, err := os.Stat(moduleConfig.Path) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil, errors.Errorf("Path `%s` for module `%s` does not exists", moduleConfig.Path, module) + } + + return nil, errors.Wrapf(err, "Path `%s` for module `%s` received unknown error", moduleConfig.Path, module) + } + + if !info.IsDir() { + return nil, errors.Errorf("Path `%s` for module `%s` is not a directory", moduleConfig.Path, module) + } + } + + return &impl{ + config: config, + }, nil +} + +var _ pbConfigV1.ConfigV1Server = &impl{} +var _ svc.Handler = &impl{} + +type impl struct { + pbConfigV1.UnsafeConfigV1Server + + config Config +} + +func (i *impl) Name() string { + return Name +} + +func (i *impl) Health() svc.HealthState { + return svc.Healthy +} + +func (i *impl) Register(registrar *grpc.Server) { + pbConfigV1.RegisterConfigV1Server(registrar, i) +} + +func (i *impl) Modules(ctx context.Context, empty *pbSharedV1.Empty) (*pbConfigV1.ConfigV1ModulesResponse, error) { + res := &pbConfigV1.ConfigV1ModulesResponse{} + + res.Modules = util.SortKeys(i.config.Modules) + + return res, nil +} + +func (i *impl) ModuleDetails(ctx context.Context, request *pbConfigV1.ConfigV1ModuleDetailsRequest) (*pbConfigV1.ConfigV1ModuleDetailsResponse, error) { + if request.GetModule() == "" { + return nil, status.Errorf(codes.InvalidArgument, "Module name cannot be empty") + } + + module, ok := i.config.Modules[request.GetModule()] + if !ok { + return nil, status.Errorf(codes.NotFound, "Module `%s` not found", request.GetModule()) + } + + var resp pbConfigV1.ConfigV1ModuleDetailsResponse + + resp.Module = request.GetModule() + + var files []*pbConfigV1.ConfigV1File + + if err := filepath.Walk(module.Path, func(p string, info fs.FileInfo, err error) error { + if err != nil { + return err + } + + if !info.Mode().IsRegular() { + return nil + } + + if !strings.HasPrefix(p, fmt.Sprintf("%s/", module.Path)) { + return nil + } + + f, err := i.fileDetails(module, strings.TrimPrefix(p, fmt.Sprintf("%s/", module.Path)), request.GetChecksum()) + if err != nil { + return err + } + + files = append(files, f) + + return nil + }); err != nil { + if gErr, ok := svc.AsGRPCErrorStatus(err); ok { + return nil, gErr + } + return nil, status.Errorf(codes.Internal, "Unable to list directory for module `%s`", request.GetModule()) + } + + sort.Slice(files, func(i, j int) bool { + return files[i].GetPath() < files[j].GetPath() + }) + + resp.Files = files + + if request.GetChecksum() { + checksums := make([]string, len(files)) + for id := range files { + checksums[id] = fmt.Sprintf("%s:%s", files[id].GetPath(), files[id].GetChecksum()) + } + + resp.Checksum = util.NewType(util.SHA256FromStringArray(checksums...)) + } + + return &resp, nil +} + +func (i *impl) FileDetails(ctx context.Context, request *pbConfigV1.ConfigV1FileDetailsRequest) (*pbConfigV1.ConfigV1FileDetailsResponse, error) { + if request.GetModule() == "" { + return nil, status.Errorf(codes.InvalidArgument, "Module name cannot be empty") + } + + module, ok := i.config.Modules[request.GetModule()] + if !ok { + return nil, status.Errorf(codes.NotFound, "Module `%s` not found", request.GetModule()) + } + + if request.GetFile() == "" { + return nil, status.Errorf(codes.InvalidArgument, "File name cannot be empty") + } + + if request.GetFile() == "" { + return nil, status.Errorf(codes.NotFound, "File name cannot be empty") + } + + f, err := i.fileDetails(module, request.GetFile(), request.GetChecksum()) + if err != nil { + return nil, err + } + + return &pbConfigV1.ConfigV1FileDetailsResponse{ + Module: request.GetModule(), + File: f, + }, nil +} diff --git a/integrations/config/v1/impl_darwin.go b/integrations/config/v1/impl_darwin.go new file mode 100644 index 000000000..6e265afa7 --- /dev/null +++ b/integrations/config/v1/impl_darwin.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "fmt" + "os" + "path" + "strings" + "syscall" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" + + pbConfigV1 "github.com/arangodb/kube-arangodb/integrations/config/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +func (i *impl) fileDetails(module ModuleDefinition, file string, checksum bool) (*pbConfigV1.ConfigV1File, error) { + expectedPath := path.Clean(path.Join(module.Path, file)) + + if !strings.HasPrefix(expectedPath, fmt.Sprintf("%s/", module.Path)) { + return nil, status.Errorf(codes.InvalidArgument, "File name cannot be empty") + } + + stat, err := os.Stat(expectedPath) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil, status.Errorf(codes.NotFound, "File `%s` not found within module `%s`", file, module.Name) + } + + logger.Err(err).Str("module", module.Name).Str("file", file).Str("real-path", expectedPath).Warn("Unable to get file") + return nil, status.Errorf(codes.Internal, "Unable to list directory for module `%s`", module.Name) + } + + finfo, ok := stat.Sys().(*syscall.Stat_t) + if !ok { + logger.Str("module", module.Name).Str("file", file).Str("real-path", expectedPath).Warn("Invalid Stat Pointer for file") + return nil, status.Errorf(codes.Internal, "Fetch of file `%s` within module `%s` failed", file, module.Name) + } + + var f pbConfigV1.ConfigV1File + + f.Path = strings.TrimPrefix(expectedPath, fmt.Sprintf("%s/", module.Path)) + f.Size = finfo.Size + f.CreatedAt = timestamppb.New(time.Unix(finfo.Ctimespec.Sec, finfo.Ctimespec.Nsec)) + f.UpdatedAt = timestamppb.New(time.Unix(finfo.Mtimespec.Sec, finfo.Mtimespec.Nsec)) + + if checksum { + c, err := util.SHA256FromFile(expectedPath) + if err != nil { + logger.Str("module", module.Name).Str("file", file).Str("real-path", expectedPath).Warn("Unable to get file checksum") + return nil, status.Errorf(codes.Internal, "Unable to calculate checksum of file `%s` within module `%s` failed", file, module.Name) + } + f.Checksum = util.NewType(c) + } + + return &f, nil +} diff --git a/integrations/config/v1/impl_linux.go b/integrations/config/v1/impl_linux.go new file mode 100644 index 000000000..cc5091702 --- /dev/null +++ b/integrations/config/v1/impl_linux.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "fmt" + "os" + "path" + "strings" + "syscall" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" + + pbConfigV1 "github.com/arangodb/kube-arangodb/integrations/config/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +func (i *impl) fileDetails(module ModuleDefinition, file string, checksum bool) (*pbConfigV1.ConfigV1File, error) { + expectedPath := path.Clean(path.Join(module.Path, file)) + + if !strings.HasPrefix(expectedPath, fmt.Sprintf("%s/", module.Path)) { + return nil, status.Errorf(codes.InvalidArgument, "File name cannot be empty") + } + + stat, err := os.Stat(expectedPath) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil, status.Errorf(codes.NotFound, "File `%s` not found within module `%s`", file, module.Name) + } + + logger.Err(err).Str("module", module.Name).Str("file", file).Str("real-path", expectedPath).Warn("Unable to get file") + return nil, status.Errorf(codes.Internal, "Unable to list directory for module `%s`", module.Name) + } + + finfo, ok := stat.Sys().(*syscall.Stat_t) + if !ok { + logger.Str("module", module.Name).Str("file", file).Str("real-path", expectedPath).Warn("Invalid Stat Pointer for file") + return nil, status.Errorf(codes.Internal, "Fetch of file `%s` within module `%s` failed", file, module.Name) + } + + var f pbConfigV1.ConfigV1File + + f.Path = strings.TrimPrefix(expectedPath, fmt.Sprintf("%s/", module.Path)) + f.Size = finfo.Size + f.CreatedAt = timestamppb.New(time.Unix(finfo.Ctim.Sec, finfo.Ctim.Nsec)) + f.UpdatedAt = timestamppb.New(time.Unix(finfo.Mtim.Sec, finfo.Mtim.Nsec)) + + if checksum { + c, err := util.SHA256FromFile(expectedPath) + if err != nil { + logger.Str("module", module.Name).Str("file", file).Str("real-path", expectedPath).Warn("Unable to get file checksum") + return nil, status.Errorf(codes.Internal, "Unable to calculate checksum of file `%s` within module `%s` failed", file, module.Name) + } + f.Checksum = util.NewType(c) + } + + return &f, nil +} diff --git a/integrations/config/v1/logger.go b/integrations/config/v1/logger.go new file mode 100644 index 000000000..bf8b37ec4 --- /dev/null +++ b/integrations/config/v1/logger.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import "github.com/arangodb/kube-arangodb/pkg/logging" + +var logger = logging.Global().RegisterAndGetLogger("integration-config-v1", logging.Info) diff --git a/integrations/config/v1/module_details_test.go b/integrations/config/v1/module_details_test.go new file mode 100644 index 000000000..7f78c83e6 --- /dev/null +++ b/integrations/config/v1/module_details_test.go @@ -0,0 +1,192 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + + pbConfigV1 "github.com/arangodb/kube-arangodb/integrations/config/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Test_Modules_Details_Empty(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + _, err := client.ModuleDetails(ctx, &pbConfigV1.ConfigV1ModuleDetailsRequest{}) + tgrpc.AsGRPCError(t, err).Code(t, codes.InvalidArgument).Errorf(t, "Module name cannot be empty") +} + +func Test_Modules_Details_NotFound(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + _, err := client.ModuleDetails(ctx, &pbConfigV1.ConfigV1ModuleDetailsRequest{ + Module: "some", + }) + tgrpc.AsGRPCError(t, err).Code(t, codes.NotFound).Errorf(t, "Module `some` not found") +} + +func Test_Modules_Details_Exists_EmptyFiles(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + module, err := client.ModuleDetails(ctx, &pbConfigV1.ConfigV1ModuleDetailsRequest{ + Module: "test", + }) + require.NoError(t, err) + require.Equal(t, "test", module.GetModule()) + require.Len(t, module.GetFiles(), 0) + require.Equal(t, "", module.GetChecksum()) +} + +func Test_Modules_Details_Exists_EmptyFiles_WithChecksum(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + module, err := client.ModuleDetails(ctx, &pbConfigV1.ConfigV1ModuleDetailsRequest{ + Module: "test", + Checksum: util.NewType(true), + }) + require.NoError(t, err) + require.Equal(t, "test", module.GetModule()) + require.Len(t, module.GetFiles(), 0) + require.Equal(t, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", module.GetChecksum()) +} + +func Test_Modules_Details_Exists_SomeFiles(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + tests.NewFileGenerator(t, dir). + FileR(t, "test", 128). + Directory(t, "sub").FileR(t, "test", 128) + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + module, err := client.ModuleDetails(ctx, &pbConfigV1.ConfigV1ModuleDetailsRequest{ + Module: "test", + }) + require.NoError(t, err) + require.Equal(t, "test", module.GetModule()) + require.Len(t, module.GetFiles(), 2) + files := module.GetFiles() + require.Equal(t, "sub/test", files[0].GetPath()) + require.Equal(t, "test", files[1].GetPath()) + require.Equal(t, "", module.GetChecksum()) +} + +func Test_Modules_Details_Exists_SomeFiles_WithChecksum(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + tests.NewFileGenerator(t, dir). + File(t, "test", []byte("DATA")). + Directory(t, "sub").File(t, "test", []byte("DATA2")) + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + module, err := client.ModuleDetails(ctx, &pbConfigV1.ConfigV1ModuleDetailsRequest{ + Module: "test", + Checksum: util.NewType(true), + }) + require.NoError(t, err) + require.Equal(t, "test", module.GetModule()) + require.Len(t, module.GetFiles(), 2) + files := module.GetFiles() + require.Equal(t, "sub/test", files[0].GetPath()) + require.Equal(t, "test", files[1].GetPath()) + require.Equal(t, "e357414aec56cf8e5e3988b53b766049521a1f4920ad72462d48ebbe16942915", module.GetChecksum()) +} diff --git a/integrations/config/v1/module_test.go b/integrations/config/v1/module_test.go new file mode 100644 index 000000000..8c89ae255 --- /dev/null +++ b/integrations/config/v1/module_test.go @@ -0,0 +1,75 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" +) + +func Test_Modules_Single(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + modules, err := client.Modules(ctx, &pbSharedV1.Empty{}) + require.NoError(t, err) + require.Len(t, modules.GetModules(), 1) +} + +func Test_Modules_Multi(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + dir := t.TempDir() + + client := Client(t, ctx, Config{ + Modules: ModuleDefinitions{ + "test": { + Path: dir, + }, + "test2": { + Path: dir, + }, + }, + }) + + require.NotNil(t, client) + + modules, err := client.Modules(ctx, &pbSharedV1.Empty{}) + require.NoError(t, err) + require.Len(t, modules.GetModules(), 2) +} diff --git a/integrations/config/v1/service_test.go b/integrations/config/v1/service_test.go new file mode 100644 index 000000000..2e85595a5 --- /dev/null +++ b/integrations/config/v1/service_test.go @@ -0,0 +1,46 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + pbConfigV1 "github.com/arangodb/kube-arangodb/integrations/config/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/svc" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Client(t *testing.T, ctx context.Context, config Config) pbConfigV1.ConfigV1Client { + h, err := New(config) + require.NoError(t, err) + local := svc.NewService(svc.Configuration{ + Address: "127.0.0.1:0", + }, h) + + start := local.Start(ctx) + + client := tgrpc.NewGRPCClient(t, ctx, pbConfigV1.NewConfigV1Client, start.Address()) + + return client +} diff --git a/integrations/scheduler/v1/consts.go b/integrations/scheduler/v1/consts.go new file mode 100644 index 000000000..b34e8635d --- /dev/null +++ b/integrations/scheduler/v1/consts.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +const ( + Name = "scheduler.v1" +) diff --git a/pkg/integrations/authentication_v1.go b/pkg/integrations/authentication_v1.go index 4387abc63..3de449d76 100644 --- a/pkg/integrations/authentication_v1.go +++ b/pkg/integrations/authentication_v1.go @@ -31,7 +31,7 @@ import ( ) func init() { - register(func() Integration { + registerer.Register(pbAuthenticationV1.Name, func() Integration { return &authenticationV1{} }) } diff --git a/pkg/integrations/authorization_v0.go b/pkg/integrations/authorization_v0.go index 7cb0efce1..d63ab33d5 100644 --- a/pkg/integrations/authorization_v0.go +++ b/pkg/integrations/authorization_v0.go @@ -31,7 +31,7 @@ import ( ) func init() { - register(func() Integration { + registerer.Register(pbAuthorizationV0.Name, func() Integration { return &authorizationV0{} }) } diff --git a/pkg/integrations/config_v1.go b/pkg/integrations/config_v1.go new file mode 100644 index 000000000..582605a03 --- /dev/null +++ b/pkg/integrations/config_v1.go @@ -0,0 +1,77 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "context" + + "github.com/spf13/cobra" + + pbImplConfigV1 "github.com/arangodb/kube-arangodb/integrations/config/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/strings" + "github.com/arangodb/kube-arangodb/pkg/util/svc" +) + +func init() { + registerer.Register(pbImplConfigV1.Name, func() Integration { + return &configV1{} + }) +} + +type configV1 struct { + modules []string +} + +func (a *configV1) Register(cmd *cobra.Command, arg ArgGen) error { + f := cmd.Flags() + + f.StringSliceVar(&a.modules, arg("module"), nil, "Module in the reference =") + + return nil +} + +func (a *configV1) Handler(ctx context.Context) (svc.Handler, error) { + var cfg pbImplConfigV1.Config + + cfg.Modules = map[string]pbImplConfigV1.ModuleDefinition{} + + for _, module := range a.modules { + l := strings.SplitN(module, "=", 2) + if len(l) != 2 { + return nil, errors.Errorf("Invalid module definition: %s", module) + } + + cfg.Modules[l[0]] = pbImplConfigV1.ModuleDefinition{ + Path: l[1], + } + } + + return pbImplConfigV1.New(cfg) +} + +func (a *configV1) Name() string { + return pbImplConfigV1.Name +} + +func (a *configV1) Description() string { + return "Enable ConfigV1 Integration Service" +} diff --git a/pkg/integrations/envoy_auth_v3.go b/pkg/integrations/envoy_auth_v3.go index 104ff1f89..aadfabacc 100644 --- a/pkg/integrations/envoy_auth_v3.go +++ b/pkg/integrations/envoy_auth_v3.go @@ -30,7 +30,7 @@ import ( ) func init() { - register(func() Integration { + registerer.Register(pbImplEnvoyAuthV3.Name, func() Integration { return &envoyAuthV3{} }) } diff --git a/pkg/integrations/register.go b/pkg/integrations/register.go index 807687e23..367eff288 100644 --- a/pkg/integrations/register.go +++ b/pkg/integrations/register.go @@ -23,26 +23,16 @@ package integrations import ( "fmt" "sort" - "sync" "github.com/spf13/cobra" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/shutdown" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) -var ( - lock sync.Mutex - registered []Factory -) - -func register(i Factory) { - lock.Lock() - defer lock.Unlock() - - registered = append(registered, i) -} +var registerer = util.NewRegisterer[string, Factory]() func Register(cmd *cobra.Command) error { var c configuration @@ -65,13 +55,9 @@ type configuration struct { } func (c *configuration) Register(cmd *cobra.Command) error { - lock.Lock() - defer lock.Unlock() - - c.registered = make([]Integration, len(registered)) - for id := range registered { - c.registered[id] = registered[id]() - } + c.registered = util.FormatList(registerer.Items(), func(a util.KV[string, Factory]) Integration { + return a.V() + }) sort.Slice(c.registered, func(i, j int) bool { return c.registered[i].Name() < c.registered[j].Name() diff --git a/pkg/integrations/scheduler_v1.go b/pkg/integrations/scheduler_v1.go index 34cb3c565..e6d906797 100644 --- a/pkg/integrations/scheduler_v1.go +++ b/pkg/integrations/scheduler_v1.go @@ -33,7 +33,7 @@ import ( ) func init() { - register(func() Integration { + registerer.Register(pbImplSchedulerV1.Name, func() Integration { return &schedulerV1{} }) } @@ -43,7 +43,7 @@ type schedulerV1 struct { } func (b *schedulerV1) Name() string { - return "scheduler.v1" + return pbImplSchedulerV1.Name } func (b *schedulerV1) Description() string { diff --git a/pkg/integrations/shutdown_v1.go b/pkg/integrations/shutdown_v1.go index 13c518fa0..926a66fc2 100644 --- a/pkg/integrations/shutdown_v1.go +++ b/pkg/integrations/shutdown_v1.go @@ -31,7 +31,7 @@ import ( ) func init() { - register(func() Integration { + registerer.Register(pbImplShutdownV1.Name, func() Integration { return &shutdownV1{} }) } diff --git a/pkg/integrations/storage_v1.go b/pkg/integrations/storage_v1.go index f613086b9..ffa351f4e 100644 --- a/pkg/integrations/storage_v1.go +++ b/pkg/integrations/storage_v1.go @@ -30,7 +30,7 @@ import ( ) func init() { - register(func() Integration { + registerer.Register(storage.Name, func() Integration { return &storageV1{} }) } @@ -40,7 +40,7 @@ type storageV1 struct { } func (b *storageV1) Name() string { - return "storage.v1" + return storage.Name } func (b *storageV1) Description() string { diff --git a/pkg/ml/storage/consts.go b/pkg/ml/storage/consts.go new file mode 100644 index 000000000..a170c7072 --- /dev/null +++ b/pkg/ml/storage/consts.go @@ -0,0 +1,23 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package storage + +const Name = "storage.v1" diff --git a/pkg/upgrade/upgrade_test.go b/pkg/upgrade/upgrade_test.go index abd653f49..219883877 100644 --- a/pkg/upgrade/upgrade_test.go +++ b/pkg/upgrade/upgrade_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ func Test_Verify_WrongOrder(t *testing.T) { ) _, err := u.Execute(api.ArangoDeployment{}, nil, nil) - require.EqualError(t, err, "Invalid version in 1.1.1 - got 3, expected 2") + require.EqualError(t, err, "Invalid version in 1.1.1 - got 3, expected 1") }) t.Run("Valid multi version", func(t *testing.T) { var u Upgrades diff --git a/pkg/util/checksum.go b/pkg/util/checksum.go index 41028698e..144bbe291 100644 --- a/pkg/util/checksum.go +++ b/pkg/util/checksum.go @@ -24,6 +24,8 @@ import ( "crypto/md5" "crypto/sha256" "fmt" + "io" + "os" "k8s.io/apimachinery/pkg/util/json" @@ -56,6 +58,27 @@ func SHA256(data []byte) string { return fmt.Sprintf("%0x", sha256.Sum256(data)) } +func SHA256FromFile(file string) (string, error) { + in, err := os.OpenFile(file, os.O_RDONLY, 0644) + if err != nil { + return "", err + } + + defer in.Close() + + return SHA256FromIO(in) +} + +func SHA256FromIO(in io.Reader) (string, error) { + c := sha256.New() + + if _, err := io.CopyBuffer(c, in, make([]byte, 4096)); err != nil { + return "", err + } + + return fmt.Sprintf("%0x", c.Sum(nil)), nil +} + func MD5FromString(data string) string { return MD5([]byte(data)) } diff --git a/pkg/util/dict.go b/pkg/util/dict.go index 7643d36fa..edcd37fc4 100644 --- a/pkg/util/dict.go +++ b/pkg/util/dict.go @@ -22,7 +22,6 @@ package util import ( "maps" - "reflect" "sort" ) @@ -53,24 +52,34 @@ func Sort[IN any](in []IN, cmp func(i, j IN) bool) []IN { return r } -func SortKeys(m interface{}) []string { - if m == nil { - return []string{} +func MapValues[K comparable, V any](m map[K]V) []V { + r := make([]V, 0, len(m)) + + for k := range m { + r = append(r, m[k]) } - q := reflect.ValueOf(m).MapKeys() + return r +} - r := make([]string, len(q)) +func MapKeys[K comparable, V any](m map[K]V) []K { + r := make([]K, 0, len(m)) - for id, v := range q { - r[id] = v.String() + for k := range m { + r = append(r, k) } - sort.Strings(r) - return r } +func SortKeys[V any](m map[string]V) []string { + keys := MapKeys(m) + + sort.Strings(keys) + + return keys +} + func CopyFullMap[K comparable, V any](src map[K]V) map[K]V { if src == nil { return nil diff --git a/pkg/util/registerer.go b/pkg/util/registerer.go new file mode 100644 index 000000000..ad9f6d01f --- /dev/null +++ b/pkg/util/registerer.go @@ -0,0 +1,71 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package util + +import "sync" + +func NewRegisterer[K comparable, V any]() Registerer[K, V] { + return ®isterer[K, V]{ + items: make(map[K]V), + } +} + +type Registerer[K comparable, V any] interface { + Register(key K, value V) bool + MustRegister(key K, value V) + + Items() []KV[K, V] +} + +type registerer[K comparable, V any] struct { + lock sync.Mutex + + items map[K]V +} + +func (r *registerer[K, V]) Register(key K, value V) bool { + r.lock.Lock() + defer r.lock.Unlock() + + if _, ok := r.items[key]; ok { + return false + } + + r.items[key] = value + + return true +} + +func (r *registerer[K, V]) MustRegister(key K, value V) { + r.lock.Lock() + defer r.lock.Unlock() + + if !r.Register(key, value) { + panic("Unable to register item") + } +} + +func (r *registerer[K, V]) Items() []KV[K, V] { + r.lock.Lock() + defer r.lock.Unlock() + + return Extract(r.items) +} diff --git a/pkg/util/strings/strings.go b/pkg/util/strings/strings.go index 52fa89a11..dd848a761 100644 --- a/pkg/util/strings/strings.go +++ b/pkg/util/strings/strings.go @@ -130,6 +130,23 @@ func Split(s, sep string) []string { return strings.Split(s, sep) } +// SplitN slices s into substrings separated by sep and returns a slice of +// the substrings between those separators. +// +// The count determines the number of substrings to return: +// +// n > 0: at most n substrings; the last substring will be the unsplit remainder. +// n == 0: the result is nil (zero substrings) +// n < 0: all substrings +// +// Edge cases for s and sep (for example, empty strings) are handled +// as described in the documentation for [Split]. +// +// To split around the first instance of a separator, see Cut. +func SplitN(s, sep string, n int) []string { + return strings.SplitN(s, sep, n) +} + // ToLower returns s with all Unicode letters mapped to their lower case. func ToLower(s string) string { return strings.ToLower(s) diff --git a/pkg/util/svc/error.go b/pkg/util/svc/error.go index a7c9ed475..da183f5b7 100644 --- a/pkg/util/svc/error.go +++ b/pkg/util/svc/error.go @@ -20,7 +20,12 @@ package svc -import "context" +import ( + "context" + "errors" + + "google.golang.org/grpc/status" +) type serviceError struct { error @@ -45,3 +50,17 @@ func (p serviceError) Update(key string, state HealthState) { func (p serviceError) Start(ctx context.Context) ServiceStarter { return p } + +type GRPCErrorStatus interface { + error + + GRPCStatus() *status.Status +} + +func AsGRPCErrorStatus(err error) (GRPCErrorStatus, bool) { + var v GRPCErrorStatus + if errors.As(err, &v) { + return v, true + } + return nil, false +} diff --git a/pkg/util/tests/path.go b/pkg/util/tests/path.go new file mode 100644 index 000000000..c1078a656 --- /dev/null +++ b/pkg/util/tests/path.go @@ -0,0 +1,95 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package tests + +import ( + "os" + "path" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type FileGenerator interface { + Parent(t *testing.T) FileGenerator + + Directory(t *testing.T, name string) FileGenerator + + File(t *testing.T, name string, data []byte) FileGenerator + + FileR(t *testing.T, name string, size int) FileGenerator +} + +type fileGenerator struct { + root string + path string +} + +func (f fileGenerator) FileR(t *testing.T, name string, size int) FileGenerator { + var data = make([]byte, size) + + _, err := util.Rand().Read(data) + require.NoError(t, err) + + return f.File(t, name, data) +} + +func (f fileGenerator) Parent(t *testing.T) FileGenerator { + require.NotEqual(t, f.root, f.path, "Unable to jump above root") + + return fileGenerator{ + root: f.root, + path: path.Dir(f.path), + } +} + +func (f fileGenerator) Directory(t *testing.T, name string) FileGenerator { + np := path.Join(f.path, name) + + if err := os.Mkdir(np, 0755); err != nil { + if !errors.Is(err, os.ErrExist) { + require.NoError(t, err) + } + } + + return fileGenerator{ + root: f.root, + path: np, + } +} + +func (f fileGenerator) File(t *testing.T, name string, data []byte) FileGenerator { + require.NoError(t, os.WriteFile(path.Join(f.path, name), data, 0644)) + return f +} + +func NewFileGenerator(t *testing.T, root string) FileGenerator { + if err := os.Mkdir(root, 0755); err != nil { + if !errors.Is(err, os.ErrExist) { + require.NoError(t, err) + } + } + + return fileGenerator{root: root, path: root} +} diff --git a/pkg/util/tests/tgrpc/grpc.go b/pkg/util/tests/tgrpc/grpc.go index 7ba422855..dacb456a5 100644 --- a/pkg/util/tests/tgrpc/grpc.go +++ b/pkg/util/tests/tgrpc/grpc.go @@ -22,11 +22,16 @@ package tgrpc import ( "context" + "fmt" "testing" "github.com/stretchr/testify/require" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" + + "github.com/arangodb/kube-arangodb/pkg/util/svc" ) func NewGRPCClient[T any](t *testing.T, ctx context.Context, in func(cc grpc.ClientConnInterface) T, addr string, opts ...grpc.DialOption) T { @@ -51,3 +56,30 @@ func NewGRPCConn(t *testing.T, ctx context.Context, addr string, opts ...grpc.Di return conn } + +type ErrorStatusValidator interface { + Code(t *testing.T, code codes.Code) ErrorStatusValidator + Errorf(t *testing.T, msg string, args ...interface{}) ErrorStatusValidator +} + +type errorStatusValidator struct { + st *status.Status +} + +func (e errorStatusValidator) Errorf(t *testing.T, msg string, args ...interface{}) ErrorStatusValidator { + require.Equal(t, e.st.Message(), fmt.Sprintf(msg, args...)) + return e +} + +func (e errorStatusValidator) Code(t *testing.T, code codes.Code) ErrorStatusValidator { + require.Equal(t, code, e.st.Code()) + return e +} + +func AsGRPCError(t *testing.T, err error) ErrorStatusValidator { + v, ok := svc.AsGRPCErrorStatus(err) + require.True(t, ok) + st := v.GRPCStatus() + require.NotNil(t, st) + return errorStatusValidator{st: st} +} From f2daa8a97575199f5366de16e0b109e0272d673a Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:13:14 +0200 Subject: [PATCH 17/50] [Feature] Integration Service Authentication (#1705) --- CHANGELOG.md | 1 + .../shutdown/v1/{ => definition}/consts.go | 2 +- integrations/shutdown/v1/impl.go | 2 +- pkg/integrations/auth.go | 70 +++++++ pkg/integrations/auth_test.go | 132 +++++++++++++ pkg/integrations/clients/client.go | 83 ++++++++ pkg/integrations/clients/health_v1.go | 73 +++++++ pkg/integrations/clients/register.go | 98 ++++++++++ pkg/integrations/clients/shutdown_v1.go | 60 ++++++ pkg/integrations/integration.go | 14 ++ pkg/integrations/register.go | 178 ++++++++++++++++-- pkg/integrations/shutdown_v1.go | 7 +- pkg/integrations/suite_test.go | 111 +++++++++++ pkg/util/grpc.go | 71 +++++++ pkg/util/registerer.go | 3 - pkg/util/shutdown/shutdown.go | 7 - pkg/util/svc/health.go | 2 + pkg/util/tests/network.go | 67 +++++++ pkg/util/tests/tgrpc/grpc.go | 19 +- 19 files changed, 953 insertions(+), 47 deletions(-) rename integrations/shutdown/v1/{ => definition}/consts.go (97%) create mode 100644 pkg/integrations/auth.go create mode 100644 pkg/integrations/auth_test.go create mode 100644 pkg/integrations/clients/client.go create mode 100644 pkg/integrations/clients/health_v1.go create mode 100644 pkg/integrations/clients/register.go create mode 100644 pkg/integrations/clients/shutdown_v1.go create mode 100644 pkg/integrations/suite_test.go create mode 100644 pkg/util/grpc.go create mode 100644 pkg/util/tests/network.go diff --git a/CHANGELOG.md b/CHANGELOG.md index af0c001b6..81b31c60a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - (Feature) Gateway Group for ArangoDeployment - (Feature) Gateway config loader - (Feature) ConfigV1 Integration Service +- (Feature) Integration Service Authentication ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/integrations/shutdown/v1/consts.go b/integrations/shutdown/v1/definition/consts.go similarity index 97% rename from integrations/shutdown/v1/consts.go rename to integrations/shutdown/v1/definition/consts.go index ac55fa72a..048827cc8 100644 --- a/integrations/shutdown/v1/consts.go +++ b/integrations/shutdown/v1/definition/consts.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -package v1 +package definition const ( Name = "shutdown.v1" diff --git a/integrations/shutdown/v1/impl.go b/integrations/shutdown/v1/impl.go index 3e369e84e..65ce4cb46 100644 --- a/integrations/shutdown/v1/impl.go +++ b/integrations/shutdown/v1/impl.go @@ -45,7 +45,7 @@ type impl struct { } func (i *impl) Name() string { - return Name + return pbShutdownV1.Name } func (i *impl) Health() svc.HealthState { diff --git a/pkg/integrations/auth.go b/pkg/integrations/auth.go new file mode 100644 index 000000000..027f1f83b --- /dev/null +++ b/pkg/integrations/auth.go @@ -0,0 +1,70 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func basicTokenAuthAuthorize(ctx context.Context, token string) error { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return status.Errorf(codes.Unauthenticated, "metadata is not provided") + } + + values := md[util.AuthorizationGRPCHeader] + if len(values) == 0 { + return status.Errorf(codes.Unauthenticated, "authorization token is not provided") + } + + if token != values[0] { + return status.Errorf(codes.Unauthenticated, "invalid token") + } + + return nil +} + +func basicTokenAuthUnaryInterceptor(token string) grpc.ServerOption { + return grpc.UnaryInterceptor(func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) { + if err := basicTokenAuthAuthorize(ctx, token); err != nil { + return nil, err + } + + return handler(ctx, req) + }) +} + +func basicTokenAuthStreamInterceptor(token string) grpc.ServerOption { + return grpc.StreamInterceptor(func(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + if err := basicTokenAuthAuthorize(ss.Context(), token); err != nil { + return err + } + + return handler(srv, ss) + }) +} diff --git a/pkg/integrations/auth_test.go b/pkg/integrations/auth_test.go new file mode 100644 index 000000000..79e122960 --- /dev/null +++ b/pkg/integrations/auth_test.go @@ -0,0 +1,132 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Test_AuthCases(t *testing.T) { + c, health, internal, external := startService(t, + "--health.auth.type=None", + "--services.external.auth.token=test1", + "--services.external.auth.type=Token", + "--services.auth.token=test2", + "--services.auth.type=Token", + ) + defer c.Require(t) + + t.Run("Without auth", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--token=", + "client", + "health", + "v1")) + }) + t.Run("internal", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--token=", + "client", + "health", + "v1")). + Code(t, codes.Unauthenticated). + Errorf(t, "authorization token is not provided") + }) + t.Run("external", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--token=", + "client", + "health", + "v1")). + Code(t, codes.Unauthenticated). + Errorf(t, "authorization token is not provided") + }) + }) + + t.Run("With auth 1", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--token=test1", + "client", + "health", + "v1")) + }) + t.Run("internal", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--token=test1", + "client", + "health", + "v1")). + Code(t, codes.Unauthenticated). + Errorf(t, "invalid token") + }) + t.Run("external", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--token=test1", + "client", + "health", + "v1")) + }) + }) + + t.Run("With auth 2", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--token=test2", + "client", + "health", + "v1")) + }) + t.Run("internal", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--token=test2", + "client", + "health", + "v1")) + }) + t.Run("external", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--token=test2", + "client", + "health", + "v1")). + Code(t, codes.Unauthenticated). + Errorf(t, "invalid token") + }) + }) +} diff --git a/pkg/integrations/clients/client.go b/pkg/integrations/clients/client.go new file mode 100644 index 000000000..0c28a502a --- /dev/null +++ b/pkg/integrations/clients/client.go @@ -0,0 +1,83 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package clients + +import ( + "context" + "io" + + "github.com/spf13/cobra" + "google.golang.org/grpc" + + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" +) + +type commandRun[T any] interface { + Register(name, desc string, in func(ctx context.Context, client T) error) commandRun[T] +} + +type commandRunImpl[T any] struct { + cmd *cobra.Command + cfg *Config + in func(cc grpc.ClientConnInterface) T +} + +func (c commandRunImpl[T]) Register(name, desc string, in func(ctx context.Context, client T) error) commandRun[T] { + c.cmd.AddCommand(&cobra.Command{ + Use: name, + Short: desc, + RunE: func(cmd *cobra.Command, args []string) error { + client, closer, err := client(shutdown.Context(), c.cfg, c.in) + if err != nil { + return err + } + + defer closer.Close() + + return in(shutdown.Context(), client) + }, + }) + return c +} + +func withCommandRun[T any](cmd *cobra.Command, cfg *Config, in func(cc grpc.ClientConnInterface) T) commandRun[T] { + return &commandRunImpl[T]{ + cmd: cmd, + cfg: cfg, + in: in, + } +} + +func client[T any](ctx context.Context, cfg *Config, in func(cc grpc.ClientConnInterface) T) (T, io.Closer, error) { + var opts []grpc.DialOption + + if token := cfg.Token; token != "" { + opts = append(opts, util.TokenAuthInterceptors(token)...) + } + + client, closer, err := util.NewGRPCClient(ctx, in, cfg.Address, opts...) + if err != nil { + return util.Default[T](), nil, err + } + + return client, closer, nil +} diff --git a/pkg/integrations/clients/health_v1.go b/pkg/integrations/clients/health_v1.go new file mode 100644 index 000000000..bd3030fb7 --- /dev/null +++ b/pkg/integrations/clients/health_v1.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package clients + +import ( + "github.com/spf13/cobra" + pbHealth "google.golang.org/grpc/health/grpc_health_v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" +) + +func init() { + registerer.MustRegister("health/v1", func(cfg *Config) Client { + return &healthV1{ + cfg: cfg, + } + }) +} + +type healthV1 struct { + cfg *Config +} + +func (s *healthV1) Name() string { + return "health" +} + +func (s *healthV1) Version() string { + return "v1" +} + +func (s *healthV1) Register(cmd *cobra.Command) error { + cmd.RunE = func(cmd *cobra.Command, args []string) error { + client, c, err := client(shutdown.Context(), s.cfg, pbHealth.NewHealthClient) + if err != nil { + return err + } + defer c.Close() + + res, err := client.Check(shutdown.Context(), &pbHealth.HealthCheckRequest{}) + if err != nil { + return err + } + + switch s := res.GetStatus(); s { + case pbHealth.HealthCheckResponse_SERVING: + println("OK") + return nil + default: + return errors.Errorf("Not healthy: %s", s.String()) + } + } + return nil +} diff --git a/pkg/integrations/clients/register.go b/pkg/integrations/clients/register.go new file mode 100644 index 000000000..95863a790 --- /dev/null +++ b/pkg/integrations/clients/register.go @@ -0,0 +1,98 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package clients + +import ( + "github.com/spf13/cobra" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +var registerer = util.NewRegisterer[string, Factory]() + +type Factory func(c *Config) Client + +type Config struct { + Address string + Token string +} + +func (c *Config) Register(cmd *cobra.Command) error { + f := cmd.PersistentFlags() + + f.StringVar(&c.Address, "address", "127.0.0.1:8080", "GRPC Service Address") + f.StringVar(&c.Token, "token", "", "GRPC Token") + + return nil +} + +type Client interface { + Name() string + Version() string + + Register(cmd *cobra.Command) error +} + +func Register(cmd *cobra.Command) error { + client := &cobra.Command{Use: "client"} + cmd.AddCommand(client) + + var cfg config + + return cfg.Register(client) +} + +type config struct { + cfg Config +} + +func (c *config) Register(cmd *cobra.Command) error { + if err := c.cfg.Register(cmd); err != nil { + return err + } + + cmds := map[string]*cobra.Command{} + + for _, command := range registerer.Items() { + r := command.V(&c.cfg) + + v, ok := cmds[r.Name()] + if !ok { + v = &cobra.Command{ + Use: r.Name(), + } + cmd.AddCommand(v) + cmds[r.Name()] = v + } + + p := &cobra.Command{ + Use: r.Version(), + } + + if err := r.Register(p); err != nil { + return err + } + + v.AddCommand(p) + } + + return nil +} diff --git a/pkg/integrations/clients/shutdown_v1.go b/pkg/integrations/clients/shutdown_v1.go new file mode 100644 index 000000000..590d2f148 --- /dev/null +++ b/pkg/integrations/clients/shutdown_v1.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package clients + +import ( + "context" + + "github.com/spf13/cobra" + + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + pbShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1/definition" +) + +func init() { + registerer.MustRegister("shutdown/v1", func(cfg *Config) Client { + return &shutdownV1{ + cfg: cfg, + } + }) +} + +type shutdownV1 struct { + cfg *Config +} + +func (s *shutdownV1) Name() string { + return "shutdown" +} + +func (s *shutdownV1) Version() string { + return "v1" +} + +func (s *shutdownV1) Register(cmd *cobra.Command) error { + withCommandRun(cmd, s.cfg, pbShutdownV1.NewShutdownV1Client). + Register("shutdown", "Runs the Shutdown GRPC Call", func(ctx context.Context, client pbShutdownV1.ShutdownV1Client) error { + _, err := client.Shutdown(ctx, &pbSharedV1.Empty{}) + + return err + }) + return nil +} diff --git a/pkg/integrations/integration.go b/pkg/integrations/integration.go index 5ce9350dc..0b6543177 100644 --- a/pkg/integrations/integration.go +++ b/pkg/integrations/integration.go @@ -40,3 +40,17 @@ type Integration interface { Handler(ctx context.Context) (svc.Handler, error) } + +type IntegrationEnablement interface { + Integration + + EnabledTypes() (internal, external bool) +} + +func GetIntegrationEnablement(in Integration) (internal, external bool) { + if v, ok := in.(IntegrationEnablement); ok { + return v.EnabledTypes() + } + + return true, false +} diff --git a/pkg/integrations/register.go b/pkg/integrations/register.go index 367eff288..6827ebcf9 100644 --- a/pkg/integrations/register.go +++ b/pkg/integrations/register.go @@ -21,11 +21,17 @@ package integrations import ( + "context" "fmt" "sort" + "strings" + "sync" "github.com/spf13/cobra" + "google.golang.org/grpc" + pbImplShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1" + "github.com/arangodb/kube-arangodb/pkg/integrations/clients" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/shutdown" @@ -40,18 +46,60 @@ func Register(cmd *cobra.Command) error { return c.Register(cmd) } +type configurationTest struct { + ctx context.Context + cancel context.CancelFunc +} + type configuration struct { + // Only for testing + test *configurationTest + registered []Integration health struct { + serviceConfiguration shutdownEnabled bool - - config svc.Configuration } services struct { - config svc.Configuration + internal, external serviceConfiguration + } +} + +type serviceConfiguration struct { + enabled bool + + address string + + auth struct { + t string + + token string + } +} + +func (s *serviceConfiguration) Config() (svc.Configuration, error) { + var opts []grpc.ServerOption + + switch strings.ToLower(s.auth.t) { + case "none": + break + case "token": + if s.auth.token == "" { + return util.Default[svc.Configuration](), errors.Errorf("Token is empty") + } + + opts = append(opts, + basicTokenAuthUnaryInterceptor(s.auth.token), + basicTokenAuthStreamInterceptor(s.auth.token), + ) } + + return svc.Configuration{ + Options: opts, + Address: s.address, + }, nil } func (c *configuration) Register(cmd *cobra.Command) error { @@ -67,14 +115,28 @@ func (c *configuration) Register(cmd *cobra.Command) error { f := cmd.Flags() - f.StringVar(&c.health.config.Address, "health.address", "0.0.0.0:9091", "Address to expose health service") + f.StringVar(&c.health.address, "health.address", "0.0.0.0:9091", "Address to expose health service") f.BoolVar(&c.health.shutdownEnabled, "health.shutdown.enabled", true, "Determines if shutdown service should be enabled and exposed") - f.StringVar(&c.services.config.Address, "services.address", "127.0.0.1:9092", "Address to expose services") + f.StringVar(&c.health.auth.t, "health.auth.type", "None", "Auth type for health service") + f.StringVar(&c.health.auth.token, "health.auth.token", "", "Token for health service (when auth service is token)") + + f.BoolVar(&c.services.internal.enabled, "services.enabled", true, "Defines if internal access is enabled") + f.StringVar(&c.services.internal.address, "services.address", "127.0.0.1:9092", "Address to expose internal services") + f.StringVar(&c.services.internal.auth.t, "services.auth.type", "None", "Auth type for internal service") + f.StringVar(&c.services.internal.auth.token, "services.auth.token", "", "Token for internal service (when auth service is token)") + + f.BoolVar(&c.services.external.enabled, "services.external.enabled", false, "Defines if external access is enabled") + f.StringVar(&c.services.external.address, "services.external.address", "0.0.0.0:9093", "Address to expose external services") + f.StringVar(&c.services.external.auth.t, "services.external.auth.type", "None", "Auth type for external service") + f.StringVar(&c.services.external.auth.token, "services.external.auth.token", "", "Token for external service (when auth service is token)") for _, service := range c.registered { prefix := fmt.Sprintf("integration.%s", service.Name()) f.Bool(prefix, false, service.Description()) + internal, external := GetIntegrationEnablement(service) + f.Bool(fmt.Sprintf("%s.internal", prefix), internal, fmt.Sprintf("Defones if Internal access to service %s is enabled", service.Name())) + f.Bool(fmt.Sprintf("%s.external", prefix), external, fmt.Sprintf("Defones if External access to service %s is enabled", service.Name())) if err := service.Register(cmd, func(name string) string { return fmt.Sprintf("%s.%s", prefix, name) @@ -83,22 +145,65 @@ func (c *configuration) Register(cmd *cobra.Command) error { } } - return nil + return clients.Register(cmd) } func (c *configuration) run(cmd *cobra.Command, args []string) error { - handlers := make([]svc.Handler, 0, len(c.registered)) + if t := c.test; t == nil { + return c.runWithContext(shutdown.Context(), shutdown.Stop, cmd) + } else { + return c.runWithContext(t.ctx, t.cancel, cmd) + } +} + +func (c *configuration) runWithContext(ctx context.Context, cancel context.CancelFunc, cmd *cobra.Command) error { + healthConfig, err := c.health.Config() + if err != nil { + return errors.Wrapf(err, "Unable to parse health config") + } + internalConfig, err := c.services.internal.Config() + if err != nil { + return errors.Wrapf(err, "Unable to parse internal config") + } + externalConfig, err := c.services.external.Config() + if err != nil { + return errors.Wrapf(err, "Unable to parse external config") + } + + var internalHandlers, externalHandlers []svc.Handler for _, handler := range c.registered { if ok, err := cmd.Flags().GetBool(fmt.Sprintf("integration.%s", handler.Name())); err != nil { return err } else { - logger.Str("service", handler.Name()).Bool("enabled", ok).Info("Service discovered") - if ok { - if svc, err := handler.Handler(shutdown.Context()); err != nil { + internalEnabled, err := cmd.Flags().GetBool(fmt.Sprintf("integration.%s.internal", handler.Name())) + if err != nil { + return err + } + + externalEnabled, err := cmd.Flags().GetBool(fmt.Sprintf("integration.%s.external", handler.Name())) + if err != nil { + return err + } + + logger. + Str("service", handler.Name()). + Bool("enabled", ok). + Bool("internal", internalEnabled). + Bool("external", externalEnabled). + Info("Service discovered") + + if ok && (internalEnabled || externalEnabled) { + if svc, err := handler.Handler(ctx); err != nil { return err } else { - handlers = append(handlers, svc) + if internalEnabled { + internalHandlers = append(internalHandlers, svc) + } + + if externalEnabled { + externalHandlers = append(externalHandlers, svc) + } } } } @@ -107,18 +212,57 @@ func (c *configuration) run(cmd *cobra.Command, args []string) error { var healthServices []svc.Handler if c.health.shutdownEnabled { - healthServices = append(healthServices, shutdown.NewGlobalShutdownServer()) + healthServices = append(healthServices, pbImplShutdownV1.New(cancel)) } - health := svc.NewHealthService(c.health.config, svc.Readiness, healthServices...) + health := svc.NewHealthService(healthConfig, svc.Readiness, healthServices...) + + internalHandlers = append(internalHandlers, health) + externalHandlers = append(externalHandlers, health) - healthHandler := health.Start(shutdown.Context()) + healthHandler := health.Start(ctx) logger.Str("address", healthHandler.Address()).Info("Health handler started") - s := svc.NewService(c.services.config, handlers...).StartWithHealth(shutdown.Context(), health) + var wg sync.WaitGroup + + var internal, external error + + if c.services.internal.enabled { + wg.Add(1) + + go func() { + defer wg.Done() + s := svc.NewService(internalConfig, internalHandlers...).StartWithHealth(ctx, health) + + logger.Str("address", s.Address()).Str("type", "internal").Info("Service handler started") + + internal = s.Wait() + + if internal != nil { + logger.Err(internal).Str("address", s.Address()).Str("type", "internal").Error("Service handler failed") + } + }() + } + + if c.services.external.enabled { + wg.Add(1) + + go func() { + defer wg.Done() + s := svc.NewService(externalConfig, externalHandlers...).StartWithHealth(ctx, health) + + logger.Str("address", s.Address()).Str("type", "external").Info("Service handler started") + + external = s.Wait() + + if external != nil { + logger.Err(external).Str("address", s.Address()).Str("type", "external").Error("Service handler failed") + } + }() + } - logger.Str("address", s.Address()).Info("Service handler started") + wg.Wait() - return s.Wait() + return errors.Errors(internal, external) } diff --git a/pkg/integrations/shutdown_v1.go b/pkg/integrations/shutdown_v1.go index 926a66fc2..504f1931f 100644 --- a/pkg/integrations/shutdown_v1.go +++ b/pkg/integrations/shutdown_v1.go @@ -26,12 +26,13 @@ import ( "github.com/spf13/cobra" pbImplShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1" + pbShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1/definition" "github.com/arangodb/kube-arangodb/pkg/util/shutdown" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) func init() { - registerer.Register(pbImplShutdownV1.Name, func() Integration { + registerer.Register(pbShutdownV1.Name, func() Integration { return &shutdownV1{} }) } @@ -40,11 +41,11 @@ type shutdownV1 struct { } func (s *shutdownV1) Handler(ctx context.Context) (svc.Handler, error) { - return shutdown.NewGlobalShutdownServer(), nil + return pbImplShutdownV1.New(shutdown.Stop), nil } func (s *shutdownV1) Name() string { - return pbImplShutdownV1.Name + return pbShutdownV1.Name } func (s *shutdownV1) Description() string { diff --git a/pkg/integrations/suite_test.go b/pkg/integrations/suite_test.go new file mode 100644 index 000000000..e3c903621 --- /dev/null +++ b/pkg/integrations/suite_test.go @@ -0,0 +1,111 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "context" + "fmt" + "os" + "testing" + + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +type waitFunc func() error + +func (w waitFunc) Require(t *testing.T) { + require.NoError(t, w()) +} + +func executeSync(t *testing.T, ctx context.Context, args ...string) error { + var c configuration + + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + go func() { + defer cancel() + <-shutdown.Channel() + }() + + c.test = &configurationTest{ + ctx: ctx, + cancel: cancel, + } + + cmd := &cobra.Command{} + + tCmd := &cobra.Command{ + Use: "test", + } + + require.NoError(t, c.Register(tCmd)) + + cmd.AddCommand(tCmd) + + cmd.SetOut(os.Stdout) + + cmd.SetArgs(append([]string{"test"}, args...)) + + return cmd.Execute() +} + +func executeAsync(t *testing.T, ctx context.Context, args ...string) waitFunc { + ctx, cancel := context.WithCancel(ctx) + + var err error + done := make(chan struct{}) + + go func() { + defer close(done) + + err = executeSync(t, ctx, args...) + }() + + return func() error { + cancel() + <-done + return err + } +} + +func startService(t *testing.T, args ...string) (waitFunc, int, int, int) { + _, health := tests.ResolveAddress(t, "127.0.0.1:0") + _, internal := tests.ResolveAddress(t, "127.0.0.1:0") + _, external := tests.ResolveAddress(t, "127.0.0.1:0") + + cancel := executeAsync(t, shutdown.Context(), append([]string{ + fmt.Sprintf("--health.address=127.0.0.1:%d", health), + fmt.Sprintf("--services.address=127.0.0.1:%d", internal), + fmt.Sprintf("--services.external.address=127.0.0.1:%d", external), + "--services.external.enabled", + }, args...)...) + + tests.WaitForAddress(t, "127.0.0.1", health) + tests.WaitForAddress(t, "127.0.0.1", internal) + tests.WaitForAddress(t, "127.0.0.1", external) + + return cancel, health, internal, external +} diff --git a/pkg/util/grpc.go b/pkg/util/grpc.go new file mode 100644 index 000000000..1bad6ea1f --- /dev/null +++ b/pkg/util/grpc.go @@ -0,0 +1,71 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package util + +import ( + "context" + "io" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/metadata" +) + +const AuthorizationGRPCHeader = "adb-authorization" + +func NewGRPCClient[T any](ctx context.Context, in func(cc grpc.ClientConnInterface) T, addr string, opts ...grpc.DialOption) (T, io.Closer, error) { + con, err := NewGRPCConn(ctx, addr, opts...) + if err != nil { + return Default[T](), nil, err + } + + return in(con), con, nil +} + +func NewGRPCConn(ctx context.Context, addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { + var z []grpc.DialOption + + z = append(z, grpc.WithTransportCredentials(insecure.NewCredentials())) + + z = append(z, opts...) + + conn, err := grpc.DialContext(ctx, addr, z...) + if err != nil { + return nil, err + } + + return conn, nil +} + +func TokenAuthInterceptors(token string) []grpc.DialOption { + return []grpc.DialOption{ + grpc.WithUnaryInterceptor(func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + return invoker(attachTokenAuthToInterceptors(ctx, token), method, req, reply, cc, opts...) + }), + grpc.WithStreamInterceptor(func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { + return streamer(attachTokenAuthToInterceptors(ctx, token), desc, cc, method, opts...) + }), + } +} + +func attachTokenAuthToInterceptors(ctx context.Context, token string) context.Context { + return metadata.AppendToOutgoingContext(ctx, AuthorizationGRPCHeader, token) +} diff --git a/pkg/util/registerer.go b/pkg/util/registerer.go index ad9f6d01f..9eb804666 100644 --- a/pkg/util/registerer.go +++ b/pkg/util/registerer.go @@ -55,9 +55,6 @@ func (r *registerer[K, V]) Register(key K, value V) bool { } func (r *registerer[K, V]) MustRegister(key K, value V) { - r.lock.Lock() - defer r.lock.Unlock() - if !r.Register(key, value) { panic("Unable to register item") } diff --git a/pkg/util/shutdown/shutdown.go b/pkg/util/shutdown/shutdown.go index d5b9d2ff2..855f02bc3 100644 --- a/pkg/util/shutdown/shutdown.go +++ b/pkg/util/shutdown/shutdown.go @@ -25,9 +25,6 @@ import ( "os" "os/signal" "syscall" - - pbImplShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1" - "github.com/arangodb/kube-arangodb/pkg/util/svc" ) func init() { @@ -43,10 +40,6 @@ func init() { }() } -func NewGlobalShutdownServer() svc.Handler { - return pbImplShutdownV1.New(stop) -} - var ( ctx context.Context stop context.CancelFunc diff --git a/pkg/util/svc/health.go b/pkg/util/svc/health.go index e135b9b54..50c7c175c 100644 --- a/pkg/util/svc/health.go +++ b/pkg/util/svc/health.go @@ -47,6 +47,8 @@ type Health interface { } type HealthService interface { + Handler + Service Health diff --git a/pkg/util/tests/network.go b/pkg/util/tests/network.go new file mode 100644 index 000000000..cfbf2b10e --- /dev/null +++ b/pkg/util/tests/network.go @@ -0,0 +1,67 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package tests + +import ( + "fmt" + "net" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func ResolveAddress(t *testing.T, addr string) (string, int) { + ln, err := net.Listen("tcp", addr) + require.NoError(t, err) + + pr, ok := ln.Addr().(*net.TCPAddr) + require.True(t, ok) + addr = pr.IP.String() + port := pr.Port + + require.NoError(t, ln.Close()) + return addr, port +} + +func WaitForAddress(t *testing.T, addr string, port int) { + tickerT := time.NewTicker(125 * time.Millisecond) + defer tickerT.Stop() + + timerT := time.NewTimer(1 * time.Second) + defer timerT.Stop() + + for { + select { + case <-timerT.C: + require.Fail(t, "Timeouted") + case <-tickerT.C: + conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", addr, port), 125*time.Millisecond) + if err != nil { + continue + } + + require.NoError(t, conn.Close()) + + return + } + } +} diff --git a/pkg/util/tests/tgrpc/grpc.go b/pkg/util/tests/tgrpc/grpc.go index dacb456a5..7145aa842 100644 --- a/pkg/util/tests/tgrpc/grpc.go +++ b/pkg/util/tests/tgrpc/grpc.go @@ -28,33 +28,22 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/codes" - "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/status" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) func NewGRPCClient[T any](t *testing.T, ctx context.Context, in func(cc grpc.ClientConnInterface) T, addr string, opts ...grpc.DialOption) T { - return in(NewGRPCConn(t, ctx, addr, opts...)) -} - -func NewGRPCConn(t *testing.T, ctx context.Context, addr string, opts ...grpc.DialOption) *grpc.ClientConn { - var z []grpc.DialOption - - z = append(z, grpc.WithTransportCredentials(insecure.NewCredentials())) - - z = append(z, opts...) - - conn, err := grpc.DialContext(ctx, addr, z...) + client, closer, err := util.NewGRPCClient(ctx, in, addr, opts...) require.NoError(t, err) - go func() { <-ctx.Done() - require.NoError(t, conn.Close()) + require.NoError(t, closer.Close()) }() - return conn + return client } type ErrorStatusValidator interface { From 91793bce16d0d0ec0b9f06765653e74eac42044f Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Tue, 27 Aug 2024 12:49:58 +0200 Subject: [PATCH 18/50] OAS-9996 Better panic handling (#1706) --- CHANGELOG.md | 1 + pkg/util/k8sutil/informer.go | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81b31c60a..50c394fb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - (Feature) Gateway config loader - (Feature) ConfigV1 Integration Service - (Feature) Integration Service Authentication +- (Improvement) Better panic handling ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/util/k8sutil/informer.go b/pkg/util/k8sutil/informer.go index d1bfb1281..d73291cf4 100644 --- a/pkg/util/k8sutil/informer.go +++ b/pkg/util/k8sutil/informer.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +21,8 @@ package k8sutil import ( + "runtime/debug" + "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/cache" @@ -29,7 +31,7 @@ import ( ) var ( - informerLogger = logging.Global().Get("kubernetes-informer") + informerLogger = logging.Global().RegisterAndGetLogger("kubernetes-informer", logging.Info) ) // ResourceWatcher is a helper to watch for events in a specific type @@ -52,7 +54,7 @@ func NewResourceWatcher(getter cache.Getter, resource, namespace string, AddFunc: func(obj interface{}) { defer func() { if err := recover(); err != nil { - informerLogger.Interface("error", err).Error("Recovered from panic") + informerLogger.Interface("error", err).Error("Recovered from panic. Stack trace:", string(debug.Stack())) } }() if h.AddFunc != nil { @@ -62,7 +64,7 @@ func NewResourceWatcher(getter cache.Getter, resource, namespace string, UpdateFunc: func(oldObj, newObj interface{}) { defer func() { if err := recover(); err != nil { - informerLogger.Interface("error", err).Error("Recovered from panic") + informerLogger.Interface("error", err).Error("Recovered from panic. Stack trace:", string(debug.Stack())) } }() if h.UpdateFunc != nil { @@ -72,7 +74,7 @@ func NewResourceWatcher(getter cache.Getter, resource, namespace string, DeleteFunc: func(obj interface{}) { defer func() { if err := recover(); err != nil { - informerLogger.Interface("error", err).Error("Recovered from panic") + informerLogger.Interface("error", err).Error("Recovered from panic. Stack trace:", string(debug.Stack())) } }() if h.DeleteFunc != nil { From 88c5df2078f1d6efb668179c17923edbbce402e9 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:48:59 +0200 Subject: [PATCH 19/50] [Feature] Integration PongV1 Service (#1709) --- .golangci.yaml | 4 + CHANGELOG.md | 1 + Makefile | 2 +- README.md | 2 +- cmd/cmd_ops.go | 8 +- cmd/integration/init.go | 60 ++++++ cmd/main-int/main_int.go | 33 +--- docs/api/ArangoDeployment.V1.md | 126 ++++++------ docs/cli.md | 6 + docs/cli/arangodb_operator.md | 122 ++++++++++++ docs/cli/arangodb_operator_integration.md | 101 ++++++++++ docs/cli/arangodb_operator_ops.md | 88 +++++++++ integrations/pong/v1/definition/consts.go | 25 +++ integrations/pong/v1/definition/pong.pb.go | 186 ++++++++++++++++++ integrations/pong/v1/definition/pong.proto | 43 ++++ .../pong/v1/definition/pong_grpc.pb.go | 106 ++++++++++ integrations/pong/v1/impl.go | 60 ++++++ integrations/pong/v1/service_test.go | 63 ++++++ internal/md/sections.go | 8 +- internal/readme.go | 36 +++- internal/readme_cli.go | 101 ++++++++++ internal/readme_test.go | 20 +- pkg/integrations/clients/pong_v1.go | 67 +++++++ pkg/integrations/pong_test.go | 62 ++++++ pkg/integrations/register.go | 15 +- 25 files changed, 1227 insertions(+), 118 deletions(-) create mode 100644 cmd/integration/init.go create mode 100644 docs/cli.md create mode 100644 docs/cli/arangodb_operator.md create mode 100644 docs/cli/arangodb_operator_integration.md create mode 100644 docs/cli/arangodb_operator_ops.md create mode 100644 integrations/pong/v1/definition/consts.go create mode 100644 integrations/pong/v1/definition/pong.pb.go create mode 100644 integrations/pong/v1/definition/pong.proto create mode 100644 integrations/pong/v1/definition/pong_grpc.pb.go create mode 100644 integrations/pong/v1/impl.go create mode 100644 integrations/pong/v1/service_test.go create mode 100644 internal/readme_cli.go create mode 100644 pkg/integrations/clients/pong_v1.go create mode 100644 pkg/integrations/pong_test.go diff --git a/.golangci.yaml b/.golangci.yaml index a95470b9b..5850830be 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -103,6 +103,10 @@ linters-settings: alias: pbConfigV1 - pkg: github.com/arangodb/kube-arangodb/integrations/config/v1 alias: pbImplConfigV1 + - pkg: github.com/arangodb/kube-arangodb/integrations/pong/v1/definition + alias: pbPongV1 + - pkg: github.com/arangodb/kube-arangodb/integrations/pong/v1 + alias: pbImplPongV1 - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1/definition alias: pbSharedV1 - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 50c394fb6..f684fd5d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - (Feature) ConfigV1 Integration Service - (Feature) Integration Service Authentication - (Improvement) Better panic handling +- (Feature) PongV1 Integration Service ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index b576c01ec..b09a3e097 100644 --- a/Makefile +++ b/Makefile @@ -917,6 +917,6 @@ sync-charts: sync: sync-charts ci-check: - @$(MAKE) tidy vendor update-generated synchronize-v2alpha1-with-v1 generate-internal sync fmt yamlfmt license + @$(MAKE) tidy vendor generate update-generated synchronize-v2alpha1-with-v1 sync fmt yamlfmt license @git checkout -- go.sum # ignore changes in go.sum @if [ ! -z "$(git status --porcelain)" ]; then echo "There are uncommited changes!"; git status; exit 1; fi \ No newline at end of file diff --git a/README.md b/README.md index f22305d20..863f667b5 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes diff --git a/cmd/cmd_ops.go b/cmd/cmd_ops.go index e0ffa4ca1..1654ef61e 100644 --- a/cmd/cmd_ops.go +++ b/cmd/cmd_ops.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,11 +29,15 @@ import ( var ( cmdOps = cobra.Command{ - Use: "arangodb_ops", + Use: "arangodb_operator_ops", Run: executeUsage, } ) +func CommandOps() *cobra.Command { + return &cmdOps +} + func ExecuteOps() int { flag.CommandLine.AddGoFlagSet(goflag.CommandLine) diff --git a/cmd/integration/init.go b/cmd/integration/init.go new file mode 100644 index 000000000..a5203b3cc --- /dev/null +++ b/cmd/integration/init.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integration + +import ( + goflag "flag" + + "github.com/spf13/cobra" + flag "github.com/spf13/pflag" + + "github.com/arangodb/kube-arangodb/pkg/integrations" +) + +var ( + cmd = cobra.Command{ + Use: "arangodb_operator_integration", + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Usage() + }, + } +) + +func init() { + if err := integrations.Register(&cmd); err != nil { + panic(err.Error()) + } + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) +} + +func Command() *cobra.Command { + return &cmd +} + +func Execute() int { + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) + + if err := cmd.Execute(); err != nil { + return 1 + } + + return 0 +} diff --git a/cmd/main-int/main_int.go b/cmd/main-int/main_int.go index 9dd27a376..78970bc96 100644 --- a/cmd/main-int/main_int.go +++ b/cmd/main-int/main_int.go @@ -21,40 +21,11 @@ package main import ( - goflag "flag" "os" - "github.com/spf13/cobra" - flag "github.com/spf13/pflag" - - "github.com/arangodb/kube-arangodb/pkg/integrations" -) - -var ( - cmd = cobra.Command{ - Use: "arangodb_int", - RunE: func(cmd *cobra.Command, args []string) error { - return cmd.Usage() - }, - } + "github.com/arangodb/kube-arangodb/cmd/integration" ) -func init() { - if err := integrations.Register(&cmd); err != nil { - panic(err.Error()) - } -} - -func Execute() int { - flag.CommandLine.AddGoFlagSet(goflag.CommandLine) - - if err := cmd.Execute(); err != nil { - return 1 - } - - return 0 -} - func main() { - os.Exit(Execute()) + os.Exit(integration.Execute()) } diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 8bbbf460d..06cb455a8 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3043,9 +3043,15 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. *** +### .spec.gateway.enabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L24) + +*** + ### .spec.gateways.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -3056,7 +3062,7 @@ Links: ### .spec.gateways.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -3067,7 +3073,7 @@ This setting changes the member recreation logic based on group: ### .spec.gateways.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -3076,7 +3082,7 @@ Annotations are merged with `spec.annotations`. ### .spec.gateways.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -3084,7 +3090,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.gateways.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -3092,7 +3098,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.gateways.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -3103,7 +3109,7 @@ Links: ### .spec.gateways.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -3113,7 +3119,7 @@ Default Value: `[]` ### .spec.gateways.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -3126,7 +3132,7 @@ as for the `dbservers` group. ### .spec.gateways.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -3168,7 +3174,7 @@ Links: ### .spec.gateways.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -3176,7 +3182,7 @@ ExporterPort define Port used by exporter ### .spec.gateways.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -3184,7 +3190,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.gateways.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -3192,7 +3198,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.gateways.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -3223,7 +3229,7 @@ Mode keep container replace mode ### .spec.gateways.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3231,7 +3237,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.gateways.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3239,7 +3245,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.gateways.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -3247,7 +3253,7 @@ Labels specified the labels added to Pods in this group. ### .spec.gateways.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -3255,7 +3261,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.gateways.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -3263,7 +3269,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.gateways.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -3271,7 +3277,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.gateways.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -3286,7 +3292,7 @@ Default Value: `0` ### .spec.gateways.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -3294,7 +3300,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.gateways.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -3305,7 +3311,7 @@ Links: ### .spec.gateways.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -3346,7 +3352,7 @@ Default Value: `/usr/bin/numactl` ### .spec.gateways.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -3363,7 +3369,7 @@ Default Value: `true` ### .spec.gateways.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -3392,7 +3398,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.gateways.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -3400,7 +3406,7 @@ Port define Port used by member ### .spec.gateways.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -3412,7 +3418,7 @@ Links: ### .spec.gateways.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -3422,7 +3428,7 @@ Default Value: `false` ### .spec.gateways.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3434,7 +3440,7 @@ Default Value: `3` ### .spec.gateways.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3445,7 +3451,7 @@ Default Value: `2` ### .spec.gateways.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3456,7 +3462,7 @@ Default Value: `10` ### .spec.gateways.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3467,7 +3473,7 @@ Default Value: `1` ### .spec.gateways.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3478,7 +3484,7 @@ Default Value: `2` ### .spec.gateways.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -3491,7 +3497,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.gateways.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -3499,7 +3505,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.gateways.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3511,7 +3517,7 @@ Default Value: `3` ### .spec.gateways.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3522,7 +3528,7 @@ Default Value: `2` ### .spec.gateways.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3533,7 +3539,7 @@ Default Value: `10` ### .spec.gateways.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3544,7 +3550,7 @@ Default Value: `1` ### .spec.gateways.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3555,7 +3561,7 @@ Default Value: `2` ### .spec.gateways.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -3563,7 +3569,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.gateways.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3575,7 +3581,7 @@ Default Value: `3` ### .spec.gateways.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3586,7 +3592,7 @@ Default Value: `2` ### .spec.gateways.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3597,7 +3603,7 @@ Default Value: `10` ### .spec.gateways.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3608,7 +3614,7 @@ Default Value: `1` ### .spec.gateways.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3619,7 +3625,7 @@ Default Value: `2` ### .spec.gateways.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -3631,7 +3637,7 @@ Possible Values: ### .spec.gateways.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -3642,7 +3648,7 @@ Links: ### .spec.gateways.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -3780,7 +3786,7 @@ sysctls: ### .spec.gateways.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -3795,7 +3801,7 @@ to that service account. ### .spec.gateways.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -3803,7 +3809,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.gateways.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -3811,7 +3817,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.gateways.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -3820,7 +3826,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.gateways.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -3831,7 +3837,7 @@ Links: ### .spec.gateways.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -3844,7 +3850,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.gateways.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -3852,7 +3858,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.gateways.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -3868,7 +3874,7 @@ Links: ### .spec.gateways.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -3881,7 +3887,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.gateways.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -3897,7 +3903,7 @@ Links: ### .spec.gateways.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 000000000..8b6a37cab --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,6 @@ +--- +layout: page +has_children: true +title: Binaries +has_toc: false +--- \ No newline at end of file diff --git a/docs/cli/arangodb_operator.md b/docs/cli/arangodb_operator.md new file mode 100644 index 000000000..e9629d728 --- /dev/null +++ b/docs/cli/arangodb_operator.md @@ -0,0 +1,122 @@ +--- +layout: page +parent: Binaries +title: arangodb_operator +--- + +# ArangoDB Operator Command + +[START_INJECT]: # (arangodb_operator_cmd) +``` +Usage: + arangodb_operator [flags] + arangodb_operator [command] + +Available Commands: + admin Administration operations + completion Generate the autocompletion script for the specified shell + crd CRD operations + debug-package Generate debug package for debugging + exporter + features Describe all operator features + help Help about any command + integration + storage + task + version + +Flags: + --action.PVCResize.concurrency int Define limit of concurrent PVC Resizes on the cluster (default 32) + --agency.refresh-delay duration The Agency refresh delay (0 = no delay) (default 500ms) + --agency.refresh-interval duration The Agency refresh interval (0 = do not refresh) + --agency.retries int The Agency retries (0 = no retries) (default 1) + --api.enabled Enable operator HTTP and gRPC API (default true) + --api.grpc-port int gRPC API port to listen on (default 8728) + --api.http-port int HTTP API port to listen on (default 8628) + --api.jwt-key-secret-name string Name of secret containing key used to sign JWT. If there is no such secret present, value will be saved here (default "arangodb-operator-api-jwt-key") + --api.jwt-secret-name string Name of secret which will contain JWT to authenticate API requests. (default "arangodb-operator-api-jwt") + --api.tls-secret-name string Name of secret containing tls.crt & tls.key for HTTPS API (if empty, self-signed certificate is used) + --backup-concurrent-uploads int Number of concurrent uploads per deployment (default 4) + --chaos.allowed Set to allow chaos in deployments. Only activated when allowed and enabled in deployment + --crd.install Install missing CRD if access is possible (default true) + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. To apply for all, use crd-name 'all'. + --crd.validation-schema stringArray Overrides default set of CRDs which should have validation schema enabled =. To apply for all, use crd-name 'all'. + --deployment.feature.agency-poll Enable Agency Poll for Enterprise deployments - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.all Enable ALL Features + --deployment.feature.async-backup-creation Create backups asynchronously to avoid blocking the operator and reaching the timeout - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.backup-cleanup Cleanup imported backups if required - Required ArangoDB 3.8.0 or higher + --deployment.feature.deployment-spec-defaults-restore Restore defaults from last accepted state of deployment - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.enforced-resign-leadership Enforce ResignLeadership and ensure that Leaders are moved from restarted DBServer - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.ephemeral-volumes Enables ephemeral volumes for apps and tmp directory - Required ArangoDB 3.8.0 or higher + --deployment.feature.failover-leadership Support for leadership in fail-over mode - Required ArangoDB 3.8.0 or higher + --deployment.feature.init-containers-copy-resources Copy resources spec to built-in init containers if they are not specified - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.init-containers-upscale-resources Copy resources spec to built-in init containers if they are not specified or lower - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.local-storage.pass-reclaim-policy [LocalStorage] Pass ReclaimPolicy from StorageClass instead of using hardcoded Retain - Required ArangoDB 3.8.0 or higher + --deployment.feature.local-volume-replacement-check Replace volume for local-storage if volume is unschedulable (ex. node is gone) - Required ArangoDB 3.8.0 or higher + --deployment.feature.random-pod-names Enables generating random pod names - Required ArangoDB 3.8.0 or higher + --deployment.feature.rebalancer-v2 Rebalancer V2 feature - Required ArangoDB 3.10.0 or higher + --deployment.feature.restart-policy-always Allow to restart containers with always restart policy - Required ArangoDB 3.8.0 or higher + --deployment.feature.secured-containers Create server's containers with non root privileges. It enables 'ephemeral-volumes' feature implicitly - Required ArangoDB 3.8.0 or higher + --deployment.feature.sensitive-information-protection Hide sensitive information from metrics and logs - Required ArangoDB 3.8.0 or higher + --deployment.feature.short-pod-names Enable Short Pod Names - Required ArangoDB 3.8.0 or higher + --deployment.feature.timezone-management Enable timezone management for pods - Required ArangoDB 3.8.0 or higher + --deployment.feature.tls-sni TLS SNI Support - Required ArangoDB EE 3.8.0 or higher (default true) + --deployment.feature.upgrade-version-check Enable initContainer with pre version check - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.upgrade-version-check-v2 Enable initContainer with pre version check based by Operator - Required ArangoDB 3.8.0 or higher + --features-config-map-name string Name of the Feature Map ConfigMap (default "arangodb-operator-feature-config-map") + -h, --help help for arangodb_operator + --http1.keep-alive If false, disables HTTP keep-alives and will only use the connection to the server for a single HTTP request (default true) + --http1.transport.dial-timeout duration Maximum amount of time a dial will wait for a connect to complete (default 30s) + --http1.transport.idle-conn-timeout duration Maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit (default 1m30s) + --http1.transport.idle-conn-timeout-short duration Maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit (default 100ms) + --http1.transport.keep-alive-timeout duration Interval between keep-alive probes for an active network connection (default 1m30s) + --http1.transport.keep-alive-timeout-short duration Interval between keep-alive probes for an active network connection (default 100ms) + --http1.transport.max-idle-conns int Maximum number of idle (keep-alive) connections across all hosts. Zero means no limit (default 100) + --http1.transport.tls-handshake-timeout duration Maximum amount of time to wait for a TLS handshake. Zero means no timeout (default 10s) + --image.discovery.status Discover Operator Image from Pod Status by default. When disabled Pod Spec is used. (default true) + --image.discovery.timeout duration Timeout for image discovery process (default 1m0s) + --internal.scaling-integration Enable Scaling Integration + --kubernetes.burst int Burst for the k8s API (default 30) + --kubernetes.max-batch-size int Size of batch during objects read (default 256) + --kubernetes.qps float32 Number of queries per second for k8s API (default 15) + --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.sampling If true, operator will try to minimize duplication of logging events (default true) + --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing + --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes + --mode.single Enable single mode in Operator. WARNING: There should be only one replica of Operator, otherwise Operator can take unexpected actions + --operator.analytics Enable to run the Analytics operator + --operator.apps Enable to run the ArangoApps operator + --operator.backup Enable to run the ArangoBackup operator + --operator.deployment Enable to run the ArangoDeployment operator + --operator.deployment-replication Enable to run the ArangoDeploymentReplication operator + --operator.ml Enable to run the ArangoML operator + --operator.networking Enable to run the Networking operator + --operator.reconciliation.retry.count int Count of retries during Object Update operations in the Reconciliation loop (default 25) + --operator.reconciliation.retry.delay duration Delay between Object Update operations in the Reconciliation loop (default 1s) + --operator.storage Enable to run the ArangoLocalStorage operator + --operator.version Enable only version endpoint in Operator + --reconciliation.delay duration Delay between reconciliation loops (<= 0 -> Disabled) + --scope string Define scope on which Operator works. Legacy - pre 1.1.0 scope with limited cluster access (default "legacy") + --server.admin-secret-name string Name of secret containing username + password for login to the dashboard (default "arangodb-operator-dashboard") + --server.allow-anonymous-access Allow anonymous access to the dashboard + --server.host string Host to listen on (default "0.0.0.0") + --server.port int Port to listen on (default 8528) + --server.tls-secret-name string Name of secret containing tls.crt & tls.key for HTTPS server (if empty, self-signed certificate is used) + --shutdown.delay duration The delay before running shutdown handlers (default 2s) + --shutdown.timeout duration Timeout for shutdown handlers (default 30s) + --timeout.agency duration The Agency read timeout (default 10s) + --timeout.arangod duration The request timeout to the ArangoDB (default 5s) + --timeout.arangod-check duration The version check request timeout to the ArangoDB (default 2s) + --timeout.backup-arangod duration The request timeout to the ArangoDB during backup calls (default 30s) + --timeout.backup-upload duration The request timeout to the ArangoDB during uploading files (default 5m0s) + --timeout.force-delete-pod-grace-period duration Default period when ArangoDB Pod should be forcefully removed after all containers were stopped - set to 0 to disable forceful removals (default 15m0s) + --timeout.k8s duration The request timeout to the kubernetes (default 2s) + --timeout.pod-scheduling-grace-period duration Default period when ArangoDB Pod should be deleted in case of scheduling info change - set to 0 to disable (default 15s) + --timeout.reconciliation duration The reconciliation timeout to the ArangoDB CR (default 1m0s) + --timeout.shard-rebuild duration Timeout after which particular out-synced shard is considered as failed and rebuild is triggered (default 1h0m0s) + --timeout.shard-rebuild-retry duration Timeout after which rebuild shards retry flow is triggered (default 4h0m0s) + +Use "arangodb_operator [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_cmd) diff --git a/docs/cli/arangodb_operator_integration.md b/docs/cli/arangodb_operator_integration.md new file mode 100644 index 000000000..d97513f28 --- /dev/null +++ b/docs/cli/arangodb_operator_integration.md @@ -0,0 +1,101 @@ +--- +layout: page +parent: Binaries +title: arangodb_operator_integration +--- + +# ArangoDB Operator Integration Command + +[START_INJECT]: # (arangodb_operator_integration_cmd) +``` +Usage: + arangodb_operator_integration [flags] + arangodb_operator_integration [command] + +Available Commands: + client + completion Generate the autocompletion script for the specified shell + help Help about any command + +Flags: + --health.address string Address to expose health service (default "0.0.0.0:9091") + --health.auth.token string Token for health service (when auth service is token) + --health.auth.type string Auth type for health service (default "None") + --health.shutdown.enabled Determines if shutdown service should be enabled and exposed (default true) + -h, --help help for arangodb_operator_integration + --integration.authentication.v1 Enable AuthenticationV1 Integration Service + --integration.authentication.v1.enabled Defines if Authentication is enabled (default true) + --integration.authentication.v1.external Defones if External access to service authentication.v1 is enabled + --integration.authentication.v1.internal Defones if Internal access to service authentication.v1 is enabled (default true) + --integration.authentication.v1.path string Path to the JWT Folder + --integration.authentication.v1.token.allowed strings Allowed users for the Token + --integration.authentication.v1.token.max-size uint16 Max Token max size in bytes (default 64) + --integration.authentication.v1.token.ttl.default duration Default Token TTL (default 1h0m0s) + --integration.authentication.v1.token.ttl.max duration Max Token TTL (default 1h0m0s) + --integration.authentication.v1.token.ttl.min duration Min Token TTL (default 1m0s) + --integration.authentication.v1.token.user string Default user of the Token (default "root") + --integration.authentication.v1.ttl duration TTL of the JWT cache (default 15s) + --integration.authorization.v0 Enable AuthorizationV0 Integration Service + --integration.authorization.v0.external Defones if External access to service authorization.v0 is enabled + --integration.authorization.v0.internal Defones if Internal access to service authorization.v0 is enabled (default true) + --integration.config.v1 Enable ConfigV1 Integration Service + --integration.config.v1.external Defones if External access to service config.v1 is enabled + --integration.config.v1.internal Defones if Internal access to service config.v1 is enabled (default true) + --integration.config.v1.module strings Module in the reference = + --integration.envoy.auth.v3 Enable EnvoyAuthV3 Integration Service + --integration.envoy.auth.v3.external Defones if External access to service envoy.auth.v3 is enabled + --integration.envoy.auth.v3.internal Defones if Internal access to service envoy.auth.v3 is enabled (default true) + --integration.scheduler.v1 SchedulerV1 Integration + --integration.scheduler.v1.external Defones if External access to service scheduler.v1 is enabled + --integration.scheduler.v1.internal Defones if Internal access to service scheduler.v1 is enabled (default true) + --integration.scheduler.v1.namespace string Kubernetes Namespace (default "default") + --integration.scheduler.v1.verify-access Verify the CRD Access (default true) + --integration.shutdown.v1 ShutdownV1 Handler + --integration.shutdown.v1.external Defones if External access to service shutdown.v1 is enabled + --integration.shutdown.v1.internal Defones if Internal access to service shutdown.v1 is enabled (default true) + --integration.storage.v1 StorageBucket Integration + --integration.storage.v1.external Defones if External access to service storage.v1 is enabled + --integration.storage.v1.internal Defones if Internal access to service storage.v1 is enabled (default true) + --integration.storage.v1.s3.access-key string Path to file containing S3 AccessKey + --integration.storage.v1.s3.allow-insecure If set to true, the Endpoint certificates won't be checked + --integration.storage.v1.s3.bucket string Bucket name + --integration.storage.v1.s3.ca-crt string Path to file containing CA certificate to validate endpoint connection + --integration.storage.v1.s3.ca-key string Path to file containing keyfile to validate endpoint connection + --integration.storage.v1.s3.disable-ssl If set to true, the SSL won't be used when connecting to Endpoint + --integration.storage.v1.s3.endpoint string Endpoint of S3 API implementation + --integration.storage.v1.s3.region string Region + --integration.storage.v1.s3.secret-key string Path to file containing S3 SecretKey + --integration.storage.v1.type string Type of the Storage Integration (default "s3") + --services.address string Address to expose internal services (default "127.0.0.1:9092") + --services.auth.token string Token for internal service (when auth service is token) + --services.auth.type string Auth type for internal service (default "None") + --services.enabled Defines if internal access is enabled (default true) + --services.external.address string Address to expose external services (default "0.0.0.0:9093") + --services.external.auth.token string Token for external service (when auth service is token) + --services.external.auth.type string Auth type for external service (default "None") + --services.external.enabled Defines if external access is enabled + +Use "arangodb_operator_integration [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_integration_cmd) + +# ArangoDB Operator Integration Client Subcommand + +[START_INJECT]: # (arangodb_operator_integration_cmd_client) +``` +Usage: + arangodb_operator_integration client [command] + +Available Commands: + health + pong + shutdown + +Flags: + --address string GRPC Service Address (default "127.0.0.1:8080") + -h, --help help for client + --token string GRPC Token + +Use "arangodb_operator_integration client [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_integration_cmd_client) diff --git a/docs/cli/arangodb_operator_ops.md b/docs/cli/arangodb_operator_ops.md new file mode 100644 index 000000000..95041fc8e --- /dev/null +++ b/docs/cli/arangodb_operator_ops.md @@ -0,0 +1,88 @@ +--- +layout: page +parent: Binaries +title: arangodb_operator_ops +--- + +# ArangoDB Operator Ops Command + +[START_INJECT]: # (arangodb_operator_ops_cmd) +``` +Usage: + arangodb_operator_ops [flags] + arangodb_operator_ops [command] + +Available Commands: + completion Generate the autocompletion script for the specified shell + crd CRD operations + help Help about any command + task + +Flags: + -h, --help help for arangodb_operator_ops + +Use "arangodb_operator_ops [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd) + +# ArangoDB Operator Ops CRD Subcommand + +[START_INJECT]: # (arangodb_operator_ops_cmd_crd) +``` +CRD operations + +Usage: + arangodb_operator_ops crd [flags] + arangodb_operator_ops crd [command] + +Available Commands: + generate Generates YAML of all required CRDs + install Install and update all required CRDs + +Flags: + --crd.force-update Enforce CRD Schema update + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. + --crd.validation-schema stringArray Controls which CRD should have validation schema =. + -h, --help help for crd + +Use "arangodb_operator_ops crd [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd_crd) + +# ArangoDB Operator Ops CRD Install Subcommand + +[START_INJECT]: # (arangodb_operator_ops_cmd_crd_install) +``` +Install and update all required CRDs + +Usage: + arangodb_operator_ops crd install [flags] + +Flags: + -h, --help help for install + +Global Flags: + --crd.force-update Enforce CRD Schema update + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. + --crd.validation-schema stringArray Controls which CRD should have validation schema =. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd_crd_install) + +# ArangoDB Operator Ops CRD Generate Subcommand + +[START_INJECT]: # (arangodb_operator_ops_cmd_crd_generate) +``` +Generates YAML of all required CRDs + +Usage: + arangodb_operator_ops crd generate [flags] + +Flags: + -h, --help help for generate + +Global Flags: + --crd.force-update Enforce CRD Schema update + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. + --crd.validation-schema stringArray Controls which CRD should have validation schema =. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd_crd_generate) diff --git a/integrations/pong/v1/definition/consts.go b/integrations/pong/v1/definition/consts.go new file mode 100644 index 000000000..6e6df329d --- /dev/null +++ b/integrations/pong/v1/definition/consts.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package definition + +const ( + Name = "pong.v1" +) diff --git a/integrations/pong/v1/definition/pong.pb.go b/integrations/pong/v1/definition/pong.pb.go new file mode 100644 index 000000000..2466d3c5a --- /dev/null +++ b/integrations/pong/v1/definition/pong.pb.go @@ -0,0 +1,186 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.21.1 +// source: integrations/pong/v1/definition/pong.proto + +package definition + +import ( + definition "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PongV1 Ping Call Response +type PongV1PingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Current time in UTC + Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` +} + +func (x *PongV1PingResponse) Reset() { + *x = PongV1PingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_pong_v1_definition_pong_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PongV1PingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PongV1PingResponse) ProtoMessage() {} + +func (x *PongV1PingResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_pong_v1_definition_pong_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PongV1PingResponse.ProtoReflect.Descriptor instead. +func (*PongV1PingResponse) Descriptor() ([]byte, []int) { + return file_integrations_pong_v1_definition_pong_proto_rawDescGZIP(), []int{0} +} + +func (x *PongV1PingResponse) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +var File_integrations_pong_v1_definition_pong_proto protoreflect.FileDescriptor + +var file_integrations_pong_v1_definition_pong_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, + 0x6f, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x70, 0x6f, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x70, 0x6f, + 0x6e, 0x67, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x44, 0x0a, 0x12, 0x50, 0x6f, 0x6e, 0x67, 0x56, 0x31, 0x50, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x32, 0x39, 0x0a, 0x06, 0x50, 0x6f, 0x6e, 0x67, + 0x56, 0x31, 0x12, 0x2f, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x70, 0x6f, 0x6e, 0x67, + 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x56, 0x31, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, + 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_integrations_pong_v1_definition_pong_proto_rawDescOnce sync.Once + file_integrations_pong_v1_definition_pong_proto_rawDescData = file_integrations_pong_v1_definition_pong_proto_rawDesc +) + +func file_integrations_pong_v1_definition_pong_proto_rawDescGZIP() []byte { + file_integrations_pong_v1_definition_pong_proto_rawDescOnce.Do(func() { + file_integrations_pong_v1_definition_pong_proto_rawDescData = protoimpl.X.CompressGZIP(file_integrations_pong_v1_definition_pong_proto_rawDescData) + }) + return file_integrations_pong_v1_definition_pong_proto_rawDescData +} + +var file_integrations_pong_v1_definition_pong_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_integrations_pong_v1_definition_pong_proto_goTypes = []interface{}{ + (*PongV1PingResponse)(nil), // 0: pong.PongV1PingResponse + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp + (*definition.Empty)(nil), // 2: shared.Empty +} +var file_integrations_pong_v1_definition_pong_proto_depIdxs = []int32{ + 1, // 0: pong.PongV1PingResponse.time:type_name -> google.protobuf.Timestamp + 2, // 1: pong.PongV1.Ping:input_type -> shared.Empty + 0, // 2: pong.PongV1.Ping:output_type -> pong.PongV1PingResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_integrations_pong_v1_definition_pong_proto_init() } +func file_integrations_pong_v1_definition_pong_proto_init() { + if File_integrations_pong_v1_definition_pong_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_integrations_pong_v1_definition_pong_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PongV1PingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_integrations_pong_v1_definition_pong_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_integrations_pong_v1_definition_pong_proto_goTypes, + DependencyIndexes: file_integrations_pong_v1_definition_pong_proto_depIdxs, + MessageInfos: file_integrations_pong_v1_definition_pong_proto_msgTypes, + }.Build() + File_integrations_pong_v1_definition_pong_proto = out.File + file_integrations_pong_v1_definition_pong_proto_rawDesc = nil + file_integrations_pong_v1_definition_pong_proto_goTypes = nil + file_integrations_pong_v1_definition_pong_proto_depIdxs = nil +} diff --git a/integrations/pong/v1/definition/pong.proto b/integrations/pong/v1/definition/pong.proto new file mode 100644 index 000000000..ecd4505f6 --- /dev/null +++ b/integrations/pong/v1/definition/pong.proto @@ -0,0 +1,43 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +syntax = "proto3"; + +package pong; + +import "google/protobuf/timestamp.proto"; + +import "integrations/shared/v1/definition/empty.proto"; + +option go_package = "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition"; + +// PongV1 Service implementation +service PongV1 { + rpc Ping(shared.Empty) returns (PongV1PingResponse); +} + +// Responses + + +// PongV1 Ping Call Response +message PongV1PingResponse { + // Current time in UTC + google.protobuf.Timestamp time = 1; +} \ No newline at end of file diff --git a/integrations/pong/v1/definition/pong_grpc.pb.go b/integrations/pong/v1/definition/pong_grpc.pb.go new file mode 100644 index 000000000..9e3a04386 --- /dev/null +++ b/integrations/pong/v1/definition/pong_grpc.pb.go @@ -0,0 +1,106 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.1 +// source: integrations/pong/v1/definition/pong.proto + +package definition + +import ( + context "context" + definition "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PongV1Client is the client API for PongV1 service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PongV1Client interface { + Ping(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*PongV1PingResponse, error) +} + +type pongV1Client struct { + cc grpc.ClientConnInterface +} + +func NewPongV1Client(cc grpc.ClientConnInterface) PongV1Client { + return &pongV1Client{cc} +} + +func (c *pongV1Client) Ping(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*PongV1PingResponse, error) { + out := new(PongV1PingResponse) + err := c.cc.Invoke(ctx, "/pong.PongV1/Ping", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PongV1Server is the server API for PongV1 service. +// All implementations must embed UnimplementedPongV1Server +// for forward compatibility +type PongV1Server interface { + Ping(context.Context, *definition.Empty) (*PongV1PingResponse, error) + mustEmbedUnimplementedPongV1Server() +} + +// UnimplementedPongV1Server must be embedded to have forward compatible implementations. +type UnimplementedPongV1Server struct { +} + +func (UnimplementedPongV1Server) Ping(context.Context, *definition.Empty) (*PongV1PingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (UnimplementedPongV1Server) mustEmbedUnimplementedPongV1Server() {} + +// UnsafePongV1Server may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PongV1Server will +// result in compilation errors. +type UnsafePongV1Server interface { + mustEmbedUnimplementedPongV1Server() +} + +func RegisterPongV1Server(s grpc.ServiceRegistrar, srv PongV1Server) { + s.RegisterService(&PongV1_ServiceDesc, srv) +} + +func _PongV1_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(definition.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PongV1Server).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pong.PongV1/Ping", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PongV1Server).Ping(ctx, req.(*definition.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// PongV1_ServiceDesc is the grpc.ServiceDesc for PongV1 service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PongV1_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pong.PongV1", + HandlerType: (*PongV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _PongV1_Ping_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "integrations/pong/v1/definition/pong.proto", +} diff --git a/integrations/pong/v1/impl.go b/integrations/pong/v1/impl.go new file mode 100644 index 000000000..e595574b6 --- /dev/null +++ b/integrations/pong/v1/impl.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "time" + + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/timestamppb" + + pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + pbShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/svc" +) + +func New() svc.Handler { + return &impl{} +} + +var _ pbPongV1.PongV1Server = &impl{} +var _ svc.Handler = &impl{} + +type impl struct { + pbPongV1.UnimplementedPongV1Server +} + +func (i *impl) Name() string { + return pbShutdownV1.Name +} + +func (i *impl) Health() svc.HealthState { + return svc.Healthy +} + +func (i *impl) Register(registrar *grpc.Server) { + pbPongV1.RegisterPongV1Server(registrar, i) +} +func (i *impl) Ping(context.Context, *pbSharedV1.Empty) (*pbPongV1.PongV1PingResponse, error) { + return &pbPongV1.PongV1PingResponse{Time: timestamppb.New(time.Now().UTC())}, nil +} diff --git a/integrations/pong/v1/service_test.go b/integrations/pong/v1/service_test.go new file mode 100644 index 000000000..d696b7675 --- /dev/null +++ b/integrations/pong/v1/service_test.go @@ -0,0 +1,63 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + + pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/svc" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Client(t *testing.T, ctx context.Context) pbPongV1.PongV1Client { + local := svc.NewService(svc.Configuration{ + Address: "127.0.0.1:0", + }, New()) + + start := local.Start(ctx) + + client := tgrpc.NewGRPCClient(t, ctx, pbPongV1.NewPongV1Client, start.Address()) + + return client +} + +func Test_Ping(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + client := Client(t, ctx) + + r1, err := client.Ping(ctx, &pbSharedV1.Empty{}) + require.NoError(t, err) + + time.Sleep(100 * time.Millisecond) + + r2, err := client.Ping(ctx, &pbSharedV1.Empty{}) + require.NoError(t, err) + + require.True(t, r2.GetTime().AsTime().After(r1.GetTime().AsTime())) +} diff --git a/internal/md/sections.go b/internal/md/sections.go index ad46ada8a..49d2d03f7 100644 --- a/internal/md/sections.go +++ b/internal/md/sections.go @@ -81,16 +81,10 @@ func ReplaceSection(in, replace, section string) (string, error) { return "", errors.Errorf("END_INJECT sections is missing for section %s. Note that newline is required at the end and before tag", section) } - if strings.HasSuffix(replace, "\n\n") { - // if section ends with empty line, we don't need to write newline for END marker - end = strings.TrimLeft(end, "\n") - } else { - end = "\n" + end - } + in = moveString(in, endID+len(end)) b.WriteString(end) - in = moveString(in, endID+len(end)) } return b.String(), nil diff --git a/internal/readme.go b/internal/readme.go index bd7747bd5..402e91426 100644 --- a/internal/readme.go +++ b/internal/readme.go @@ -144,23 +144,16 @@ func GenerateReadme(root string) error { return nil } -func GenerateHelp(cmd *cobra.Command) (string, error) { +func GenerateHelp(cmd *cobra.Command, args ...string) (string, error) { var lines []string lines = append(lines, "```", "Flags:") - buff := bytes.NewBuffer(nil) - - cmd.SetOut(buff) - - cmd.SetArgs([]string{"--help"}) - - if err := cmd.Execute(); err != nil { + help, err := GenerateHelpRaw(cmd, args...) + if err != nil { return "", err } - help := buff.String() - for _, line := range strings.Split(help, "\n") { if strings.HasPrefix(line, " --") { lines = append(lines, line) @@ -172,6 +165,29 @@ func GenerateHelp(cmd *cobra.Command) (string, error) { return md.WrapWithNewLines(md.WrapWithNewLines(strings.Join(lines, "\n"))), nil } +func GenerateHelpQuoted(cmd *cobra.Command, args ...string) (string, error) { + h, err := GenerateHelpRaw(cmd, args...) + if err != nil { + return "", err + } + + return fmt.Sprintf("```\n%s```\n", h), nil +} + +func GenerateHelpRaw(cmd *cobra.Command, args ...string) (string, error) { + buff := bytes.NewBuffer(nil) + + cmd.SetOut(buff) + + cmd.SetArgs(append(args, "--help")) + + if err := cmd.Execute(); err != nil { + return "", err + } + + return buff.String(), nil +} + func GenerateReadmeFeatures(root, basePath string, eeOnly bool) (string, error) { feature := md.NewColumn("Feature", md.ColumnLeftAlign) introduced := md.NewColumn("Introduced", md.ColumnLeftAlign) diff --git a/internal/readme_cli.go b/internal/readme_cli.go new file mode 100644 index 000000000..3e2e61c20 --- /dev/null +++ b/internal/readme_cli.go @@ -0,0 +1,101 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package internal + +import ( + "path" + + "github.com/arangodb/kube-arangodb/cmd" + "github.com/arangodb/kube-arangodb/cmd/integration" + "github.com/arangodb/kube-arangodb/internal/md" +) + +func GenerateCLIArangoDBOperatorReadme(root string) error { + readmeSections := map[string]string{} + + if section, err := GenerateHelpQuoted(cmd.Command()); err != nil { + return err + } else { + readmeSections["arangodb_operator_cmd"] = section + } + + if err := md.ReplaceSectionsInFile(path.Join(root, "docs", "cli", "arangodb_operator.md"), readmeSections); err != nil { + return err + } + + return nil +} + +func GenerateCLIArangoDBOperatorOpsReadme(root string) error { + readmeSections := map[string]string{} + + if section, err := GenerateHelpQuoted(cmd.CommandOps()); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd"] = section + } + + if section, err := GenerateHelpQuoted(cmd.CommandOps(), "crd"); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd_crd"] = section + } + + if section, err := GenerateHelpQuoted(cmd.CommandOps(), "crd", "install"); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd_crd_install"] = section + } + + if section, err := GenerateHelpQuoted(cmd.CommandOps(), "crd", "generate"); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd_crd_generate"] = section + } + + if err := md.ReplaceSectionsInFile(path.Join(root, "docs", "cli", "arangodb_operator_ops.md"), readmeSections); err != nil { + return err + } + + return nil +} + +func GenerateCLIArangoDBOperatorIntegrationReadme(root string) error { + readmeSections := map[string]string{} + + if section, err := GenerateHelpQuoted(integration.Command()); err != nil { + return err + } else { + readmeSections["arangodb_operator_integration_cmd"] = section + } + + if section, err := GenerateHelpQuoted(integration.Command(), "client"); err != nil { + return err + } else { + readmeSections["arangodb_operator_integration_cmd_client"] = section + } + + if err := md.ReplaceSectionsInFile(path.Join(root, "docs", "cli", "arangodb_operator_integration.md"), readmeSections); err != nil { + return err + } + + return nil +} diff --git a/internal/readme_test.go b/internal/readme_test.go index 76f958110..a2be90f9c 100644 --- a/internal/readme_test.go +++ b/internal/readme_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,3 +32,21 @@ func Test_GenerateReadme(t *testing.T) { require.NoError(t, GenerateReadme(root)) } + +func Test_GenerateCli_ArangoDBOperator(t *testing.T) { + root := os.Getenv("ROOT") + + require.NoError(t, GenerateCLIArangoDBOperatorReadme(root)) +} + +func Test_GenerateCli_ArangoDBOperatorOps(t *testing.T) { + root := os.Getenv("ROOT") + + require.NoError(t, GenerateCLIArangoDBOperatorOpsReadme(root)) +} + +func Test_GenerateCli_ArangoDBOperatorIntegration(t *testing.T) { + root := os.Getenv("ROOT") + + require.NoError(t, GenerateCLIArangoDBOperatorIntegrationReadme(root)) +} diff --git a/pkg/integrations/clients/pong_v1.go b/pkg/integrations/clients/pong_v1.go new file mode 100644 index 000000000..239c77a69 --- /dev/null +++ b/pkg/integrations/clients/pong_v1.go @@ -0,0 +1,67 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package clients + +import ( + "github.com/spf13/cobra" + + pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" +) + +func init() { + registerer.MustRegister("pong/v1", func(cfg *Config) Client { + return &pongV1{ + cfg: cfg, + } + }) +} + +type pongV1 struct { + cfg *Config +} + +func (s *pongV1) Name() string { + return "pong" +} + +func (s *pongV1) Version() string { + return "v1" +} + +func (s *pongV1) Register(cmd *cobra.Command) error { + cmd.RunE = func(cmd *cobra.Command, args []string) error { + client, c, err := client(shutdown.Context(), s.cfg, pbPongV1.NewPongV1Client) + if err != nil { + return err + } + defer c.Close() + + _, err = client.Ping(shutdown.Context(), &pbSharedV1.Empty{}) + if err != nil { + return err + } + + return nil + } + return nil +} diff --git a/pkg/integrations/pong_test.go b/pkg/integrations/pong_test.go new file mode 100644 index 000000000..772188467 --- /dev/null +++ b/pkg/integrations/pong_test.go @@ -0,0 +1,62 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" +) + +func Test_Pong(t *testing.T) { + c, health, internal, external := startService(t) + defer c.Require(t) + + t.Run("Pong", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--token=", + "client", + "pong", + "v1")) + }) + t.Run("internal", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--token=", + "client", + "pong", + "v1")) + }) + t.Run("external", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--token=", + "client", + "pong", + "v1")) + }) + }) +} diff --git a/pkg/integrations/register.go b/pkg/integrations/register.go index 6827ebcf9..5482126c4 100644 --- a/pkg/integrations/register.go +++ b/pkg/integrations/register.go @@ -30,6 +30,7 @@ import ( "github.com/spf13/cobra" "google.golang.org/grpc" + pbImplPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1" pbImplShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1" "github.com/arangodb/kube-arangodb/pkg/integrations/clients" "github.com/arangodb/kube-arangodb/pkg/util" @@ -170,7 +171,13 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance return errors.Wrapf(err, "Unable to parse external config") } - var internalHandlers, externalHandlers []svc.Handler + var internalHandlers, externalHandlers, healthHandlers []svc.Handler + + pong := pbImplPongV1.New() + + internalHandlers = append(internalHandlers, pong) + externalHandlers = append(externalHandlers, pong) + healthHandlers = append(healthHandlers, pong) for _, handler := range c.registered { if ok, err := cmd.Flags().GetBool(fmt.Sprintf("integration.%s", handler.Name())); err != nil { @@ -209,13 +216,11 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance } } - var healthServices []svc.Handler - if c.health.shutdownEnabled { - healthServices = append(healthServices, pbImplShutdownV1.New(cancel)) + healthHandlers = append(healthHandlers, pbImplShutdownV1.New(cancel)) } - health := svc.NewHealthService(healthConfig, svc.Readiness, healthServices...) + health := svc.NewHealthService(healthConfig, svc.Readiness, healthHandlers...) internalHandlers = append(internalHandlers, health) externalHandlers = append(externalHandlers, health) From 8264471502953b41fd96e355aa634a144fdf7ea0 Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Wed, 28 Aug 2024 11:26:04 +0200 Subject: [PATCH 20/50] OAS-10003 Gateway custom image (#1707) --- CHANGELOG.md | 1 + docs/api/ArangoDeployment.V1.md | 16 +++++++++++++++- docs/generated/actions.md | 1 - .../deployment/v1/deployment_spec_gateway.go | 16 ++++++++++++++++ .../deployment/v1/zz_generated.deepcopy.go | 5 +++++ .../v2alpha1/deployment_spec_gateway.go | 9 ++++++++- .../v2alpha1/zz_generated.deepcopy.go | 5 +++++ .../database-deployment.schema.generated.yaml | 18 ++++++++++++++++++ pkg/deployment/resources/pod_creator.go | 3 +++ 9 files changed, 71 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f684fd5d3..5f848f077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - (Feature) Integration Service Authentication - (Improvement) Better panic handling - (Feature) PongV1 Integration Service +- (Feature) Custom Gateway image ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 06cb455a8..4ce859c18 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3045,7 +3045,21 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. ### .spec.gateway.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L24) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L29) + +Enabled setting enables/disables support for gateway in the cluster. +When enabled, the cluster will contain a number of `gateway` servers. + +Default Value: `false` + +*** + +### .spec.gateway.image + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L33) + +Image is the image to use for the gateway. +By default, the image is determined by the operator. *** diff --git a/docs/generated/actions.md b/docs/generated/actions.md index fe0d2cd09..46fd22b02 100644 --- a/docs/generated/actions.md +++ b/docs/generated/actions.md @@ -195,5 +195,4 @@ spec: WaitForMemberUp: 30m0s ``` - [END_INJECT]: # (actionsModYaml) diff --git a/pkg/apis/deployment/v1/deployment_spec_gateway.go b/pkg/apis/deployment/v1/deployment_spec_gateway.go index ecb4f9389..95f8bb41d 100644 --- a/pkg/apis/deployment/v1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v1/deployment_spec_gateway.go @@ -20,10 +20,20 @@ package v1 +import "github.com/arangodb/kube-arangodb/pkg/util" + type DeploymentSpecGateway struct { + // Enabled setting enables/disables support for gateway in the cluster. + // When enabled, the cluster will contain a number of `gateway` servers. + // +doc/default: false Enabled *bool `json:"enabled,omitempty"` + + // Image is the image to use for the gateway. + // By default, the image is determined by the operator. + Image *string `json:"image"` } +// IsEnabled returns whether the gateway is enabled. func (d *DeploymentSpecGateway) IsEnabled() bool { if d == nil || d.Enabled == nil { return false @@ -32,6 +42,12 @@ func (d *DeploymentSpecGateway) IsEnabled() bool { return *d.Enabled } +// Validate the given spec func (d *DeploymentSpecGateway) Validate() error { return nil } + +// GetImage returns the image to use for the gateway. +func (d *DeploymentSpecGateway) GetImage() string { + return util.TypeOrDefault[string](d.Image) +} diff --git a/pkg/apis/deployment/v1/zz_generated.deepcopy.go b/pkg/apis/deployment/v1/zz_generated.deepcopy.go index 6b0d6bae1..bb26742cf 100644 --- a/pkg/apis/deployment/v1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1/zz_generated.deepcopy.go @@ -1179,6 +1179,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(bool) **out = **in } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(string) + **out = **in + } return } diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go index fba747bbf..48d4437ce 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go @@ -20,8 +20,11 @@ package v2alpha1 +import "github.com/arangodb/kube-arangodb/pkg/util" + type DeploymentSpecGateway struct { - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Image *string `json:"image"` } func (d *DeploymentSpecGateway) IsEnabled() bool { @@ -35,3 +38,7 @@ func (d *DeploymentSpecGateway) IsEnabled() bool { func (d *DeploymentSpecGateway) Validate() error { return nil } + +func (d *DeploymentSpecGateway) GetImage() string { + return util.TypeOrDefault[string](d.Image) +} diff --git a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go index 1e7d72901..bc6b39d1d 100644 --- a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go @@ -1179,6 +1179,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(bool) **out = **in } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(string) + **out = **in + } return } diff --git a/pkg/crd/crds/database-deployment.schema.generated.yaml b/pkg/crd/crds/database-deployment.schema.generated.yaml index 609150ca6..be717c42f 100644 --- a/pkg/crd/crds/database-deployment.schema.generated.yaml +++ b/pkg/crd/crds/database-deployment.schema.generated.yaml @@ -6568,7 +6568,15 @@ v1: description: Gateway defined main Gateway configuration. properties: enabled: + description: |- + Enabled setting enables/disables support for gateway in the cluster. + When enabled, the cluster will contain a number of `gateway` servers. type: boolean + image: + description: |- + Image is the image to use for the gateway. + By default, the image is determined by the operator. + type: string type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. @@ -22587,7 +22595,15 @@ v1alpha: description: Gateway defined main Gateway configuration. properties: enabled: + description: |- + Enabled setting enables/disables support for gateway in the cluster. + When enabled, the cluster will contain a number of `gateway` servers. type: boolean + image: + description: |- + Image is the image to use for the gateway. + By default, the image is determined by the operator. + type: string type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. @@ -38607,6 +38623,8 @@ v2alpha1: properties: enabled: type: boolean + image: + type: string type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index 36f0ecc27..a55157c5b 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -390,6 +390,9 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec } case api.ServerGroupTypeGateway: imageInfo.Image = r.context.GetOperatorImage() + if spec.Gateway.GetImage() != "" { + imageInfo.Image = spec.Gateway.GetImage() + } podCreator = &MemberGatewayPod{ podName: podName, From 2a62af3d238da99c400e2a12f2a60eeb1b261108 Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Wed, 28 Aug 2024 12:18:06 +0200 Subject: [PATCH 21/50] OAS-10007 Fix race condition in ArangoBackup (#1708) --- CHANGELOG.md | 1 + .../v2alpha1/deployment_spec_gateway.go | 13 ++++- pkg/handlers/backup/handler.go | 8 ++++ pkg/handlers/backup/handler_test.go | 47 +++++++++++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f848f077..1c7a3407d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - (Improvement) Better panic handling - (Feature) PongV1 Integration Service - (Feature) Custom Gateway image +- (Bugfix) Fix race condition in ArangoBackup ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go index 48d4437ce..5909fecf1 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go @@ -23,10 +23,17 @@ package v2alpha1 import "github.com/arangodb/kube-arangodb/pkg/util" type DeploymentSpecGateway struct { - Enabled *bool `json:"enabled,omitempty"` - Image *string `json:"image"` + // Enabled setting enables/disables support for gateway in the cluster. + // When enabled, the cluster will contain a number of `gateway` servers. + // +doc/default: false + Enabled *bool `json:"enabled,omitempty"` + + // Image is the image to use for the gateway. + // By default, the image is determined by the operator. + Image *string `json:"image"` } +// IsEnabled returns whether the gateway is enabled. func (d *DeploymentSpecGateway) IsEnabled() bool { if d == nil || d.Enabled == nil { return false @@ -35,10 +42,12 @@ func (d *DeploymentSpecGateway) IsEnabled() bool { return *d.Enabled } +// Validate the given spec func (d *DeploymentSpecGateway) Validate() error { return nil } +// GetImage returns the image to use for the gateway. func (d *DeploymentSpecGateway) GetImage() string { return util.TypeOrDefault[string](d.Image) } diff --git a/pkg/handlers/backup/handler.go b/pkg/handlers/backup/handler.go index 8ca1ba83a..1659167ec 100644 --- a/pkg/handlers/backup/handler.go +++ b/pkg/handlers/backup/handler.go @@ -123,6 +123,14 @@ func (h *handler) refreshDeployment(deployment *database.ArangoDeployment) error return err } + for _, backup := range backups.Items { + switch backup.GetStatus().ArangoBackupState.State { + case backupApi.ArangoBackupStateCreate, backupApi.ArangoBackupStateCreating: + // Skip refreshing backups if they are in creation state + return nil + } + } + existingBackups, err := client.List() if err != nil { return err diff --git a/pkg/handlers/backup/handler_test.go b/pkg/handlers/backup/handler_test.go index 509c9e426..c8ee85a93 100644 --- a/pkg/handlers/backup/handler_test.go +++ b/pkg/handlers/backup/handler_test.go @@ -129,4 +129,51 @@ func Test_Refresh_Cleanup(t *testing.T) { require.NoError(t, err) require.Len(t, backups.Items, 0) }) + + t.Run("Do not refresh if backup is creating", func(t *testing.T) { + // Arrange + fakeId := driver.BackupID(uuid.NewUUID()) + createBackup := backupApi.ArangoBackup{ + + ObjectMeta: meta.ObjectMeta{ + Name: "backup", + }, + Status: backupApi.ArangoBackupStatus{ + ArangoBackupState: backupApi.ArangoBackupState{ + State: backupApi.ArangoBackupStateCreating, + }, + Backup: &backupApi.ArangoBackupDetails{ + ID: string(fakeId), + }, + }, + } + b, err := handler.client.BackupV1().ArangoBackups(tests.FakeNamespace).Create(context.Background(), &createBackup, meta.CreateOptions{}) + require.NoError(t, err) + require.NotNil(t, b) + require.Equal(t, backupApi.ArangoBackupStateCreating, b.Status.State) + + t.Run("Refresh should not happen if there is Backup in creation state", func(t *testing.T) { + require.NoError(t, handler.refreshDeployment(arangoDeployment)) + + backups, err := handler.client.BackupV1().ArangoBackups(tests.FakeNamespace).List(context.Background(), meta.ListOptions{}) + require.NoError(t, err) + require.Len(t, backups.Items, 1) + require.NotNil(t, backups.Items[0].Status.Backup) + require.EqualValues(t, fakeId, backups.Items[0].Status.Backup.ID) + }) + + createBackup.Status.State = backupApi.ArangoBackupStateReady + b, err = handler.client.BackupV1().ArangoBackups(tests.FakeNamespace).UpdateStatus(context.Background(), &createBackup, meta.UpdateOptions{}) + require.NoError(t, err) + require.NotNil(t, b) + require.Equal(t, backupApi.ArangoBackupStateReady, b.Status.State) + + t.Run("Refresh should happen if there is Backup in ready state", func(t *testing.T) { + require.NoError(t, handler.refreshDeployment(arangoDeployment)) + + backups, err := handler.client.BackupV1().ArangoBackups(tests.FakeNamespace).List(context.Background(), meta.ListOptions{}) + require.NoError(t, err) + require.Len(t, backups.Items, 2) + }) + }) } From 1095567432aff42b1a903a1cdc1a8eccfb6157bf Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Sun, 1 Sep 2024 13:26:51 +0200 Subject: [PATCH 22/50] [Feature] Envoy Config Update (#1711) --- CHANGELOG.md | 1 + Makefile | 8 + .../templates/crd/cluster-role.yaml | 68 +- .../templates/crd/cluster-role.yaml | 68 +- .../templates/crd/cluster-role.yaml | 68 +- .../templates/crd/cluster-role.yaml | 68 +- docs/api/ArangoDeployment.V1.md | 196 +- docs/api/ArangoRoute.V1Alpha1.md | 34 +- examples/single-server-route.yaml | 28 + internal/docs_test.go | 8 + .../deployment/v1/deployment_spec_gateway.go | 24 +- pkg/apis/deployment/v1/server_group.go | 2 + .../deployment/v1/zz_generated.deepcopy.go | 6 + .../v2alpha1/deployment_spec_gateway.go | 24 +- pkg/apis/deployment/v2alpha1/server_group.go | 2 + .../v2alpha1/zz_generated.deepcopy.go | 6 + pkg/apis/networking/v1alpha1/route_spec.go | 14 +- .../v1alpha1/route_spec_destination.go | 30 +- .../networking/v1alpha1/route_spec_route.go | 4 +- pkg/apis/networking/v1alpha1/route_status.go | 4 +- .../v1alpha1/route_status_target.go | 41 +- .../route_status_target_destination.go | 47 + .../v1alpha1/route_status_target_tls.go | 12 +- .../v1alpha1/zz_generated.deepcopy.go | 71 +- .../v1alpha1/pod/resources/metadata.go | 6 +- .../v1alpha1/pod/resources/metadata_test.go | 43 + .../v1beta1/pod/resources/metadata.go | 6 +- .../v1beta1/pod/resources/metadata_test.go | 43 + pkg/apis/shared/validate.go | 15 +- .../database-deployment.schema.generated.yaml | 3800 ++++++++++++----- .../networking-route.schema.generated.yaml | 5 +- pkg/deployment/images.go | 9 +- pkg/deployment/member/state.go | 25 + pkg/deployment/pod/probes.go | 7 +- .../action_runtime_sync_tolerations.go | 3 +- .../resources/config_map_gateway.go | 182 + pkg/deployment/resources/config_maps.go | 54 - .../resources/gateway/gateway_config.go | 259 ++ .../gateway/gateway_config_destination.go | 122 + .../gateway_config_destination_target.go | 92 + .../gateway_config_destination_type.go | 80 + .../resources/gateway/gateway_config_test.go | 150 + .../resources/gateway/gateway_config_tls.go | 69 + pkg/deployment/resources/gateway_config.go | 268 -- pkg/deployment/resources/pod_creator.go | 49 +- .../resources/pod_creator_arangod.go | 9 +- .../resources/pod_creator_gateway.go | 305 +- .../pod_creator_gateway_container.go | 149 + .../resources/pod_creator_gateway_pod.go | 242 ++ pkg/deployment/resources/pod_creator_sync.go | 9 +- .../resources/pod_creator_tolerations.go | 68 + pkg/deployment/resources/pod_leader.go | 2 +- pkg/deployment/resources/secrets.go | 2 +- pkg/deployment/resources/services.go | 18 +- .../networking/route/handler_deployment.go | 2 +- .../route/handler_deployment_test.go | 6 +- .../networking/route/handler_destination.go | 52 +- .../route/handler_destination_test.go | 197 +- pkg/integrations/sidecar/core.go | 59 + .../sidecar/integration.authentication.v1.go | 85 + .../sidecar/integration.authorization.v1.go | 47 + .../sidecar/integration.envoy.v3.go | 57 + pkg/integrations/sidecar/integration.go | 211 + .../sidecar/integration.shutdown.v1.go | 47 + pkg/util/dict_test.go | 50 + pkg/util/k8sutil/interfaces/pod_creator.go | 9 +- pkg/util/k8sutil/pair.go | 13 +- pkg/util/k8sutil/patcher/config_map.go | 40 + pkg/util/k8sutil/patcher/config_map_test.go | 105 + pkg/util/k8sutil/patcher/patcher.go | 89 + pkg/util/k8sutil/patcher/service.go | 70 +- pkg/util/k8sutil/patcher/service_test.go | 8 +- pkg/util/k8sutil/pods.go | 4 +- pkg/util/k8sutil/services.go | 2 +- pkg/util/k8sutil/tolerations/tolerations.go | 40 - 75 files changed, 6034 insertions(+), 2084 deletions(-) create mode 100644 examples/single-server-route.yaml create mode 100644 pkg/apis/networking/v1alpha1/route_status_target_destination.go create mode 100644 pkg/deployment/resources/config_map_gateway.go create mode 100644 pkg/deployment/resources/gateway/gateway_config.go create mode 100644 pkg/deployment/resources/gateway/gateway_config_destination.go create mode 100644 pkg/deployment/resources/gateway/gateway_config_destination_target.go create mode 100644 pkg/deployment/resources/gateway/gateway_config_destination_type.go create mode 100644 pkg/deployment/resources/gateway/gateway_config_test.go create mode 100644 pkg/deployment/resources/gateway/gateway_config_tls.go delete mode 100644 pkg/deployment/resources/gateway_config.go create mode 100644 pkg/deployment/resources/pod_creator_gateway_container.go create mode 100644 pkg/deployment/resources/pod_creator_gateway_pod.go create mode 100644 pkg/deployment/resources/pod_creator_tolerations.go create mode 100644 pkg/integrations/sidecar/core.go create mode 100644 pkg/integrations/sidecar/integration.authentication.v1.go create mode 100644 pkg/integrations/sidecar/integration.authorization.v1.go create mode 100644 pkg/integrations/sidecar/integration.envoy.v3.go create mode 100644 pkg/integrations/sidecar/integration.go create mode 100644 pkg/integrations/sidecar/integration.shutdown.v1.go create mode 100644 pkg/util/dict_test.go create mode 100644 pkg/util/k8sutil/patcher/config_map.go create mode 100644 pkg/util/k8sutil/patcher/config_map_test.go create mode 100644 pkg/util/k8sutil/patcher/patcher.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c7a3407d..2369ea863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - (Feature) PongV1 Integration Service - (Feature) Custom Gateway image - (Bugfix) Fix race condition in ArangoBackup +- (Feature) Improve Gateway Config gen ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index b09a3e097..2cadcdadb 100644 --- a/Makefile +++ b/Makefile @@ -803,10 +803,12 @@ set-typed-api-version/%: "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ "$(ROOT)/pkg/operator/" \ + "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ "$(ROOT)/pkg/util/" \ "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ + "$(ROOT)/pkg/apis/networking/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/$*/v[A-Za-z0-9]\+#github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/$*/v$(API_VERSION)#g" @@ -817,10 +819,12 @@ set-api-version/%: "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ "$(ROOT)/pkg/operator/" \ + "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ "$(ROOT)/pkg/util/" \ "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ + "$(ROOT)/pkg/apis/networking/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#github.com/arangodb/kube-arangodb/pkg/apis/$*/v[A-Za-z0-9]\+#github.com/arangodb/kube-arangodb/pkg/apis/$*/v$(API_VERSION)#g" @@ -828,10 +832,12 @@ set-api-version/%: "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ "$(ROOT)/pkg/operator/" \ + "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ "$(ROOT)/pkg/util/" \ "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ + "$(ROOT)/pkg/apis/networking/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#DatabaseV[A-Za-z0-9]\+()\.#DatabaseV$(API_VERSION)().#g" @@ -839,10 +845,12 @@ set-api-version/%: "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ "$(ROOT)/pkg/operator/" \ + "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ "$(ROOT)/pkg/util/" \ "$(ROOT)/pkg/handlers" \ "$(ROOT)/pkg/apis/backup/" \ + "$(ROOT)/pkg/apis/networking/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#ReplicationV[A-Za-z0-9]\+()\.#ReplicationV$(API_VERSION)().#g" diff --git a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml index 894674ced..93ee7ad4d 100644 --- a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml @@ -13,19 +13,61 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" +# analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" +# apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" +# backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" +# database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" + - "arangomembers.database.arangodb.com" + - "arangotasks.database.arangodb.com" +# ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" +# networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" +# replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangodeploymentreplications.replication.database.arangodb.com" +# scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml index 894674ced..93ee7ad4d 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml @@ -13,19 +13,61 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" +# analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" +# apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" +# backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" +# database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" + - "arangomembers.database.arangodb.com" + - "arangotasks.database.arangodb.com" +# ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" +# networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" +# replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangodeploymentreplications.replication.database.arangodb.com" +# scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml index 894674ced..93ee7ad4d 100644 --- a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml @@ -13,19 +13,61 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" +# analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" +# apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" +# backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" +# database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" + - "arangomembers.database.arangodb.com" + - "arangotasks.database.arangodb.com" +# ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" +# networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" +# replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangodeploymentreplications.replication.database.arangodb.com" +# scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/chart/kube-arangodb/templates/crd/cluster-role.yaml b/chart/kube-arangodb/templates/crd/cluster-role.yaml index 894674ced..93ee7ad4d 100644 --- a/chart/kube-arangodb/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb/templates/crd/cluster-role.yaml @@ -13,19 +13,61 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" +# analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" +# apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" +# backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" +# database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" + - "arangomembers.database.arangodb.com" + - "arangotasks.database.arangodb.com" +# ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" +# networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" +# replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangodeploymentreplications.replication.database.arangodb.com" +# scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 4ce859c18..7c3763641 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3045,7 +3045,7 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. ### .spec.gateway.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L29) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L33) Enabled setting enables/disables support for gateway in the cluster. When enabled, the cluster will contain a number of `gateway` servers. @@ -3056,13 +3056,205 @@ Default Value: `false` ### .spec.gateway.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L33) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L37) Image is the image to use for the gateway. By default, the image is determined by the operator. *** +### .spec.gateway.sidecar.args + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) + +Arguments to the entrypoint. +The container image's CMD is used if this is not provided. +Variable references $(VAR_NAME) are expanded using the container's environment. If a variable +cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced +to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will +produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless +of whether the variable exists or not. Cannot be updated. + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) + +*** + +### .spec.gateway.sidecar.command + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) + +Entrypoint array. Not executed within a shell. +The container image's ENTRYPOINT is used if this is not provided. +Variable references $(VAR_NAME) are expanded using the container's environment. If a variable +cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced +to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will +produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless +of whether the variable exists or not. Cannot be updated. + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) + +*** + +### .spec.gateway.sidecar.controllerListenPort + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L36) + +ControllerListenPort defines on which port the sidecar container will be listening for controller requests + +Default Value: `9202` + +*** + +### .spec.gateway.sidecar.env + +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) + +Env keeps the information about environment variables provided to the container + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envvar-v1-core) + +*** + +### .spec.gateway.sidecar.envFrom + +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) + +EnvFrom keeps the information about environment variable sources provided to the container + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envfromsource-v1-core) + +*** + +### .spec.gateway.sidecar.image + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) + +Image define image details + +*** + +### .spec.gateway.sidecar.imagePullPolicy + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) + +ImagePullPolicy define Image pull policy + +Default Value: `IfNotPresent` + +*** + +### .spec.gateway.sidecar.lifecycle + +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) + +Lifecycle keeps actions that the management system should take in response to container lifecycle events. + +*** + +### .spec.gateway.sidecar.listenPort + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L32) + +ListenPort defines on which port the sidecar container will be listening for connections + +Default Value: `9201` + +*** + +### .spec.gateway.sidecar.livenessProbe + +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) + +LivenessProbe keeps configuration of periodic probe of container liveness. +Container will be restarted if the probe fails. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) + +*** + +### .spec.gateway.sidecar.ports + +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) + +Ports contains list of ports to expose from the container. Not specifying a port here +DOES NOT prevent that port from being exposed. Any port which is +listening on the default "0.0.0.0" address inside a container will be +accessible from the network. + +*** + +### .spec.gateway.sidecar.readinessProbe + +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) + +ReadinessProbe keeps configuration of periodic probe of container service readiness. +Container will be removed from service endpoints if the probe fails. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) + +*** + +### .spec.gateway.sidecar.resources + +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) + +Resources holds resource requests & limits for container + +Links: +* [Documentation of core.ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#resourcerequirements-v1-core) + +*** + +### .spec.gateway.sidecar.securityContext + +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) + +SecurityContext holds container-level security attributes and common container settings. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) + +*** + +### .spec.gateway.sidecar.startupProbe + +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) + +StartupProbe indicates that the Pod has successfully initialized. +If specified, no other probes are executed until this completes successfully. +If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. +This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, +when it might take a long time to load data or warm a cache, than during steady-state operation. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) + +*** + +### .spec.gateway.sidecar.volumeMounts + +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) + +VolumeMounts keeps list of pod volumes to mount into the container's filesystem. + +*** + +### .spec.gateway.sidecar.workingDir + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) + +Container's working directory. +If not specified, the container runtime's default will be used, which +might be configured in the container image. + +*** + ### .spec.gateways.affinity Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) diff --git a/docs/api/ArangoRoute.V1Alpha1.md b/docs/api/ArangoRoute.V1Alpha1.md index 63e46c1b4..e69bf4c81 100644 --- a/docs/api/ArangoRoute.V1Alpha1.md +++ b/docs/api/ArangoRoute.V1Alpha1.md @@ -12,7 +12,15 @@ title: ArangoRoute V1Alpha1 Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec.go#L27) -DeploymentName specifies the ArangoDeployment object name +Deployment specifies the ArangoDeployment object name + +*** + +### .spec.destination.path + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L36) + +Path defines service path used for overrides *** @@ -123,15 +131,29 @@ UID keeps the information about object UID *** -### .status.targets\[int\].tls.insecure +### .status.target.destinations\[int\].host -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_tls.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_destination.go#L38) -Insecure allows Insecure traffic +*** + +### .status.target.destinations\[int\].port + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_destination.go#L39) *** -### .status.targets\[int\].url +### .status.target.path + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L37) + +Path specifies request path override + +*** -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L34) +### .status.target.TLS.insecure + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_tls.go#L27) + +Insecure allows Insecure traffic diff --git a/examples/single-server-route.yaml b/examples/single-server-route.yaml new file mode 100644 index 000000000..abc6aa6c3 --- /dev/null +++ b/examples/single-server-route.yaml @@ -0,0 +1,28 @@ +apiVersion: "database.arangodb.com/v1" +kind: "ArangoDeployment" +metadata: + name: "example-simple-single" +spec: + mode: Single + image: 'arangodb/arangodb:3.12.2' + gateway: + enabled: true + gateways: + count: 1 +--- +apiVersion: "networking.arangodb.com/v1alpha1" +kind: "ArangoRoute" +metadata: + name: "example-simple-single-route" +spec: + deployment: example-simple-single + destination: + service: + name: example-simple-single + port: 8529 + schema: https + tls: + insecure: true + path: "/_api/" + route: + path: "/secondary/" diff --git a/internal/docs_test.go b/internal/docs_test.go index b1c8a2003..e6b86319d 100644 --- a/internal/docs_test.go +++ b/internal/docs_test.go @@ -175,6 +175,14 @@ func Test_GenerateAPIDocs(t *testing.T) { "Spec": deploymentApi.ArangoMember{}.Spec, }, }, + Shared: []string{ + "shared/v1", + "scheduler/v1beta1", + "scheduler/v1beta1/container", + "scheduler/v1beta1/container/resources", + "scheduler/v1beta1/pod", + "scheduler/v1beta1/pod/resources", + }, }, }, "apps": map[string]inputPackage{ diff --git a/pkg/apis/deployment/v1/deployment_spec_gateway.go b/pkg/apis/deployment/v1/deployment_spec_gateway.go index 95f8bb41d..c194f1880 100644 --- a/pkg/apis/deployment/v1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v1/deployment_spec_gateway.go @@ -20,7 +20,11 @@ package v1 -import "github.com/arangodb/kube-arangodb/pkg/util" +import ( + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util" +) type DeploymentSpecGateway struct { // Enabled setting enables/disables support for gateway in the cluster. @@ -31,6 +35,9 @@ type DeploymentSpecGateway struct { // Image is the image to use for the gateway. // By default, the image is determined by the operator. Image *string `json:"image"` + + // Sidecar define the integration sidecar spec + Sidecar *schedulerApi.IntegrationSidecar `json:"sidecar,omitempty"` } // IsEnabled returns whether the gateway is enabled. @@ -42,9 +49,22 @@ func (d *DeploymentSpecGateway) IsEnabled() bool { return *d.Enabled } +func (d *DeploymentSpecGateway) GetSidecar() *schedulerApi.IntegrationSidecar { + if d == nil || d.Sidecar == nil { + return nil + } + return d.Sidecar +} + // Validate the given spec func (d *DeploymentSpecGateway) Validate() error { - return nil + if d == nil { + d = &DeploymentSpecGateway{} + } + + return shared.WithErrors( + shared.PrefixResourceErrors("integrationSidecar", d.GetSidecar().Validate()), + ) } // GetImage returns the image to use for the gateway. diff --git a/pkg/apis/deployment/v1/server_group.go b/pkg/apis/deployment/v1/server_group.go index d3795422e..9396cf780 100644 --- a/pkg/apis/deployment/v1/server_group.go +++ b/pkg/apis/deployment/v1/server_group.go @@ -230,6 +230,8 @@ func (g ServerGroup) DefaultTerminationGracePeriod() time.Duration { return time.Hour case ServerGroupCoordinators: return time.Hour + case ServerGroupGateways: + return 15 * time.Minute default: return time.Second * 30 } diff --git a/pkg/apis/deployment/v1/zz_generated.deepcopy.go b/pkg/apis/deployment/v1/zz_generated.deepcopy.go index bb26742cf..5993516d7 100644 --- a/pkg/apis/deployment/v1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1/zz_generated.deepcopy.go @@ -28,6 +28,7 @@ package v1 import ( time "time" + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -1184,6 +1185,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(string) **out = **in } + if in.Sidecar != nil { + in, out := &in.Sidecar, &out.Sidecar + *out = new(v1beta1.IntegrationSidecar) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go index 5909fecf1..166916462 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go @@ -20,7 +20,11 @@ package v2alpha1 -import "github.com/arangodb/kube-arangodb/pkg/util" +import ( + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util" +) type DeploymentSpecGateway struct { // Enabled setting enables/disables support for gateway in the cluster. @@ -31,6 +35,9 @@ type DeploymentSpecGateway struct { // Image is the image to use for the gateway. // By default, the image is determined by the operator. Image *string `json:"image"` + + // Sidecar define the integration sidecar spec + Sidecar *schedulerApi.IntegrationSidecar `json:"sidecar,omitempty"` } // IsEnabled returns whether the gateway is enabled. @@ -42,9 +49,22 @@ func (d *DeploymentSpecGateway) IsEnabled() bool { return *d.Enabled } +func (d *DeploymentSpecGateway) GetSidecar() *schedulerApi.IntegrationSidecar { + if d == nil || d.Sidecar == nil { + return nil + } + return d.Sidecar +} + // Validate the given spec func (d *DeploymentSpecGateway) Validate() error { - return nil + if d == nil { + d = &DeploymentSpecGateway{} + } + + return shared.WithErrors( + shared.PrefixResourceErrors("integrationSidecar", d.GetSidecar().Validate()), + ) } // GetImage returns the image to use for the gateway. diff --git a/pkg/apis/deployment/v2alpha1/server_group.go b/pkg/apis/deployment/v2alpha1/server_group.go index 1de521e7e..2051ec370 100644 --- a/pkg/apis/deployment/v2alpha1/server_group.go +++ b/pkg/apis/deployment/v2alpha1/server_group.go @@ -230,6 +230,8 @@ func (g ServerGroup) DefaultTerminationGracePeriod() time.Duration { return time.Hour case ServerGroupCoordinators: return time.Hour + case ServerGroupGateways: + return 15 * time.Minute default: return time.Second * 30 } diff --git a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go index bc6b39d1d..f0ed3e2e3 100644 --- a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go @@ -28,6 +28,7 @@ package v2alpha1 import ( time "time" + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -1184,6 +1185,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(string) **out = **in } + if in.Sidecar != nil { + in, out := &in.Sidecar, &out.Sidecar + *out = new(v1beta1.IntegrationSidecar) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/apis/networking/v1alpha1/route_spec.go b/pkg/apis/networking/v1alpha1/route_spec.go index a51f5eba2..6f4fc16e5 100644 --- a/pkg/apis/networking/v1alpha1/route_spec.go +++ b/pkg/apis/networking/v1alpha1/route_spec.go @@ -23,8 +23,8 @@ package v1alpha1 import shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" type ArangoRouteSpec struct { - // DeploymentName specifies the ArangoDeployment object name - DeploymentName *string `json:"deployment,omitempty"` + // Deployment specifies the ArangoDeployment object name + Deployment *string `json:"deployment,omitempty"` // Destination defines the route destination Destination *ArangoRouteSpecDestination `json:"destination,omitempty"` @@ -33,6 +33,14 @@ type ArangoRouteSpec struct { Route *ArangoRouteSpecRoute `json:"route,omitempty"` } +func (s *ArangoRouteSpec) GetDeployment() string { + if s == nil || s.Destination == nil { + return "" + } + + return *s.Deployment +} + func (s *ArangoRouteSpec) GetDestination() *ArangoRouteSpecDestination { if s == nil || s.Destination == nil { return nil @@ -54,7 +62,7 @@ func (s *ArangoRouteSpec) Validate() error { } if err := shared.WithErrors(shared.PrefixResourceErrors("spec", - shared.PrefixResourceErrors("deployment", shared.ValidateResourceNamePointer(s.DeploymentName)), + shared.PrefixResourceErrors("deployment", shared.ValidateResourceNamePointer(s.Deployment)), shared.ValidateRequiredInterfacePath("destination", s.Destination), shared.ValidateOptionalInterfacePath("route", s.Route), )); err != nil { diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination.go b/pkg/apis/networking/v1alpha1/route_spec_destination.go index c8dbb6a74..ff1c58018 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination.go @@ -31,30 +31,41 @@ type ArangoRouteSpecDestination struct { // TLS defines TLS Configuration TLS *ArangoRouteSpecDestinationTLS `json:"tls,omitempty"` + + // Path defines service path used for overrides + Path *string `json:"path,omitempty"` } -func (s *ArangoRouteSpecDestination) GetService() *ArangoRouteSpecDestinationService { - if s == nil || s.Service == nil { +func (a *ArangoRouteSpecDestination) GetService() *ArangoRouteSpecDestinationService { + if a == nil || a.Service == nil { return nil } - return s.Service + return a.Service } -func (s *ArangoRouteSpecDestination) GetSchema() *ArangoRouteSpecDestinationSchema { - if s == nil || s.Schema == nil { +func (a *ArangoRouteSpecDestination) GetSchema() *ArangoRouteSpecDestinationSchema { + if a == nil || a.Schema == nil { return nil } - return s.Schema + return a.Schema +} + +func (a *ArangoRouteSpecDestination) GetPath() string { + if a == nil || a.Path == nil { + return "/" + } + + return *a.Path } -func (s *ArangoRouteSpecDestination) GetTLS() *ArangoRouteSpecDestinationTLS { - if s == nil || s.TLS == nil { +func (a *ArangoRouteSpecDestination) GetTLS() *ArangoRouteSpecDestinationTLS { + if a == nil || a.TLS == nil { return nil } - return s.TLS + return a.TLS } func (a *ArangoRouteSpecDestination) Validate() error { @@ -66,6 +77,7 @@ func (a *ArangoRouteSpecDestination) Validate() error { shared.ValidateOptionalInterfacePath("service", a.Service), shared.ValidateOptionalInterfacePath("schema", a.Schema), shared.ValidateOptionalInterfacePath("tls", a.TLS), + shared.PrefixResourceError("path", shared.ValidateAPIPath(a.GetPath())), ); err != nil { return err } diff --git a/pkg/apis/networking/v1alpha1/route_spec_route.go b/pkg/apis/networking/v1alpha1/route_spec_route.go index 9537b6abd..48563a511 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_route.go +++ b/pkg/apis/networking/v1alpha1/route_spec_route.go @@ -31,7 +31,7 @@ type ArangoRouteSpecRoute struct { func (a *ArangoRouteSpecRoute) GetPath() string { if a == nil || a.Path == nil { - return "/" + return "" } return *a.Path @@ -43,7 +43,7 @@ func (a *ArangoRouteSpecRoute) Validate() error { } if err := shared.WithErrors( - shared.PrefixResourceError("path", shared.ValidateAPIPath(a.GetPath())), + shared.ValidateRequiredPath("path", a.Path, shared.ValidateAPIPath), ); err != nil { return err } diff --git a/pkg/apis/networking/v1alpha1/route_status.go b/pkg/apis/networking/v1alpha1/route_status.go index 8829c5e11..5fd3108b1 100644 --- a/pkg/apis/networking/v1alpha1/route_status.go +++ b/pkg/apis/networking/v1alpha1/route_status.go @@ -33,6 +33,6 @@ type ArangoRouteStatus struct { // Deployment keeps the ArangoDeployment reference Deployment *sharedApi.Object `json:"deployment,omitempty"` - // Targets keeps the target details - Targets ArangoRouteStatusTargets `json:"targets,omitempty"` + // Target keeps the target details + Target *ArangoRouteStatusTarget `json:"target,omitempty"` } diff --git a/pkg/apis/networking/v1alpha1/route_status_target.go b/pkg/apis/networking/v1alpha1/route_status_target.go index bd4b9152a..89f1b7a0d 100644 --- a/pkg/apis/networking/v1alpha1/route_status_target.go +++ b/pkg/apis/networking/v1alpha1/route_status_target.go @@ -20,25 +20,46 @@ package v1alpha1 -import "github.com/arangodb/kube-arangodb/pkg/util" +import ( + "fmt" -type ArangoRouteStatusTargets []ArangoRouteStatusTarget + "github.com/arangodb/kube-arangodb/pkg/util" +) -func (a ArangoRouteStatusTargets) Hash() string { - return util.SHA256FromExtract(func(t ArangoRouteStatusTarget) string { - return t.Hash() - }, a...) +type ArangoRouteStatusTarget struct { + // Destinations keeps target destinations + Destinations ArangoRouteStatusTargetDestinations `json:"destinations,omitempty"` + + // TLS Keeps target TLS Settings (if not nil, TLS is enabled) + TLS *ArangoRouteStatusTargetTLS `json:"TLS,omitempty"` + + // Path specifies request path override + Path string `json:"path,omitempty"` } -type ArangoRouteStatusTarget struct { - Url string `json:"url,omitempty"` +func (a *ArangoRouteStatusTarget) RenderURLs() []string { + if a == nil { + return nil + } + + var urls = make([]string, len(a.Destinations)) + + proto := "http" + + if a.TLS != nil { + proto = "https" + } + + for id, dest := range a.Destinations { + urls[id] = fmt.Sprintf("%s://%s:%d%s", proto, dest.Host, dest.Port, a.Path) + } - TLS ArangoRouteStatusTargetTLS `json:"tls,omitempty"` + return urls } func (a *ArangoRouteStatusTarget) Hash() string { if a == nil { return "" } - return util.SHA256FromStringArray(a.Url, a.TLS.Hash()) + return util.SHA256FromStringArray(a.Destinations.Hash(), a.TLS.Hash(), a.Path) } diff --git a/pkg/apis/networking/v1alpha1/route_status_target_destination.go b/pkg/apis/networking/v1alpha1/route_status_target_destination.go new file mode 100644 index 000000000..2fd61456d --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_status_target_destination.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + "fmt" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +type ArangoRouteStatusTargetDestinations []ArangoRouteStatusTargetDestination + +func (a ArangoRouteStatusTargetDestinations) Hash() string { + return util.SHA256FromExtract(func(t ArangoRouteStatusTargetDestination) string { + return t.Hash() + }, a...) +} + +type ArangoRouteStatusTargetDestination struct { + Host string `json:"host,omitempty"` + Port int32 `json:"port,omitempty"` +} + +func (a *ArangoRouteStatusTargetDestination) Hash() string { + if a == nil { + return "" + } + return util.SHA256FromStringArray(fmt.Sprintf("%s:%d", a.Host, a.Port)) +} diff --git a/pkg/apis/networking/v1alpha1/route_status_target_tls.go b/pkg/apis/networking/v1alpha1/route_status_target_tls.go index c813655c1..b230c7b26 100644 --- a/pkg/apis/networking/v1alpha1/route_status_target_tls.go +++ b/pkg/apis/networking/v1alpha1/route_status_target_tls.go @@ -24,7 +24,7 @@ import "github.com/arangodb/kube-arangodb/pkg/util" type ArangoRouteStatusTargetTLS struct { // Insecure allows Insecure traffic - Insecure bool `json:"insecure"` + Insecure *bool `json:"insecure"` } func (a *ArangoRouteStatusTargetTLS) Hash() string { @@ -32,5 +32,13 @@ func (a *ArangoRouteStatusTargetTLS) Hash() string { return "" } - return util.SHA256FromStringArray(util.BoolSwitch(a.Insecure, "true", "false")) + return util.SHA256FromStringArray(util.BoolSwitch(a.IsInsecure(), "true", "false")) +} + +func (a *ArangoRouteStatusTargetTLS) IsInsecure() bool { + if a == nil || a.Insecure == nil { + return false + } + + return *a.Insecure } diff --git a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go index 1dfa0daa4..ba179a20b 100644 --- a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go @@ -26,7 +26,7 @@ package v1alpha1 import ( - deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" runtime "k8s.io/apimachinery/pkg/runtime" intstr "k8s.io/apimachinery/pkg/util/intstr" @@ -96,8 +96,8 @@ func (in *ArangoRouteList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArangoRouteSpec) DeepCopyInto(out *ArangoRouteSpec) { *out = *in - if in.DeploymentName != nil { - in, out := &in.DeploymentName, &out.DeploymentName + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment *out = new(string) **out = **in } @@ -142,6 +142,11 @@ func (in *ArangoRouteSpecDestination) DeepCopyInto(out *ArangoRouteSpecDestinati *out = new(ArangoRouteSpecDestinationTLS) (*in).DeepCopyInto(*out) } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } return } @@ -228,7 +233,7 @@ func (in *ArangoRouteStatus) DeepCopyInto(out *ArangoRouteStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(deploymentv1.ConditionList, len(*in)) + *out = make(v2alpha1.ConditionList, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -238,10 +243,10 @@ func (in *ArangoRouteStatus) DeepCopyInto(out *ArangoRouteStatus) { *out = new(v1.Object) (*in).DeepCopyInto(*out) } - if in.Targets != nil { - in, out := &in.Targets, &out.Targets - *out = make(ArangoRouteStatusTargets, len(*in)) - copy(*out, *in) + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(ArangoRouteStatusTarget) + (*in).DeepCopyInto(*out) } return } @@ -259,7 +264,16 @@ func (in *ArangoRouteStatus) DeepCopy() *ArangoRouteStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArangoRouteStatusTarget) DeepCopyInto(out *ArangoRouteStatusTarget) { *out = *in - out.TLS = in.TLS + if in.Destinations != nil { + in, out := &in.Destinations, &out.Destinations + *out = make(ArangoRouteStatusTargetDestinations, len(*in)) + copy(*out, *in) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(ArangoRouteStatusTargetTLS) + (*in).DeepCopyInto(*out) + } return } @@ -274,37 +288,58 @@ func (in *ArangoRouteStatusTarget) DeepCopy() *ArangoRouteStatusTarget { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ArangoRouteStatusTargetTLS) DeepCopyInto(out *ArangoRouteStatusTargetTLS) { +func (in *ArangoRouteStatusTargetDestination) DeepCopyInto(out *ArangoRouteStatusTargetDestination) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargetTLS. -func (in *ArangoRouteStatusTargetTLS) DeepCopy() *ArangoRouteStatusTargetTLS { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargetDestination. +func (in *ArangoRouteStatusTargetDestination) DeepCopy() *ArangoRouteStatusTargetDestination { if in == nil { return nil } - out := new(ArangoRouteStatusTargetTLS) + out := new(ArangoRouteStatusTargetDestination) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in ArangoRouteStatusTargets) DeepCopyInto(out *ArangoRouteStatusTargets) { +func (in ArangoRouteStatusTargetDestinations) DeepCopyInto(out *ArangoRouteStatusTargetDestinations) { { in := &in - *out = make(ArangoRouteStatusTargets, len(*in)) + *out = make(ArangoRouteStatusTargetDestinations, len(*in)) copy(*out, *in) return } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargets. -func (in ArangoRouteStatusTargets) DeepCopy() ArangoRouteStatusTargets { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargetDestinations. +func (in ArangoRouteStatusTargetDestinations) DeepCopy() ArangoRouteStatusTargetDestinations { if in == nil { return nil } - out := new(ArangoRouteStatusTargets) + out := new(ArangoRouteStatusTargetDestinations) in.DeepCopyInto(out) return *out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteStatusTargetTLS) DeepCopyInto(out *ArangoRouteStatusTargetTLS) { + *out = *in + if in.Insecure != nil { + in, out := &in.Insecure, &out.Insecure + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargetTLS. +func (in *ArangoRouteStatusTargetTLS) DeepCopy() *ArangoRouteStatusTargetTLS { + if in == nil { + return nil + } + out := new(ArangoRouteStatusTargetTLS) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go b/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go index bb557305d..805402426 100644 --- a/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go +++ b/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go @@ -59,9 +59,9 @@ func (m *Metadata) Apply(template *core.PodTemplateSpec) error { z := m.DeepCopy() - template.Labels = z.Labels - template.Annotations = z.Annotations - template.OwnerReferences = z.OwnerReferences + template.Labels = util.MergeMaps(true, template.Labels, z.Labels) + template.Annotations = util.MergeMaps(true, template.Annotations, z.Annotations) + template.OwnerReferences = append(template.OwnerReferences, z.OwnerReferences...) return nil } diff --git a/pkg/apis/scheduler/v1alpha1/pod/resources/metadata_test.go b/pkg/apis/scheduler/v1alpha1/pod/resources/metadata_test.go index ad4558078..0c23b7464 100644 --- a/pkg/apis/scheduler/v1alpha1/pod/resources/metadata_test.go +++ b/pkg/apis/scheduler/v1alpha1/pod/resources/metadata_test.go @@ -131,6 +131,49 @@ func Test_Metadata(t *testing.T) { require.Contains(t, pod.Annotations, "B2") require.EqualValues(t, "4", pod.Annotations["B2"]) + require.Len(t, pod.OwnerReferences, 2) + require.EqualValues(t, "test", pod.OwnerReferences[0].UID) + require.EqualValues(t, "test2", pod.OwnerReferences[1].UID) + }) + }) + t.Run("Update Templat", func(t *testing.T) { + applyMetadata(t, &core.PodTemplateSpec{ + ObjectMeta: meta.ObjectMeta{ + Labels: map[string]string{ + "A": "1", + }, + Annotations: map[string]string{ + "B": "2", + }, + OwnerReferences: []meta.OwnerReference{ + { + UID: "test", + }, + }, + }, + }, &Metadata{ + Labels: map[string]string{ + "A": "3", + }, + Annotations: map[string]string{ + "B2": "4", + }, + OwnerReferences: []meta.OwnerReference{ + { + UID: "test2", + }, + }, + })(func(t *testing.T, pod *core.PodTemplateSpec) { + require.Len(t, pod.Labels, 1) + require.Contains(t, pod.Labels, "A") + require.EqualValues(t, "3", pod.Labels["A"]) + + require.Len(t, pod.Annotations, 2) + require.Contains(t, pod.Annotations, "B") + require.EqualValues(t, "2", pod.Annotations["B"]) + require.Contains(t, pod.Annotations, "B2") + require.EqualValues(t, "4", pod.Annotations["B2"]) + require.Len(t, pod.OwnerReferences, 2) require.EqualValues(t, "test", pod.OwnerReferences[0].UID) require.EqualValues(t, "test2", pod.OwnerReferences[1].UID) diff --git a/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go b/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go index 674fb8278..1f2f6f4c8 100644 --- a/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go +++ b/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go @@ -59,9 +59,9 @@ func (m *Metadata) Apply(template *core.PodTemplateSpec) error { z := m.DeepCopy() - template.Labels = z.Labels - template.Annotations = z.Annotations - template.OwnerReferences = z.OwnerReferences + template.Labels = util.MergeMaps(true, template.Labels, z.Labels) + template.Annotations = util.MergeMaps(true, template.Annotations, z.Annotations) + template.OwnerReferences = append(template.OwnerReferences, z.OwnerReferences...) return nil } diff --git a/pkg/apis/scheduler/v1beta1/pod/resources/metadata_test.go b/pkg/apis/scheduler/v1beta1/pod/resources/metadata_test.go index ad4558078..42d9428d7 100644 --- a/pkg/apis/scheduler/v1beta1/pod/resources/metadata_test.go +++ b/pkg/apis/scheduler/v1beta1/pod/resources/metadata_test.go @@ -131,6 +131,49 @@ func Test_Metadata(t *testing.T) { require.Contains(t, pod.Annotations, "B2") require.EqualValues(t, "4", pod.Annotations["B2"]) + require.Len(t, pod.OwnerReferences, 2) + require.EqualValues(t, "test", pod.OwnerReferences[0].UID) + require.EqualValues(t, "test2", pod.OwnerReferences[1].UID) + }) + }) + t.Run("Update Template", func(t *testing.T) { + applyMetadata(t, &core.PodTemplateSpec{ + ObjectMeta: meta.ObjectMeta{ + Labels: map[string]string{ + "A": "1", + }, + Annotations: map[string]string{ + "B": "2", + }, + OwnerReferences: []meta.OwnerReference{ + { + UID: "test", + }, + }, + }, + }, &Metadata{ + Labels: map[string]string{ + "A": "3", + }, + Annotations: map[string]string{ + "B2": "4", + }, + OwnerReferences: []meta.OwnerReference{ + { + UID: "test2", + }, + }, + })(func(t *testing.T, pod *core.PodTemplateSpec) { + require.Len(t, pod.Labels, 1) + require.Contains(t, pod.Labels, "A") + require.EqualValues(t, "3", pod.Labels["A"]) + + require.Len(t, pod.Annotations, 2) + require.Contains(t, pod.Annotations, "B") + require.EqualValues(t, "2", pod.Annotations["B"]) + require.Contains(t, pod.Annotations, "B2") + require.EqualValues(t, "4", pod.Annotations["B2"]) + require.Len(t, pod.OwnerReferences, 2) require.EqualValues(t, "test", pod.OwnerReferences[0].UID) require.EqualValues(t, "test2", pod.OwnerReferences[1].UID) diff --git a/pkg/apis/shared/validate.go b/pkg/apis/shared/validate.go index 47e059533..2c746f63e 100644 --- a/pkg/apis/shared/validate.go +++ b/pkg/apis/shared/validate.go @@ -34,7 +34,7 @@ import ( var ( resourceNameRE = regexp.MustCompile(`^([0-9\-\.a-z])+$`) - apiPathRE = regexp.MustCompile(`^/([A-Za-z0-9\-]+/)*$`) + apiPathRE = regexp.MustCompile(`^/([_A-Za-z0-9\-]+/)*$`) ) const ( @@ -190,6 +190,19 @@ func ValidateList[T any](in []T, validator func(T) error) error { return WithErrors(errors...) } +// ValidateMap validates all elements on the list +func ValidateMap[T any](in map[string]T, validator func(string, T) error) error { + errors := make([]error, 0, len(in)) + + for id := range in { + if err := PrefixResourceError(fmt.Sprintf("`%s`", id), validator(id, in[id])); err != nil { + errors = append(errors, err) + } + } + + return WithErrors(errors...) +} + // ValidateImage Validates if provided image is valid func ValidateImage(image string) error { if image == "" { diff --git a/pkg/crd/crds/database-deployment.schema.generated.yaml b/pkg/crd/crds/database-deployment.schema.generated.yaml index be717c42f..af86e39dc 100644 --- a/pkg/crd/crds/database-deployment.schema.generated.yaml +++ b/pkg/crd/crds/database-deployment.schema.generated.yaml @@ -6577,236 +6577,726 @@ v1: Image is the image to use for the gateway. By default, the image is determined by the operator. type: string - type: object - gateways: - description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. - properties: - affinity: - description: Affinity specified additional affinity settings in ArangoDB Pod definitions + sidecar: + description: Sidecar define the integration sidecar spec properties: - preferredDuringSchedulingIgnoredDuringExecution: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + controllerListenPort: + format: int32 + type: integer + env: items: properties: - podAffinityTerm: + name: + type: string + value: + type: string + valueFrom: properties: - labelSelector: + configMapKeyRef: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + key: + type: string + name: + type: string + optional: + type: boolean type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + fieldRef: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string type: object - weight: - format: int32 - type: integer type: object type: array - requiredDuringSchedulingIgnoredDuringExecution: + envFrom: items: properties: - labelSelector: + configMapRef: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + name: + type: string + optional: + type: boolean type: object - matchLabelKeys: - items: - type: string - type: array - mismatchLabelKeys: - items: - type: string - type: array - namespaceSelector: + prefix: + type: string + secretRef: properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object + name: + type: string + optional: + type: boolean type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string type: object type: array - type: object - allowMemberRecreation: - description: |- - AllowMemberRecreation allows to recreate member. - This setting changes the member recreation logic based on group: - - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) - - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. - type: boolean - annotations: - additionalProperties: - type: string - description: |- - Annotations specified the annotations added to Pods in this group. - Annotations are merged with `spec.annotations`. - type: object - annotationsIgnoreList: - description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored - items: - type: string - type: array - annotationsMode: - description: AnnotationsMode Define annotations mode which should be use while overriding annotations - type: string - antiAffinity: - description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string type: object - type: object - matchLabelKeys: - items: + type: array + path: type: string - type: array - mismatchLabelKeys: - items: + port: type: string - type: array - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: + x-kubernetes-int-or-string: true + scheme: type: string - type: array - topologyKey: - type: string - type: object - weight: - format: int32 - type: integer - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + listenPort: + format: int32 + type: integer + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: object + gateways: + description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. + properties: + affinity: + description: Affinity specified additional affinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + allowMemberRecreation: + description: |- + AllowMemberRecreation allows to recreate member. + This setting changes the member recreation logic based on group: + - For Sync Masters, Sync Workers, Coordinator and DB-Servers it determines if a member can be recreated in case of failure (default `true`) + - For Agents and Single this value is hardcoded to `false` and the value provided in spec is ignored. + type: boolean + annotations: + additionalProperties: + type: string + description: |- + Annotations specified the annotations added to Pods in this group. + Annotations are merged with `spec.annotations`. + type: object + annotationsIgnoreList: + description: AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored + items: + type: string + type: array + annotationsMode: + description: AnnotationsMode Define annotations mode which should be use while overriding annotations + type: string + antiAffinity: + description: AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: key: type: string operator: @@ -22167,443 +22657,933 @@ v1alpha: volumeMounts: items: properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + type: object + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: + properties: + status: type: string - subPathExpr: + targetVolumeAttributesClassName: type: string type: object - type: array - workingDir: - type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: - description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container items: properties: - effect: + mountPath: type: string - key: + mountPropagation: type: string - operator: + name: type: string - tolerationSeconds: - format: int64 - type: integer - value: + readOnly: + type: boolean + subPath: + type: string + subPathExpr: type: string type: object type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + type: object + type: array + type: object + disableIPv6: + description: |- + DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. + This setting cannot be changed after the deployment has been created. + type: boolean + downtimeAllowed: + description: |- + DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. + When this setting is set to false, no automatic action that may result in downtime is allowed. + If the need for such an action is detected, an event is added to the ArangoDeployment. + Once this setting is set to true, the automatic action is executed. + Operations that may result in downtime are: + - Rotating TLS CA certificate + Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. + type: boolean + environment: + description: Environment setting specifies the type of environment in which the deployment is created. + enum: + - Development + - Production + type: string + externalAccess: + description: ExternalAccess holds configuration for the external access provided for the deployment. + properties: + advertisedEndpoint: + description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint + type: string + loadBalancerIP: + description: |- + LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. + If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. + type: string + loadBalancerSourceRanges: + description: |- + LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type + If specified and supported by the platform, this will restrict traffic through the cloud-provider + load-balancer will be restricted to the specified client IPs. This field will be ignored if the + cloud-provider does not support the feature. + items: + type: string + type: array + managedServiceNames: + description: |- + ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. + It is only relevant when type of service is `managed`. + items: + type: string + type: array + nodePort: + description: |- + NodePort define optional port used in case of Auto or NodePort type. + This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. + If you do not specify this setting, a random port will be chosen automatically. + format: int32 + type: integer + type: + description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. + enum: + - Auto + - None + - LoadBalancer + - NodePort + type: string + type: object + features: + description: Features allows to configure feature flags + properties: + foxx.queues: type: boolean - volumeClaimTemplate: + type: object + gateway: + description: Gateway defined main Gateway configuration. + properties: + enabled: description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. + Enabled setting enables/disables support for gateway in the cluster. + When enabled, the cluster will contain a number of `gateway` servers. + type: boolean + image: + description: |- + Image is the image to use for the gateway. + By default, the image is determined by the operator. + type: string + sidecar: + description: Sidecar define the integration sidecar spec properties: - apiVersion: - type: string - kind: - type: string - metadata: - properties: - annotations: - additionalProperties: - type: string - type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: - format: int64 - type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + controllerListenPort: + format: int32 + type: integer + env: + items: + properties: + name: type: string - type: array - generateName: - type: string - generation: - format: int64 - type: integer - labels: - additionalProperties: + value: type: string - type: object - managedFields: - items: + valueFrom: properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: - items: + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - apiVersion: + name: type: string - blockOwnerDeletion: + optional: type: boolean - controller: - type: boolean - kind: - type: string + type: object + prefix: + type: string + secretRef: + properties: name: type: string - uid: - type: string + optional: + type: boolean type: object - type: array - resourceVersion: - type: string - selfLink: - type: string - uid: - type: string + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object type: object - spec: + listenPort: + format: int32 + type: integer + livenessProbe: properties: - accessModes: - items: - type: string - type: array - dataSource: + exec: properties: - apiGroup: - type: string - kind: - type: string - name: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: type: string type: object - dataSourceRef: + httpGet: properties: - apiGroup: + host: type: string - kind: + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: type: string - name: + port: type: string - namespace: + x-kubernetes-int-or-string: true + scheme: type: string type: object - resources: + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: properties: - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: type: string - type: object + type: array type: object - selector: + failureThreshold: + format: int32 + type: integer + grpc: properties: - matchExpressions: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - storageClassName: - type: string - volumeAttributesClassName: - type: string - volumeMode: - type: string - volumeName: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - status: + resources: properties: - accessModes: + claims: items: - type: string + properties: + name: + type: string + type: object type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: + limits: additionalProperties: type: string type: object - capacity: + requests: additionalProperties: type: string type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: type: string - type: + type: array + drop: + items: type: string - type: object - type: array - currentVolumeAttributesClassName: + type: array + type: object + privileged: + type: boolean + procMount: type: string - modifyVolumeStatus: + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: properties: - status: + level: type: string - targetVolumeAttributesClassName: + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: type: string type: object - phase: - type: string type: object - type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - volumes: - description: Volumes define list of volumes mounted to pod - items: - properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath - properties: - path: - type: string - type: - type: string - type: object - name: - description: Name of volume - type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: - type: string - readOnly: - type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - type: object - type: array - type: object - disableIPv6: - description: |- - DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. - This setting cannot be changed after the deployment has been created. - type: boolean - downtimeAllowed: - description: |- - DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. - When this setting is set to false, no automatic action that may result in downtime is allowed. - If the need for such an action is detected, an event is added to the ArangoDeployment. - Once this setting is set to true, the automatic action is executed. - Operations that may result in downtime are: - - Rotating TLS CA certificate - Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. - type: boolean - environment: - description: Environment setting specifies the type of environment in which the deployment is created. - enum: - - Development - - Production - type: string - externalAccess: - description: ExternalAccess holds configuration for the external access provided for the deployment. - properties: - advertisedEndpoint: - description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint - type: string - loadBalancerIP: - description: |- - LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. - If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. - type: string - loadBalancerSourceRanges: - description: |- - LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type - If specified and supported by the platform, this will restrict traffic through the cloud-provider - load-balancer will be restricted to the specified client IPs. This field will be ignored if the - cloud-provider does not support the feature. - items: - type: string - type: array - managedServiceNames: - description: |- - ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. - It is only relevant when type of service is `managed`. - items: - type: string - type: array - nodePort: - description: |- - NodePort define optional port used in case of Auto or NodePort type. - This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. - If you do not specify this setting, a random port will be chosen automatically. - format: int32 - type: integer - type: - description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. - enum: - - Auto - - None - - LoadBalancer - - NodePort - type: string - type: object - features: - description: Features allows to configure feature flags - properties: - foxx.queues: - type: boolean - type: object - gateway: - description: Gateway defined main Gateway configuration. - properties: - enabled: - description: |- - Enabled setting enables/disables support for gateway in the cluster. - When enabled, the cluster will contain a number of `gateway` servers. - type: boolean - image: - description: |- - Image is the image to use for the gateway. - By default, the image is determined by the operator. - type: string + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. @@ -37870,7 +38850,244 @@ v2alpha1: type: object type: object type: object - livenessProbe: + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: properties: exec: properties: @@ -37935,696 +39152,955 @@ v2alpha1: format: int32 type: integer type: object - name: + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: type: string - ports: + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: items: properties: - containerPort: - format: int32 - type: integer - hostIP: + devicePath: type: string - hostPort: - format: int32 - type: integer name: type: string - protocol: + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: type: string type: object type: array - readinessProbe: - properties: - exec: + workingDir: + type: string + type: object + type: array + storageClassName: + description: StorageClassName specifies the classname for storage of the servers. + type: string + terminationGracePeriodSeconds: + description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation + format: int64 + type: integer + tolerations: + description: |- + Tolerations specifies the tolerations added to Pods in this group. + By default, suitable tolerations are set for the following keys with the `NoExecute` effect: + - `node.kubernetes.io/not-ready` + - `node.kubernetes.io/unreachable` + - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) + For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + volumeAllowShrink: + description: VolumeAllowShrink allows shrinking of the volume + type: boolean + volumeClaimTemplate: + description: |- + VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. + This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. + The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. + If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim + with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` + and `iops` is not forwarded to the pods resource requirements. + properties: + apiVersion: + type: string + kind: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: properties: - command: - items: - type: string - type: array + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string type: object - failureThreshold: - format: int32 - type: integer - grpc: + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: properties: - port: - format: int32 - type: integer - service: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: type: string - type: object - httpGet: + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + status: + properties: + accessModes: + items: + type: string + type: array + allocatedResourceStatuses: + additionalProperties: + type: string + type: object + allocatedResources: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + conditions: + items: properties: - host: + lastProbeTime: + format: date-time type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: + lastTransitionTime: + format: date-time type: string - port: + message: type: string - x-kubernetes-int-or-string: true - scheme: + reason: type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: + status: type: string - port: + type: type: string - x-kubernetes-int-or-string: true type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resizePolicy: - items: + type: array + currentVolumeAttributesClassName: + type: string + modifyVolumeStatus: properties: - resourceName: + status: type: string - restartPolicy: + targetVolumeAttributesClassName: type: string type: object - type: array - resources: + phase: + type: string + type: object + type: object + volumeMounts: + description: VolumeMounts define list of volume mounts mounted into server container + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + volumes: + description: Volumes define list of volumes mounted to pod + items: + properties: + configMap: + description: ConfigMap which should be mounted into pod properties: - claims: + defaultMode: + format: int32 + type: integer + items: items: properties: - name: + key: + type: string + mode: + format: int32 + type: integer + path: type: string type: object type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object + name: + type: string + optional: + type: boolean type: object - restartPolicy: + emptyDir: + description: EmptyDir + properties: + medium: + type: string + sizeLimit: + type: string + type: object + hostPath: + description: HostPath + properties: + path: + type: string + type: + type: string + type: object + name: + description: Name of volume + type: string + persistentVolumeClaim: + description: PersistentVolumeClaim + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + secret: + description: Secret which should be mounted into pod + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + type: object + type: array + type: object + disableIPv6: + description: |- + DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. + This setting cannot be changed after the deployment has been created. + type: boolean + downtimeAllowed: + description: |- + DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. + When this setting is set to false, no automatic action that may result in downtime is allowed. + If the need for such an action is detected, an event is added to the ArangoDeployment. + Once this setting is set to true, the automatic action is executed. + Operations that may result in downtime are: + - Rotating TLS CA certificate + Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. + type: boolean + environment: + description: Environment setting specifies the type of environment in which the deployment is created. + enum: + - Development + - Production + type: string + externalAccess: + description: ExternalAccess holds configuration for the external access provided for the deployment. + properties: + advertisedEndpoint: + description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint + type: string + loadBalancerIP: + description: |- + LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. + If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. + type: string + loadBalancerSourceRanges: + description: |- + LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type + If specified and supported by the platform, this will restrict traffic through the cloud-provider + load-balancer will be restricted to the specified client IPs. This field will be ignored if the + cloud-provider does not support the feature. + items: + type: string + type: array + managedServiceNames: + description: |- + ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. + It is only relevant when type of service is `managed`. + items: + type: string + type: array + nodePort: + description: |- + NodePort define optional port used in case of Auto or NodePort type. + This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. + If you do not specify this setting, a random port will be chosen automatically. + format: int32 + type: integer + type: + description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. + enum: + - Auto + - None + - LoadBalancer + - NodePort + type: string + type: object + features: + description: Features allows to configure feature flags + properties: + foxx.queues: + type: boolean + type: object + gateway: + description: Gateway defined main Gateway configuration. + properties: + enabled: + description: |- + Enabled setting enables/disables support for gateway in the cluster. + When enabled, the cluster will contain a number of `gateway` servers. + type: boolean + image: + description: |- + Image is the image to use for the gateway. + By default, the image is determined by the operator. + type: string + sidecar: + description: Sidecar define the integration sidecar spec + properties: + args: + items: type: string - securityContext: + type: array + command: + items: + type: string + type: array + controllerListenPort: + format: int32 + type: integer + env: + items: properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: + name: type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: + value: + type: string + valueFrom: properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object type: object - seccompProfile: + type: object + type: array + envFrom: + items: + properties: + configMapRef: properties: - localhostProfile: - type: string - type: + name: type: string + optional: + type: boolean type: object - windowsOptions: + prefix: + type: string + secretRef: properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: + name: type: string - hostProcess: + optional: type: boolean - runAsUserName: - type: string type: object type: object - startupProbe: - properties: - exec: - properties: - command: - items: + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + listenPort: + format: int32 + type: integer + livenessProbe: + properties: + exec: + properties: + command: + items: type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + ports: + items: + properties: + containerPort: format: int32 type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: + hostIP: + type: string + hostPort: format: int32 type: integer + name: + type: string + protocol: + type: string type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: + type: array + readinessProbe: + properties: + exec: properties: - devicePath: - type: string - name: - type: string + command: + items: + type: string + type: array type: object - type: array - volumeMounts: - items: + failureThreshold: + format: int32 + type: integer + grpc: properties: - mountPath: + port: + format: int32 + type: integer + service: type: string - mountPropagation: + type: object + httpGet: + properties: + host: type: string - name: + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: type: string - readOnly: - type: boolean - subPath: + port: type: string - subPathExpr: + x-kubernetes-int-or-string: true + scheme: type: string type: object - type: array - workingDir: - type: string - type: object - type: array - storageClassName: - description: StorageClassName specifies the classname for storage of the servers. - type: string - terminationGracePeriodSeconds: - description: TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation - format: int64 - type: integer - tolerations: - description: |- - Tolerations specifies the tolerations added to Pods in this group. - By default, suitable tolerations are set for the following keys with the `NoExecute` effect: - - `node.kubernetes.io/not-ready` - - `node.kubernetes.io/unreachable` - - `node.alpha.kubernetes.io/unreachable` (will be removed in future version) - For more information on tolerations, consult the https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeAllowShrink: - description: VolumeAllowShrink allows shrinking of the volume - type: boolean - volumeClaimTemplate: - description: |- - VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. - This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. - The default value describes a volume with `8Gi` storage, `ReadWriteOnce` access mode and volume mode set to `PersistentVolumeFilesystem`. - If this field is not set and `spec..resources.requests.storage` is set, then a default volume claim - with size as specified by `spec..resources.requests.storage` will be created. In that case `storage` - and `iops` is not forwarded to the pods resource requirements. - properties: - apiVersion: - type: string - kind: - type: string - metadata: - properties: - annotations: - additionalProperties: - type: string + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true type: object - creationTimestamp: - format: date-time - type: string - deletionGracePeriodSeconds: + terminationGracePeriodSeconds: format: int64 type: integer - deletionTimestamp: - format: date-time - type: string - finalizers: - items: - type: string - type: array - generateName: - type: string - generation: - format: int64 + timeoutSeconds: + format: int32 type: integer - labels: - additionalProperties: - type: string - type: object - managedFields: - items: - properties: - apiVersion: - type: string - fieldsType: - type: string - fieldsV1: - type: object - manager: - type: string - operation: - type: string - subresource: - type: string - time: - format: date-time - type: string - type: object - type: array - name: - type: string - namespace: - type: string - ownerReferences: + type: object + resources: + properties: + claims: items: properties: - apiVersion: - type: string - blockOwnerDeletion: - type: boolean - controller: - type: boolean - kind: - type: string name: type: string - uid: - type: string type: object type: array - resourceVersion: - type: string - selfLink: - type: string - uid: - type: string + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object type: object - spec: + securityContext: properties: - accessModes: - items: - type: string - type: array - dataSource: + allowPrivilegeEscalation: + type: boolean + capabilities: properties: - apiGroup: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: type: string - kind: + role: type: string - name: + type: + type: string + user: type: string type: object - dataSourceRef: + seccompProfile: properties: - apiGroup: + localhostProfile: type: string - kind: + type: type: string - name: + type: object + windowsOptions: + properties: + gmsaCredentialSpec: type: string - namespace: + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: type: string type: object - resources: + type: object + startupProbe: + properties: + exec: properties: - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: + command: + items: type: string - type: object + type: array type: object - selector: + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: properties: - matchExpressions: + host: + type: string + httpHeaders: items: properties: - key: + name: type: string - operator: + value: type: string - values: - items: - type: string - type: array type: object type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeAttributesClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResourceStatuses: - additionalProperties: - type: string - type: object - allocatedResources: - additionalProperties: - type: string - type: object - capacity: - additionalProperties: - type: string + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - type: object - type: array - currentVolumeAttributesClassName: - type: string - modifyVolumeStatus: + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: properties: - status: + host: type: string - targetVolumeAttributesClassName: + port: type: string + x-kubernetes-int-or-string: true type: object - phase: - type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer type: object - type: object - volumeMounts: - description: VolumeMounts define list of volume mounts mounted into server container - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - volumes: - description: Volumes define list of volumes mounted to pod - items: - properties: - configMap: - description: ConfigMap which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - emptyDir: - description: EmptyDir - properties: - medium: - type: string - sizeLimit: - type: string - type: object - hostPath: - description: HostPath + volumeMounts: + items: properties: - path: + mountPath: type: string - type: + mountPropagation: type: string - type: object - name: - description: Name of volume - type: string - persistentVolumeClaim: - description: PersistentVolumeClaim - properties: - claimName: + name: type: string readOnly: type: boolean - type: object - secret: - description: Secret which should be mounted into pod - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - type: object - type: array - optional: - type: boolean - secretName: + subPath: + type: string + subPathExpr: type: string type: object - type: object - type: array - type: object - disableIPv6: - description: |- - DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. - This setting cannot be changed after the deployment has been created. - type: boolean - downtimeAllowed: - description: |- - DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. - When this setting is set to false, no automatic action that may result in downtime is allowed. - If the need for such an action is detected, an event is added to the ArangoDeployment. - Once this setting is set to true, the automatic action is executed. - Operations that may result in downtime are: - - Rotating TLS CA certificate - Note: It is still possible that there is some downtime when the Kubernetes cluster is down, or in a bad state, irrespective of the value of this setting. - type: boolean - environment: - description: Environment setting specifies the type of environment in which the deployment is created. - enum: - - Development - - Production - type: string - externalAccess: - description: ExternalAccess holds configuration for the external access provided for the deployment. - properties: - advertisedEndpoint: - description: AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint - type: string - loadBalancerIP: - description: |- - LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. - If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. - type: string - loadBalancerSourceRanges: - description: |- - LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type - If specified and supported by the platform, this will restrict traffic through the cloud-provider - load-balancer will be restricted to the specified client IPs. This field will be ignored if the - cloud-provider does not support the feature. - items: - type: string - type: array - managedServiceNames: - description: |- - ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. - It is only relevant when type of service is `managed`. - items: - type: string - type: array - nodePort: - description: |- - NodePort define optional port used in case of Auto or NodePort type. - This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. - If you do not specify this setting, a random port will be chosen automatically. - format: int32 - type: integer - type: - description: Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. - enum: - - Auto - - None - - LoadBalancer - - NodePort - type: string - type: object - features: - description: Features allows to configure feature flags - properties: - foxx.queues: - type: boolean - type: object - gateway: - description: Gateway defined main Gateway configuration. - properties: - enabled: - type: boolean - image: - type: string + type: array + workingDir: + type: string + type: object type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. diff --git a/pkg/crd/crds/networking-route.schema.generated.yaml b/pkg/crd/crds/networking-route.schema.generated.yaml index 796f3be0a..49d93b356 100644 --- a/pkg/crd/crds/networking-route.schema.generated.yaml +++ b/pkg/crd/crds/networking-route.schema.generated.yaml @@ -4,11 +4,14 @@ v1alpha1: spec: properties: deployment: - description: DeploymentName specifies the ArangoDeployment object name + description: Deployment specifies the ArangoDeployment object name type: string destination: description: Destination defines the route destination properties: + path: + description: Path defines service path used for overrides + type: string schema: description: Schema defines HTTP/S schema used for connection type: string diff --git a/pkg/deployment/images.go b/pkg/deployment/images.go index 2f1e016e0..21caa5a80 100644 --- a/pkg/deployment/images.go +++ b/pkg/deployment/images.go @@ -31,6 +31,7 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" @@ -283,7 +284,7 @@ func (i *ImageUpdatePod) GetRole() string { return "id" } -func (i *ImageUpdatePod) Init(_ context.Context, _ interfaces.Inspector, pod *core.Pod) error { +func (i *ImageUpdatePod) Init(_ context.Context, _ interfaces.Inspector, pod *core.PodTemplateSpec) error { terminationGracePeriodSeconds := int64((time.Second * 30).Seconds()) pod.Spec.TerminationGracePeriodSeconds = &terminationGracePeriodSeconds pod.Spec.PriorityClassName = i.spec.ID.Get().PriorityClassName @@ -311,7 +312,7 @@ func (i *ImageUpdatePod) GetVolumes() []core.Volume { return getVolumes(i.AsInput()).Volumes() } -func (i *ImageUpdatePod) GetSidecars(*core.Pod) error { +func (i *ImageUpdatePod) GetSidecars(spec *core.PodTemplateSpec) error { return nil } @@ -503,6 +504,10 @@ func (a *ImageUpdatePod) AsInput() pod.Input { } } +func (i *ImageUpdatePod) Profiles() (schedulerApi.ProfileTemplates, error) { + return nil, nil +} + // GetExecutor returns the fixed path to the ArangoSync binary in the container. func (a *ArangoSyncIdentity) GetExecutor() string { return resources.ArangoSyncExecutor diff --git a/pkg/deployment/member/state.go b/pkg/deployment/member/state.go index 0738a9441..127a03051 100644 --- a/pkg/deployment/member/state.go +++ b/pkg/deployment/member/state.go @@ -132,6 +132,8 @@ func (s *stateInspector) RefreshState(ctx context.Context, members api.Deploymen if results[id].IsServing() { client = results[id].client } + case api.ServerGroupTypeGateway: + results[id] = s.fetchGatewayMemberState(ctxChild, members[id]) default: assertion.InvalidGroupKey.Assert(true, "Unable to fetch Health for an unknown group: %s", members[id].Group.AsRole()) results[id] = State{ @@ -178,6 +180,9 @@ func (s *stateInspector) RefreshState(ctx context.Context, members api.Deploymen case api.ServerGroupTypeArangoSync: // ArangoSync is considered as healthy when it is possible to fetch version. results[i].IsClusterHealthy = true + case api.ServerGroupTypeGateway: + // Gateway is considered as healthy when it is possible to fetch version. + results[i].IsClusterHealthy = true default: assertion.InvalidGroupKey.Assert(true, "Unable to fetch Health for an unknown group: %s", members[i].Group.AsRole()) results[i].IsClusterHealthy = false @@ -228,6 +233,26 @@ func (s *stateInspector) fetchArangosyncMemberState(ctx context.Context, m api.D return state } +func (s *stateInspector) fetchGatewayMemberState(ctx context.Context, m api.DeploymentStatusMemberElement) State { + // by default, it is not serving. It will be changed if it serves. + var state State + c, err := s.deployment.GetServerClient(ctx, m.Group, m.Member.ID) + if err != nil { + state.NotReachableErr = err + return state + } + + if v, err := c.Version(ctx); err != nil { + state.NotReachableErr = err + return state + } else { + state.Version = v + state.client = c + } + + return state +} + func (s *stateInspector) fetchServerMemberState(ctx context.Context, m api.DeploymentStatusMemberElement, servingGroup api.ServerGroup) State { // by default, it is not serving. It will be changed if it serves. diff --git a/pkg/deployment/pod/probes.go b/pkg/deployment/pod/probes.go index d114644e7..c91d4354b 100644 --- a/pkg/deployment/pod/probes.go +++ b/pkg/deployment/pod/probes.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -81,4 +81,9 @@ var probeMap = map[api.ServerGroup]probes{ liveness: newProbe(true, true), readiness: newProbe(false, false), }, + api.ServerGroupGateways: { // TODO: Enable Probes + startup: newProbe(false, false), + liveness: newProbe(false, false), + readiness: newProbe(false, false), + }, } diff --git a/pkg/deployment/reconcile/action_runtime_sync_tolerations.go b/pkg/deployment/reconcile/action_runtime_sync_tolerations.go index 532ef2cca..39aeb0741 100644 --- a/pkg/deployment/reconcile/action_runtime_sync_tolerations.go +++ b/pkg/deployment/reconcile/action_runtime_sync_tolerations.go @@ -29,6 +29,7 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tolerations" @@ -78,7 +79,7 @@ func (a actionRuntimeContainerSyncTolerations) Start(ctx context.Context) (bool, expectedTolerations := member.Spec.Template.PodSpec.Spec.Tolerations - origTolerations := tolerations.CreatePodTolerations(a.actionCtx.GetMode(), a.action.Group) + origTolerations := resources.CreatePodTolerations(a.actionCtx.GetMode(), a.action.Group) calculatedTolerations := tolerations.MergeTolerationsIfNotFound(currentTolerations, origTolerations, expectedTolerations) diff --git a/pkg/deployment/resources/config_map_gateway.go b/pkg/deployment/resources/config_map_gateway.go new file mode 100644 index 000000000..6f1668696 --- /dev/null +++ b/pkg/deployment/resources/config_map_gateway.go @@ -0,0 +1,182 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "context" + "fmt" + "path/filepath" + + core "k8s.io/api/core/v1" + kerrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources/gateway" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" + configMapsV1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" +) + +func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspectorInterface.Inspector, configMaps configMapsV1.ModInterface) error { + deploymentName := r.context.GetAPIObject().GetName() + configMapName := GetGatewayConfigMapName(deploymentName) + + log := r.log.Str("section", "gateway-config").Str("name", configMapName) + + cfg, err := r.renderGatewayConfig(cachedStatus) + if err != nil { + return errors.WithStack(errors.Wrapf(err, "Failed to generate gateway config")) + } + + gatewayCfgYaml, gatewayCfgChecksum, _, err := cfg.RenderYAML() + if err != nil { + return errors.WithStack(errors.Wrapf(err, "Failed to render gateway config")) + } + + if cm, exists := cachedStatus.ConfigMap().V1().GetSimple(configMapName); !exists { + // Create + cm = &core.ConfigMap{ + ObjectMeta: meta.ObjectMeta{ + Name: configMapName, + }, + Data: map[string]string{ + GatewayConfigFileName: string(gatewayCfgYaml), + }, + } + + owner := r.context.GetAPIObject().AsOwner() + + err = globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { + return k8sutil.CreateConfigMap(ctxChild, configMaps, cm, &owner) + }) + if kerrors.IsAlreadyExists(err) { + // CM added while we tried it also + return nil + } else if err != nil { + // Failed to create + return errors.WithStack(err) + } + + return errors.Reconcile() + } else { + // CM Exists, checks checksum - if key is not in the map we return empty string + if existingSha := util.SHA256FromString(cm.Data[GatewayConfigFileName]); existingSha != gatewayCfgChecksum { + // We need to do the update + if _, changed, err := patcher.Patcher[*core.ConfigMap](ctx, cachedStatus.ConfigMapsModInterface().V1(), cm, meta.PatchOptions{}, + patcher.PatchConfigMapData(map[string]string{ + GatewayConfigFileName: string(gatewayCfgYaml), + })); err != nil { + log.Err(err).Debug("Failed to patch GatewayConfig ConfigMap") + return errors.WithStack(err) + } else if changed { + log.Str("service", cm.GetName()).Str("before", existingSha).Str("after", gatewayCfgChecksum).Info("Updated GatewayConfig") + } + } + } + return nil +} + +func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspector) (gateway.Config, error) { + deploymentName := r.context.GetAPIObject().GetName() + + log := r.log.Str("section", "gateway-config-render") + + spec := r.context.GetSpec() + svcServingName := fmt.Sprintf("%s-%s", deploymentName, spec.Mode.Get().ServingGroup().AsRole()) + + svc, svcExist := cachedStatus.Service().V1().GetSimple(svcServingName) + if !svcExist { + return gateway.Config{}, errors.Errorf("Service %s not found", svcServingName) + } + + var cfg gateway.Config + + cfg.DefaultDestination = gateway.ConfigDestination{ + Targets: []gateway.ConfigDestinationTarget{ + { + Host: svc.Spec.ClusterIP, + Port: shared.ArangoPort, + }, + }, + } + + if spec.TLS.IsSecure() { + // Enabled TLS, add config + keyPath := filepath.Join(shared.TLSKeyfileVolumeMountDir, constants.SecretTLSKeyfile) + cfg.DefaultTLS = &gateway.ConfigTLS{ + CertificatePath: keyPath, + PrivateKeyPath: keyPath, + } + cfg.DefaultDestination.Type = util.NewType(gateway.ConfigDestinationTypeHTTPS) + } + + // Check ArangoRoutes + if c, err := cachedStatus.ArangoRoute().V1Alpha1(); err == nil { + cfg.Destinations = gateway.ConfigDestinations{} + if err := c.Iterate(func(at *networkingApi.ArangoRoute) error { + log := log.Str("ArangoRoute", at.GetName()) + if !at.Status.Conditions.IsTrue(networkingApi.ReadyCondition) { + l := log + if c, ok := at.Status.Conditions.Get(networkingApi.ReadyCondition); ok { + l.Str("message", c.Message) + } + l.Warn("ArangoRoute is not ready") + + return nil + } + + if target := at.Status.Target; target != nil { + var dest gateway.ConfigDestination + if destinations := target.Destinations; len(destinations) > 0 { + for _, destination := range destinations { + var t gateway.ConfigDestinationTarget + + t.Host = destination.Host + t.Port = destination.Port + + dest.Targets = append(dest.Targets, t) + } + } + if tls := target.TLS; tls != nil { + dest.Type = util.NewType(gateway.ConfigDestinationTypeHTTPS) + } + dest.Path = util.NewType(target.Path) + cfg.Destinations[at.Spec.GetRoute().GetPath()] = dest + } + + return nil + + }, func(at *networkingApi.ArangoRoute) bool { + return at.Spec.GetDeployment() == deploymentName + }); err != nil { + return gateway.Config{}, errors.Wrapf(err, "Unable to iterate over ArangoRoutes") + } + } + + return cfg, nil +} diff --git a/pkg/deployment/resources/config_maps.go b/pkg/deployment/resources/config_maps.go index f1e5cf6d0..29a7f7317 100644 --- a/pkg/deployment/resources/config_maps.go +++ b/pkg/deployment/resources/config_maps.go @@ -22,21 +22,13 @@ package resources import ( "context" - "fmt" "time" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/metrics" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - configMapsV1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" ) var ( @@ -65,49 +57,3 @@ func (r *Resources) EnsureConfigMaps(ctx context.Context, cachedStatus inspector } return reconcileRequired.Reconcile(ctx) } - -func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspectorInterface.Inspector, configMaps configMapsV1.ModInterface) error { - deploymentName := r.context.GetAPIObject().GetName() - configMapName := GetGatewayConfigMapName(deploymentName) - - if _, exists := cachedStatus.ConfigMap().V1().GetSimple(configMapName); !exists { - // Find serving service (single/crdn) - spec := r.context.GetSpec() - svcServingName := fmt.Sprintf("%s-%s", deploymentName, spec.Mode.Get().ServingGroup().AsRole()) - - svc, svcExist := cachedStatus.Service().V1().GetSimple(svcServingName) - if !svcExist { - return errors.Errorf("Service %s not found", svcServingName) - } - - gatewayCfgYaml, err := RenderGatewayConfigYAML(svc.Spec.ClusterIP) - if err != nil { - return errors.WithStack(errors.Wrapf(err, "Failed to render gateway config")) - } - cm := &core.ConfigMap{ - ObjectMeta: meta.ObjectMeta{ - Name: configMapName, - }, - Data: map[string]string{ - GatewayConfigFileName: string(gatewayCfgYaml), - GatewayConfigChecksumName: util.SHA256(gatewayCfgYaml), - }, - } - - owner := r.context.GetAPIObject().AsOwner() - - err = globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { - return k8sutil.CreateConfigMap(ctxChild, configMaps, cm, &owner) - }) - if kerrors.IsAlreadyExists(err) { - // CM added while we tried it also - return nil - } else if err != nil { - // Failed to create - return errors.WithStack(err) - } - - return errors.Reconcile() - } - return nil -} diff --git a/pkg/deployment/resources/gateway/gateway_config.go b/pkg/deployment/resources/gateway/gateway_config.go new file mode 100644 index 000000000..465ee41f1 --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_config.go @@ -0,0 +1,259 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + "fmt" + "sort" + + bootstrapAPI "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3" + clusterAPI "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" + coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + listenerAPI "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" + routeAPI "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + routerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3" + httpConnectionManagerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/types/known/anypb" + "sigs.k8s.io/yaml" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type Config struct { + DefaultDestination ConfigDestination `json:"defaultDestination,omitempty"` + + Destinations ConfigDestinations `json:"destinations,omitempty"` + + DefaultTLS *ConfigTLS `json:"defaultTLS,omitempty"` +} + +func (c Config) Validate() error { + return errors.Errors( + shared.PrefixResourceErrors("defaultDestination", c.DefaultDestination.Validate()), + shared.PrefixResourceErrors("destinations", c.Destinations.Validate()), + ) +} + +func (c Config) RenderYAML() ([]byte, string, *bootstrapAPI.Bootstrap, error) { + cfg, err := c.Render() + if err != nil { + return nil, "", nil, err + } + + data, err := protojson.MarshalOptions{ + UseProtoNames: true, + }.Marshal(cfg) + if err != nil { + return nil, "", nil, err + } + + data, err = yaml.JSONToYAML(data) + return data, util.SHA256(data), cfg, err +} + +func (c Config) Render() (*bootstrapAPI.Bootstrap, error) { + if err := c.Validate(); err != nil { + return nil, errors.Wrapf(err, "Validation failed") + } + + clusters, err := c.RenderClusters() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render clusters") + } + + listener, err := c.RenderListener() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render listener") + } + + return &bootstrapAPI.Bootstrap{ + Admin: &bootstrapAPI.Admin{ + Address: &coreAPI.Address{ + Address: &coreAPI.Address_SocketAddress{ + SocketAddress: &coreAPI.SocketAddress{ + Address: "127.0.0.1", + PortSpecifier: &coreAPI.SocketAddress_PortValue{PortValue: 9901}, + }, + }, + }, + }, + StaticResources: &bootstrapAPI.Bootstrap_StaticResources{ + Listeners: []*listenerAPI.Listener{ + listener, + }, + Clusters: clusters, + }, + }, nil +} + +func (c Config) RenderClusters() ([]*clusterAPI.Cluster, error) { + def, err := c.DefaultDestination.RenderCluster("default") + if err != nil { + return nil, err + } + clusters := []*clusterAPI.Cluster{ + def, + } + + for k, v := range c.Destinations { + name := fmt.Sprintf("cluster_%s", util.SHA256FromString(k)) + c, err := v.RenderCluster(name) + if err != nil { + return nil, err + } + + clusters = append(clusters, c) + } + + sort.Slice(clusters, func(i, j int) bool { + return clusters[i].Name < clusters[j].Name + }) + + return clusters, nil +} + +func (c Config) RenderRoutes() ([]*routeAPI.Route, error) { + def, err := c.DefaultDestination.RenderRoute("default", "/") + if err != nil { + return nil, err + } + routes := []*routeAPI.Route{ + def, + } + + for k, v := range c.Destinations { + name := fmt.Sprintf("cluster_%s", util.SHA256FromString(k)) + c, err := v.RenderRoute(name, k) + if err != nil { + return nil, err + } + + routes = append(routes, c) + } + + sort.Slice(routes, func(i, j int) bool { + return routes[i].GetMatch().GetPrefix() > routes[j].GetMatch().GetPrefix() + }) + + return routes, nil +} + +func (c Config) RenderFilters() ([]*listenerAPI.Filter, error) { + httpFilterConfigType, err := anypb.New(&routerAPI.Router{}) + if err != nil { + return nil, errors.Wrapf(err, "Unable to render route config") + } + + routes, err := c.RenderRoutes() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render routes") + } + + filterConfigType, err := anypb.New(&httpConnectionManagerAPI.HttpConnectionManager{ + StatPrefix: "ingress_http", + CodecType: httpConnectionManagerAPI.HttpConnectionManager_AUTO, + RouteSpecifier: &httpConnectionManagerAPI.HttpConnectionManager_RouteConfig{ + RouteConfig: &routeAPI.RouteConfiguration{ + Name: "default", + VirtualHosts: []*routeAPI.VirtualHost{ + { + Name: "default", + Domains: []string{"*"}, + Routes: routes, + }, + }, + }, + }, + HttpFilters: []*httpConnectionManagerAPI.HttpFilter{ + { + Name: "envoy.filters.http.routerAPI", + ConfigType: &httpConnectionManagerAPI.HttpFilter_TypedConfig{ + TypedConfig: httpFilterConfigType, + }, + }, + }, + }) + if err != nil { + return nil, errors.Wrapf(err, "Unable to render http connection manager") + } + + return []*listenerAPI.Filter{ + { + Name: "envoy.filters.network.httpConnectionManagerAPI", + ConfigType: &listenerAPI.Filter_TypedConfig{ + TypedConfig: filterConfigType, + }, + }, + }, nil +} + +func (c Config) RenderDefaultFilterChain() (*listenerAPI.FilterChain, error) { + filters, err := c.RenderFilters() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render filters") + } + + ret := &listenerAPI.FilterChain{ + Filters: filters, + } + + if tls, err := c.DefaultTLS.RenderListenerTransportSocket(); err != nil { + return nil, err + } else { + ret.TransportSocket = tls + } + + return ret, nil +} + +func (c Config) RenderSecondaryFilterChains() ([]*listenerAPI.FilterChain, error) { + return nil, nil +} + +func (c Config) RenderListener() (*listenerAPI.Listener, error) { + filterChains, err := c.RenderSecondaryFilterChains() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render secondary filter chains") + } + + defaultFilterChain, err := c.RenderDefaultFilterChain() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render default filter") + } + + return &listenerAPI.Listener{ + Name: "default", + Address: &coreAPI.Address{ + Address: &coreAPI.Address_SocketAddress{ + SocketAddress: &coreAPI.SocketAddress{ + Address: "0.0.0.0", + PortSpecifier: &coreAPI.SocketAddress_PortValue{PortValue: shared.ArangoPort}, + }, + }, + }, + FilterChains: filterChains, + + DefaultFilterChain: defaultFilterChain, + }, nil +} diff --git a/pkg/deployment/resources/gateway/gateway_config_destination.go b/pkg/deployment/resources/gateway/gateway_config_destination.go new file mode 100644 index 000000000..29dbcace1 --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_config_destination.go @@ -0,0 +1,122 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + "time" + + clusterAPI "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" + endpointAPI "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" + routeAPI "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + "google.golang.org/protobuf/types/known/durationpb" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type ConfigDestinations map[string]ConfigDestination + +func (c ConfigDestinations) Validate() error { + if len(c) == 0 { + return nil + } + return shared.WithErrors( + shared.ValidateMap(c, func(k string, destination ConfigDestination) error { + var errs []error + if k == "/" { + errs = append(errs, errors.Errorf("Route for `/` is reserved")) + } + if err := shared.ValidateAPIPath(k); err != nil { + errs = append(errs, err) + } + if err := destination.Validate(); err != nil { + errs = append(errs, err) + } + return shared.WithErrors(errs...) + }), + ) +} + +type ConfigDestination struct { + Targets ConfigDestinationTargets `json:"targets,omitempty"` + + Type *ConfigDestinationType `json:"type,omitempty"` + + Path *string `json:"path,omitempty"` +} + +func (c ConfigDestination) Validate() error { + return shared.WithErrors( + shared.PrefixResourceError("targets", c.Targets.Validate()), + shared.PrefixResourceError("type", c.Type.Validate()), + shared.PrefixResourceError("path", shared.ValidateAPIPath(c.GetPath())), + ) +} + +func (c ConfigDestination) GetPath() string { + if c.Path == nil { + return "/" + } + + return *c.Path +} + +func (c ConfigDestination) RenderRoute(name, prefix string) (*routeAPI.Route, error) { + return &routeAPI.Route{ + Match: &routeAPI.RouteMatch{ + PathSpecifier: &routeAPI.RouteMatch_Prefix{ + Prefix: prefix, + }, + }, + Action: &routeAPI.Route_Route{ + Route: &routeAPI.RouteAction{ + ClusterSpecifier: &routeAPI.RouteAction_Cluster{ + Cluster: name, + }, + PrefixRewrite: c.GetPath(), + }, + }, + }, nil +} + +func (c ConfigDestination) RenderCluster(name string) (*clusterAPI.Cluster, error) { + cluster := &clusterAPI.Cluster{ + Name: name, + ConnectTimeout: durationpb.New(time.Second), + LbPolicy: clusterAPI.Cluster_ROUND_ROBIN, + LoadAssignment: &endpointAPI.ClusterLoadAssignment{ + ClusterName: name, + Endpoints: []*endpointAPI.LocalityLbEndpoints{ + { + LbEndpoints: c.Targets.RenderEndpoints(), + }, + }, + }, + } + + if t, err := c.Type.RenderUpstreamTransportSocket(); err != nil { + return nil, err + } else { + cluster.TransportSocket = t + } + + return cluster, nil +} diff --git a/pkg/deployment/resources/gateway/gateway_config_destination_target.go b/pkg/deployment/resources/gateway/gateway_config_destination_target.go new file mode 100644 index 000000000..4f2d974c9 --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_config_destination_target.go @@ -0,0 +1,92 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + endpointAPI "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type ConfigDestinationTargets []ConfigDestinationTarget + +func (c ConfigDestinationTargets) RenderEndpoints() []*endpointAPI.LbEndpoint { + var endpoints = make([]*endpointAPI.LbEndpoint, len(c)) + + for id := range c { + endpoints[id] = c[id].RenderEndpoint() + } + + return endpoints +} + +func (c ConfigDestinationTargets) Validate() error { + if len(c) == 0 { + return errors.Errorf("Empty Target not allowed") + } + return shared.ValidateList(c, func(target ConfigDestinationTarget) error { + return target.Validate() + }) +} + +type ConfigDestinationTarget struct { + Host string `json:"ip,omitempty"` + Port int32 `json:"port,omitempty"` +} + +func (c ConfigDestinationTarget) Validate() error { + return shared.WithErrors( + shared.ValidateRequiredPath("ip", &c.Host, func(t string) error { + if t == "" { + return errors.Errorf("Empty string not allowed") + } + return nil + }), + shared.ValidateRequiredPath("ip", &c.Port, func(t int32) error { + if t <= 0 { + return errors.Errorf("Port needs to be greater than 0") + } + return nil + }), + ) +} + +func (c ConfigDestinationTarget) RenderEndpoint() *endpointAPI.LbEndpoint { + return &endpointAPI.LbEndpoint{ + HostIdentifier: &endpointAPI.LbEndpoint_Endpoint{ + Endpoint: &endpointAPI.Endpoint{ + Address: &coreAPI.Address{ + Address: &coreAPI.Address_SocketAddress{ + SocketAddress: &coreAPI.SocketAddress{ + Protocol: coreAPI.SocketAddress_TCP, + Address: c.Host, + PortSpecifier: &coreAPI.SocketAddress_PortValue{ + PortValue: uint32(c.Port), + }, + }, + }, + }, + }, + }, + } +} diff --git a/pkg/deployment/resources/gateway/gateway_config_destination_type.go b/pkg/deployment/resources/gateway/gateway_config_destination_type.go new file mode 100644 index 000000000..590a42a08 --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_config_destination_type.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + tlsApi "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3" + "google.golang.org/protobuf/types/known/anypb" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type ConfigDestinationType int + +const ( + ConfigDestinationTypeHTTP ConfigDestinationType = iota + ConfigDestinationTypeHTTPS +) + +func (c *ConfigDestinationType) Get() ConfigDestinationType { + if c == nil { + return ConfigDestinationTypeHTTP + } + + switch v := *c; v { + case ConfigDestinationTypeHTTP, ConfigDestinationTypeHTTPS: + return v + default: + return ConfigDestinationTypeHTTP + } +} + +func (c *ConfigDestinationType) RenderUpstreamTransportSocket() (*coreAPI.TransportSocket, error) { + if c.Get() == ConfigDestinationTypeHTTPS { + tlsConfig, err := anypb.New(&tlsApi.UpstreamTlsContext{ + CommonTlsContext: &tlsApi.CommonTlsContext{ + ValidationContextType: &tlsApi.CommonTlsContext_ValidationContext{}, + }, + }) + if err != nil { + return nil, err + } + + return &coreAPI.TransportSocket{ + Name: "envoy.transport_sockets.tls", + ConfigType: &coreAPI.TransportSocket_TypedConfig{ + TypedConfig: tlsConfig, + }, + }, nil + } + + return nil, nil +} + +func (c *ConfigDestinationType) Validate() error { + switch c.Get() { + case ConfigDestinationTypeHTTP, ConfigDestinationTypeHTTPS: + return nil + default: + return errors.Errorf("Invalid destination type") + } +} diff --git a/pkg/deployment/resources/gateway/gateway_config_test.go b/pkg/deployment/resources/gateway/gateway_config_test.go new file mode 100644 index 000000000..d8655f03f --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_config_test.go @@ -0,0 +1,150 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + "testing" + + bootstrapAPI "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3" + "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func renderAndPrintGatewayConfig(t *testing.T, cfg Config) *bootstrapAPI.Bootstrap { + data, checksum, obj, err := cfg.RenderYAML() + require.NoError(t, err) + + t.Logf("Checksum: %s", checksum) + t.Log(string(data)) + + return obj +} + +func Test_GatewayConfig(t *testing.T) { + t.Run("Default", func(t *testing.T) { + renderAndPrintGatewayConfig(t, Config{ + DefaultDestination: ConfigDestination{ + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12345, + }, + }, + }, + }) + }) + t.Run("Default", func(t *testing.T) { + renderAndPrintGatewayConfig(t, Config{ + DefaultDestination: ConfigDestination{ + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12345, + }, + }, + Type: util.NewType(ConfigDestinationTypeHTTPS), + }, + DefaultTLS: &ConfigTLS{ + CertificatePath: "/test", + PrivateKeyPath: "/test12", + }, + }) + }) + t.Run("Default", func(t *testing.T) { + renderAndPrintGatewayConfig(t, Config{ + DefaultDestination: ConfigDestination{ + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12345, + }, + }, + Path: util.NewType("/test/path/"), + Type: util.NewType(ConfigDestinationTypeHTTPS), + }, + DefaultTLS: &ConfigTLS{ + CertificatePath: "/test", + PrivateKeyPath: "/test12", + }, + }) + }) + t.Run("Default", func(t *testing.T) { + renderAndPrintGatewayConfig(t, Config{ + DefaultDestination: ConfigDestination{ + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12345, + }, + }, + Path: util.NewType("/test/path/"), + Type: util.NewType(ConfigDestinationTypeHTTPS), + }, + DefaultTLS: &ConfigTLS{ + CertificatePath: "/test", + PrivateKeyPath: "/test12", + }, + Destinations: ConfigDestinations{ + "/test/": { + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12346, + }, + }, + Path: util.NewType("/test/path/"), + Type: util.NewType(ConfigDestinationTypeHTTPS), + }, + }, + }) + }) + t.Run("Default", func(t *testing.T) { + renderAndPrintGatewayConfig(t, Config{ + DefaultDestination: ConfigDestination{ + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12345, + }, + }, + Path: util.NewType("/test/path/"), + Type: util.NewType(ConfigDestinationTypeHTTPS), + }, + DefaultTLS: &ConfigTLS{ + CertificatePath: "/test", + PrivateKeyPath: "/test12", + }, + Destinations: ConfigDestinations{ + "/_test/": { + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12346, + }, + }, + Path: util.NewType("/test/path/"), + Type: util.NewType(ConfigDestinationTypeHTTP), + }, + }, + }) + }) +} diff --git a/pkg/deployment/resources/gateway/gateway_config_tls.go b/pkg/deployment/resources/gateway/gateway_config_tls.go new file mode 100644 index 000000000..98f90fd3a --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_config_tls.go @@ -0,0 +1,69 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + tlsApi "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3" + "google.golang.org/protobuf/types/known/anypb" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type ConfigTLS struct { + CertificatePath string `json:"certificatePath,omitempty"` + PrivateKeyPath string `json:"privateKeyPath,omitempty"` +} + +func (c *ConfigTLS) RenderListenerTransportSocket() (*coreAPI.TransportSocket, error) { + if c == nil { + return nil, nil + } + + tlsContext, err := anypb.New(&tlsApi.DownstreamTlsContext{ + CommonTlsContext: &tlsApi.CommonTlsContext{ + TlsCertificates: []*tlsApi.TlsCertificate{ + { + CertificateChain: &coreAPI.DataSource{ + Specifier: &coreAPI.DataSource_Filename{ + Filename: c.CertificatePath, + }, + }, + PrivateKey: &coreAPI.DataSource{ + Specifier: &coreAPI.DataSource_Filename{ + Filename: c.PrivateKeyPath, + }, + }, + }, + }, + }, + }) + if err != nil { + return nil, errors.Wrapf(err, "Unable to render tls context") + } + + return &coreAPI.TransportSocket{ + Name: "envoy.transport_sockets.tls", + ConfigType: &coreAPI.TransportSocket_TypedConfig{ + TypedConfig: tlsContext, + }, + }, nil +} diff --git a/pkg/deployment/resources/gateway_config.go b/pkg/deployment/resources/gateway_config.go deleted file mode 100644 index 38408e4ea..000000000 --- a/pkg/deployment/resources/gateway_config.go +++ /dev/null @@ -1,268 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - -package resources - -import ( - "fmt" - "net/url" - "strconv" - "time" - - bootstrapAPI "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3" - clusterAPI "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" - coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" - endpointAPI "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" - listenerAPI "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" - routeAPI "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" - routerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3" - httpConnectionManagerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/types/known/anypb" - "google.golang.org/protobuf/types/known/durationpb" - "sigs.k8s.io/yaml" - - shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/arangodb/kube-arangodb/pkg/util" -) - -type Redirect util.KV[string, []string] - -func WithRedirect(prefix string, target ...string) Redirect { - return Redirect{ - K: prefix, - V: target, - } -} - -func RenderGatewayConfigYAML(dbServiceAddress string, redirects ...Redirect) ([]byte, error) { - cfg, err := RenderConfig(dbServiceAddress, redirects...) - if err != nil { - return nil, err - } - - data, err := protojson.MarshalOptions{ - UseProtoNames: true, - }.Marshal(cfg) - if err != nil { - return nil, err - } - - data, err = yaml.JSONToYAML(data) - return data, err -} - -func RenderConfig(dbServiceAddress string, redirects ...Redirect) (*bootstrapAPI.Bootstrap, error) { - clusters := []*clusterAPI.Cluster{ - { - Name: "arangodb", - ConnectTimeout: durationpb.New(250 * time.Millisecond), - LbPolicy: clusterAPI.Cluster_ROUND_ROBIN, - LoadAssignment: &endpointAPI.ClusterLoadAssignment{ - ClusterName: "arangodb", - Endpoints: []*endpointAPI.LocalityLbEndpoints{ - { - LbEndpoints: []*endpointAPI.LbEndpoint{ - { - HostIdentifier: &endpointAPI.LbEndpoint_Endpoint{ - Endpoint: &endpointAPI.Endpoint{ - Address: &coreAPI.Address{ - Address: &coreAPI.Address_SocketAddress{ - SocketAddress: &coreAPI.SocketAddress{ - Address: dbServiceAddress, - PortSpecifier: &coreAPI.SocketAddress_PortValue{ - PortValue: shared.ArangoPort, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - - routes := []*routeAPI.Route{ - { - Match: &routeAPI.RouteMatch{ - PathSpecifier: &routeAPI.RouteMatch_Prefix{ - Prefix: "/", - }, - }, - Action: &routeAPI.Route_Route{ - Route: &routeAPI.RouteAction{ - ClusterSpecifier: &routeAPI.RouteAction_Cluster{ - Cluster: "arangodb", - }, - PrefixRewrite: "/", - }, - }, - }, - } - - for id, redirect := range redirects { - var endpoints []*endpointAPI.LbEndpoint - - for _, target := range redirect.V { - req, err := url.Parse(target) - if err != nil { - return nil, err - } - - port, err := strconv.Atoi(req.Port()) - if err != nil { - return nil, err - } - - endpoints = append(endpoints, &endpointAPI.LbEndpoint{ - HostIdentifier: &endpointAPI.LbEndpoint_Endpoint{ - Endpoint: &endpointAPI.Endpoint{ - Address: &coreAPI.Address{ - Address: &coreAPI.Address_SocketAddress{ - SocketAddress: &coreAPI.SocketAddress{ - Address: req.Hostname(), - PortSpecifier: &coreAPI.SocketAddress_PortValue{ - PortValue: uint32(port), - }, - }, - }, - }, - }, - }, - }, - ) - } - - cluster := &clusterAPI.Cluster{ - Name: fmt.Sprintf("cluster_%05d", id), - ConnectTimeout: durationpb.New(250 * time.Millisecond), - LbPolicy: clusterAPI.Cluster_ROUND_ROBIN, - LoadAssignment: &endpointAPI.ClusterLoadAssignment{ - ClusterName: fmt.Sprintf("cluster_%05d", id), - Endpoints: []*endpointAPI.LocalityLbEndpoints{ - { - LbEndpoints: endpoints, - }, - }, - }, - } - - route := &routeAPI.Route{ - Match: &routeAPI.RouteMatch{ - PathSpecifier: &routeAPI.RouteMatch_Prefix{ - Prefix: redirect.K, - }, - }, - Action: &routeAPI.Route_Route{ - Route: &routeAPI.RouteAction{ - ClusterSpecifier: &routeAPI.RouteAction_Cluster{ - Cluster: fmt.Sprintf("cluster_%05d", id), - }, - PrefixRewrite: "/", - }, - }, - } - - clusters = append(clusters, cluster) - routes = append(routes, route) - } - - routes = util.Sort(routes, func(i, j *routeAPI.Route) bool { - return i.Match.GetPrefix() > j.Match.GetPrefix() - }) - - httpFilterConfigType, err := anypb.New(&routerAPI.Router{}) - if err != nil { - return nil, err - } - - filterConfigType, err := anypb.New(&httpConnectionManagerAPI.HttpConnectionManager{ - StatPrefix: "ingress_http", - CodecType: httpConnectionManagerAPI.HttpConnectionManager_AUTO, - RouteSpecifier: &httpConnectionManagerAPI.HttpConnectionManager_RouteConfig{ - RouteConfig: &routeAPI.RouteConfiguration{ - Name: "local_route", - VirtualHosts: []*routeAPI.VirtualHost{ - { - Name: "local_service", - Domains: []string{"*"}, - Routes: routes, - }, - }, - }, - }, - HttpFilters: []*httpConnectionManagerAPI.HttpFilter{ - { - Name: "envoy.filters.http.routerAPI", - ConfigType: &httpConnectionManagerAPI.HttpFilter_TypedConfig{ - TypedConfig: httpFilterConfigType, - }, - }, - }, - }) - if err != nil { - return nil, err - } - - return &bootstrapAPI.Bootstrap{ - Admin: &bootstrapAPI.Admin{ - Address: &coreAPI.Address{ - Address: &coreAPI.Address_SocketAddress{ - SocketAddress: &coreAPI.SocketAddress{ - Address: "127.0.0.1", - PortSpecifier: &coreAPI.SocketAddress_PortValue{PortValue: 9901}, - }, - }, - }, - }, - StaticResources: &bootstrapAPI.Bootstrap_StaticResources{ - Listeners: []*listenerAPI.Listener{ - { - Name: "listener_0", - Address: &coreAPI.Address{ - Address: &coreAPI.Address_SocketAddress{ - SocketAddress: &coreAPI.SocketAddress{ - Address: "0.0.0.0", - PortSpecifier: &coreAPI.SocketAddress_PortValue{PortValue: shared.ArangoPort}, - }, - }, - }, - FilterChains: []*listenerAPI.FilterChain{ - { - Filters: []*listenerAPI.Filter{ - { - Name: "envoy.filters.network.httpConnectionManagerAPI", - ConfigType: &listenerAPI.Filter_TypedConfig{ - TypedConfig: filterConfigType, - }, - }, - }, - }, - }, - }, - }, - Clusters: clusters, - }, - }, nil -} diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index a55157c5b..d70c91874 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -286,10 +286,15 @@ func createArangoSyncArgs(apiObject meta.Object, spec api.DeploymentSpec, group return args } -func createArangoGatewayArgs(groupSpec api.ServerGroupSpec) []string { - args := []string{"--config-path", GatewayConfigFilePath} - if len(groupSpec.Args) > 0 { - args = append(args, groupSpec.Args...) +func createArangoGatewayArgs(input pod.Input, additionalOptions ...k8sutil.OptionPair) []string { + options := k8sutil.CreateOptionPairs(64) + options.Add("--config-path", GatewayConfigFilePath) + + options.Append(additionalOptions...) + + args := options.Sort().AsSplittedArgs() + if len(input.GroupSpec.Args) > 0 { + args = append(args, input.GroupSpec.Args...) } return args @@ -297,7 +302,7 @@ func createArangoGatewayArgs(groupSpec api.ServerGroupSpec) []string { // CreatePodTolerations creates a list of tolerations for a pod created for the given group. func (r *Resources) CreatePodTolerations(group api.ServerGroup, groupSpec api.ServerGroupSpec) []core.Toleration { - return tolerations.MergeTolerationsIfNotFound(tolerations.CreatePodTolerations(r.context.GetMode(), group), groupSpec.GetTolerations()) + return tolerations.MergeTolerationsIfNotFound(CreatePodTolerations(r.context.GetMode(), group), groupSpec.GetTolerations()) } func (r *Resources) RenderPodTemplateForMember(ctx context.Context, acs sutil.ACS, spec api.DeploymentSpec, status api.DeploymentStatus, memberID string, imageInfo api.ImageInfo) (*core.PodTemplateSpec, error) { @@ -395,16 +400,17 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec } podCreator = &MemberGatewayPod{ - podName: podName, - groupSpec: groupSpec, - spec: spec, - group: group, - resources: r, - imageInfo: imageInfo, - arangoMember: *member, - apiObject: apiObject, - memberStatus: m, - cachedStatus: cache, + podName: podName, + status: m, + groupSpec: groupSpec, + spec: spec, + group: group, + resources: r, + imageInfo: imageInfo, + context: r.context, + deploymentStatus: status, + arangoMember: *member, + cachedStatus: cache, } default: return nil, assertion.InvalidGroupKey.Assert(true, "Unable to render pod for an unknown group: %s", group.AsRole()) @@ -687,7 +693,18 @@ func RenderArangoPod(ctx context.Context, cachedStatus inspectorInterface.Inspec PodAffinity: podCreator.GetPodAffinity(), } - return &p, nil + if profiles, err := podCreator.Profiles(); err != nil { + return nil, err + } else if len(profiles) > 0 { + if err := profiles.RenderOnTemplate(&p); err != nil { + return nil, err + } + } + + return &core.Pod{ + ObjectMeta: p.ObjectMeta, + Spec: p.Spec, + }, nil } // CreateArangoPod creates a new Pod with container provided by parameter 'containerCreator' diff --git a/pkg/deployment/resources/pod_creator_arangod.go b/pkg/deployment/resources/pod_creator_arangod.go index 092a53d14..8d5bf4b58 100644 --- a/pkg/deployment/resources/pod_creator_arangod.go +++ b/pkg/deployment/resources/pod_creator_arangod.go @@ -30,6 +30,7 @@ import ( core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" @@ -321,7 +322,7 @@ func (m *MemberArangoDPod) AsInput() pod.Input { } } -func (m *MemberArangoDPod) Init(_ context.Context, _ interfaces.Inspector, pod *core.Pod) error { +func (m *MemberArangoDPod) Init(_ context.Context, _ interfaces.Inspector, pod *core.PodTemplateSpec) error { terminationGracePeriodSeconds := int64(math.Ceil(m.groupSpec.GetTerminationGracePeriod(m.group).Seconds())) pod.Spec.TerminationGracePeriodSeconds = &terminationGracePeriodSeconds pod.Spec.PriorityClassName = m.groupSpec.PriorityClassName @@ -409,7 +410,7 @@ func (m *MemberArangoDPod) GetServiceAccountName() string { return m.groupSpec.GetServiceAccountName() } -func (m *MemberArangoDPod) GetSidecars(pod *core.Pod) error { +func (m *MemberArangoDPod) GetSidecars(pod *core.PodTemplateSpec) error { //nolint:staticcheck if m.spec.Metrics.IsEnabled() && m.spec.Metrics.Mode.Get() != api.MetricsModeInternal { var c *core.Container @@ -595,6 +596,10 @@ func (m *MemberArangoDPod) Annotations() map[string]string { return collection.MergeAnnotations(m.spec.Annotations, m.groupSpec.Annotations) } +func (m *MemberArangoDPod) Profiles() (schedulerApi.ProfileTemplates, error) { + return nil, nil +} + func (m *MemberArangoDPod) Labels() map[string]string { l := collection.ReservedLabels().Filter(collection.MergeAnnotations(m.spec.Labels, m.groupSpec.Labels)) diff --git a/pkg/deployment/resources/pod_creator_gateway.go b/pkg/deployment/resources/pod_creator_gateway.go index 30988305c..993e6f820 100644 --- a/pkg/deployment/resources/pod_creator_gateway.go +++ b/pkg/deployment/resources/pod_creator_gateway.go @@ -21,320 +21,35 @@ package resources import ( - "context" "fmt" - "math" core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/arangodb/kube-arangodb/pkg/util/collection" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" ) const ( - ArangoGatewayExecutor string = "/usr/local/bin/envoy" - GatewayVolumeMountDir = "/etc/gateway/" - GatewayVolumeName = "gateway" - GatewayConfigFileName = "gateway.yaml" - GatewayConfigChecksumName = "gateway.yaml-checksum" - GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName + ArangoGatewayExecutor string = "/usr/local/bin/envoy" + GatewayVolumeMountDir = "/etc/gateway/" + GatewayVolumeName = "gateway" + GatewayConfigFileName = "gateway.yaml" + GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName ) -type ArangoGatewayContainer struct { - groupSpec api.ServerGroupSpec - spec api.DeploymentSpec - group api.ServerGroup - resources *Resources - imageInfo api.ImageInfo - apiObject meta.Object - memberStatus api.MemberStatus - arangoMember api.ArangoMember -} - -var _ interfaces.PodCreator = &MemberGatewayPod{} -var _ interfaces.ContainerCreator = &ArangoGatewayContainer{} - -type MemberGatewayPod struct { - podName string - - groupSpec api.ServerGroupSpec - spec api.DeploymentSpec - group api.ServerGroup - arangoMember api.ArangoMember - resources *Resources - imageInfo api.ImageInfo - apiObject meta.Object - memberStatus api.MemberStatus - cachedStatus interfaces.Inspector -} - func GetGatewayConfigMapName(name string) string { return fmt.Sprintf("%s-gateway", name) } -func (a *ArangoGatewayContainer) GetCommand() ([]string, error) { - cmd := make([]string, 0, 128) - cmd = append(cmd, a.GetExecutor()) - cmd = append(cmd, createArangoGatewayArgs(a.groupSpec)...) - return cmd, nil -} - -func (a *ArangoGatewayContainer) GetName() string { - return shared.ServerContainerName -} - -func (a *ArangoGatewayContainer) GetPorts() []core.ContainerPort { - port := shared.ArangoPort - - return []core.ContainerPort{ - { - Name: shared.ServerContainerName, - ContainerPort: int32(port), - Protocol: core.ProtocolTCP, - }, - } -} - -func (a *ArangoGatewayContainer) GetExecutor() string { - return a.groupSpec.GetEntrypoint(ArangoGatewayExecutor) -} - -func (a *ArangoGatewayContainer) GetSecurityContext() *core.SecurityContext { - return k8sutil.CreateSecurityContext(a.groupSpec.SecurityContext) -} - -func (a *ArangoGatewayContainer) GetProbes() (*core.Probe, *core.Probe, *core.Probe, error) { - var liveness, readiness, startup *core.Probe - - probeLivenessConfig, err := a.resources.getLivenessProbe(a.spec, a.group, a.imageInfo) - if err != nil { - return nil, nil, nil, err - } - - probeReadinessConfig, err := a.resources.getReadinessProbe(a.spec, a.group, a.imageInfo) - if err != nil { - return nil, nil, nil, err - } - - probeStartupConfig, err := a.resources.getReadinessProbe(a.spec, a.group, a.imageInfo) - if err != nil { - return nil, nil, nil, err - } - - if probeLivenessConfig != nil { - liveness = probeLivenessConfig.Create() - } - - if probeReadinessConfig != nil { - readiness = probeReadinessConfig.Create() - } - - if probeStartupConfig != nil { - startup = probeStartupConfig.Create() - } - - return liveness, readiness, startup, nil -} - -func (a *ArangoGatewayContainer) GetResourceRequirements() core.ResourceRequirements { - return kresources.ExtractPodAcceptedResourceRequirement(a.arangoMember.Spec.Overrides.GetResources(&a.groupSpec)) -} - -func (a *ArangoGatewayContainer) GetLifecycle() (*core.Lifecycle, error) { - return k8sutil.NewLifecycleFinalizers() -} - -func (a *ArangoGatewayContainer) GetImagePullPolicy() core.PullPolicy { - return a.spec.GetImagePullPolicy() -} - -func (a *ArangoGatewayContainer) GetImage() string { - return a.imageInfo.Image -} - -func (a *ArangoGatewayContainer) GetEnvs() ([]core.EnvVar, []core.EnvFromSource) { - envs := NewEnvBuilder() - - envs.Add(true, k8sutil.GetLifecycleEnv()...) - - if len(a.groupSpec.Envs) > 0 { - for _, env := range a.groupSpec.Envs { - // Do not override preset envs - envs.Add(false, core.EnvVar{ - Name: env.Name, - Value: env.Value, - }) - } - } - - return envs.GetEnvList(), nil -} - -func (a *ArangoGatewayContainer) GetVolumeMounts() []core.VolumeMount { - return createGatewayVolumes(a.apiObject.GetName()).VolumeMounts() -} - -func (m *MemberGatewayPod) GetName() string { - return m.resources.context.GetAPIObject().GetName() -} - -func (m *MemberGatewayPod) GetRole() string { - return m.group.AsRole() -} - -func (m *MemberGatewayPod) GetImagePullSecrets() []string { - return m.spec.ImagePullSecrets -} - -func (m *MemberGatewayPod) GetPodAntiAffinity() *core.PodAntiAffinity { - a := &core.PodAntiAffinity{} - - pod.AppendPodAntiAffinityDefault(m, a) - - a = kresources.MergePodAntiAffinity(a, m.groupSpec.AntiAffinity) - - return kresources.OptionalPodAntiAffinity(a) -} - -func (m *MemberGatewayPod) GetPodAffinity() *core.PodAffinity { - a := &core.PodAffinity{} - - pod.AppendAffinityWithRole(m, a, api.ServerGroupDBServers.AsRole()) - - a = kresources.MergePodAffinity(a, m.groupSpec.Affinity) - - return kresources.OptionalPodAffinity(a) -} - -func (m *MemberGatewayPod) GetNodeAffinity() *core.NodeAffinity { - a := &core.NodeAffinity{} - - pod.AppendArchSelector(a, m.memberStatus.Architecture.Default(m.spec.Architecture.GetDefault()).AsNodeSelectorRequirement()) - - a = kresources.MergeNodeAffinity(a, m.groupSpec.NodeAffinity) - - return kresources.OptionalNodeAffinity(a) -} - -func (m *MemberGatewayPod) GetNodeSelector() map[string]string { - return m.groupSpec.GetNodeSelector() -} - -func (m *MemberGatewayPod) GetServiceAccountName() string { - return m.groupSpec.GetServiceAccountName() -} - -func (m *MemberGatewayPod) GetSidecars(pod *core.Pod) error { - // A sidecar provided by the user - sidecars := m.groupSpec.GetSidecars() - if len(sidecars) > 0 { - addLifecycleSidecar(m.groupSpec.SidecarCoreNames, sidecars) - pod.Spec.Containers = append(pod.Spec.Containers, sidecars...) - } - - return nil -} - -func (m *MemberGatewayPod) GetVolumes() []core.Volume { - return createGatewayVolumes(m.apiObject.GetName()).Volumes() -} - -func (m *MemberGatewayPod) IsDeploymentMode() bool { - return m.spec.IsDevelopment() -} - -func (m *MemberGatewayPod) GetInitContainers(cachedStatus interfaces.Inspector) ([]core.Container, error) { - var initContainers []core.Container - if c := m.groupSpec.InitContainers.GetContainers(); len(c) > 0 { - initContainers = append(initContainers, c...) - } - - res := kresources.ExtractPodInitContainerAcceptedResourceRequirement(m.GetContainerCreator().GetResourceRequirements()) - - initContainers = applyInitContainersResourceResources(initContainers, res) - initContainers = upscaleInitContainersResourceResources(initContainers, res) - - return initContainers, nil -} - -func (m *MemberGatewayPod) GetFinalizers() []string { - return nil -} - -func (m *MemberGatewayPod) GetTolerations() []core.Toleration { - return m.resources.CreatePodTolerations(m.group, m.groupSpec) -} - -func (m *MemberGatewayPod) GetContainerCreator() interfaces.ContainerCreator { - return &ArangoGatewayContainer{ - groupSpec: m.groupSpec, - spec: m.spec, - group: m.group, - resources: m.resources, - imageInfo: m.imageInfo, - apiObject: m.apiObject, - memberStatus: m.memberStatus, - arangoMember: m.arangoMember, - } -} - -func (m *MemberGatewayPod) GetRestartPolicy() core.RestartPolicy { - if features.RestartPolicyAlways().Enabled() { - return core.RestartPolicyAlways - } - return core.RestartPolicyNever -} - -func (m *MemberGatewayPod) Init(ctx context.Context, cachedStatus interfaces.Inspector, pod *core.Pod) error { - terminationGracePeriodSeconds := int64(math.Ceil(m.groupSpec.GetTerminationGracePeriod(m.group).Seconds())) - pod.Spec.TerminationGracePeriodSeconds = &terminationGracePeriodSeconds - pod.Spec.PriorityClassName = m.groupSpec.PriorityClassName - - return nil -} - -func (m *MemberGatewayPod) Validate(_ interfaces.Inspector) error { - if err := validateSidecars(m.groupSpec.SidecarCoreNames, m.groupSpec.GetSidecars()); err != nil { - return err - } - - return nil -} - -func (m *MemberGatewayPod) ApplyPodSpec(spec *core.PodSpec) error { - if s := m.groupSpec.SchedulerName; s != nil { - spec.SchedulerName = *s - } - - m.groupSpec.PodModes.Apply(spec) - - return nil -} - -func (m *MemberGatewayPod) Annotations() map[string]string { - return collection.MergeAnnotations(m.spec.Annotations, m.groupSpec.Annotations) -} - -func (m *MemberGatewayPod) Labels() map[string]string { - return collection.ReservedLabels().Filter(collection.MergeAnnotations(m.spec.Labels, m.groupSpec.Labels)) -} - -func createGatewayVolumes(memberName string) pod.Volumes { +func createGatewayVolumes(input pod.Input) pod.Volumes { volumes := pod.NewVolumes() - volumes.AddVolume(k8sutil.LifecycleVolume()) - volumes.AddVolumeMount(k8sutil.LifecycleVolumeMount()) - - volumes.AddVolume(k8sutil.CreateVolumeWithConfigMap(GatewayVolumeName, GetGatewayConfigMapName(memberName))) + volumes.AddVolume(k8sutil.CreateVolumeWithConfigMap(GatewayVolumeName, GetGatewayConfigMapName(input.ApiObject.GetName()))) volumes.AddVolumeMount(GatewayVolumeMount()) + // TLS + volumes.Append(pod.TLS(), input) + return volumes } diff --git a/pkg/deployment/resources/pod_creator_gateway_container.go b/pkg/deployment/resources/pod_creator_gateway_container.go new file mode 100644 index 000000000..6510b4e72 --- /dev/null +++ b/pkg/deployment/resources/pod_creator_gateway_container.go @@ -0,0 +1,149 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" + kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" +) + +var _ interfaces.ContainerCreator = &ArangoGatewayContainer{} + +type ArangoGatewayContainer struct { + member *MemberGatewayPod + resources *Resources + groupSpec api.ServerGroupSpec + spec api.DeploymentSpec + group api.ServerGroup + arangoMember api.ArangoMember + imageInfo api.ImageInfo + cachedStatus interfaces.Inspector + input pod.Input + status api.MemberStatus +} + +func (a *ArangoGatewayContainer) GetCommand() ([]string, error) { + cmd := make([]string, 0, 128) + cmd = append(cmd, a.GetExecutor()) + cmd = append(cmd, createArangoGatewayArgs(a.input)...) + return cmd, nil +} + +func (a *ArangoGatewayContainer) GetName() string { + return shared.ServerContainerName +} + +func (a *ArangoGatewayContainer) GetPorts() []core.ContainerPort { + port := shared.ArangoPort + + return []core.ContainerPort{ + { + Name: shared.ServerContainerName, + ContainerPort: int32(port), + Protocol: core.ProtocolTCP, + }, + } +} + +func (a *ArangoGatewayContainer) GetExecutor() string { + return a.groupSpec.GetEntrypoint(ArangoGatewayExecutor) +} + +func (a *ArangoGatewayContainer) GetSecurityContext() *core.SecurityContext { + return k8sutil.CreateSecurityContext(a.groupSpec.SecurityContext) +} + +func (a *ArangoGatewayContainer) GetProbes() (*core.Probe, *core.Probe, *core.Probe, error) { + var liveness, readiness, startup *core.Probe + + probeLivenessConfig, err := a.resources.getLivenessProbe(a.spec, a.group, a.imageInfo) + if err != nil { + return nil, nil, nil, err + } + + probeReadinessConfig, err := a.resources.getReadinessProbe(a.spec, a.group, a.imageInfo) + if err != nil { + return nil, nil, nil, err + } + + probeStartupConfig, err := a.resources.getReadinessProbe(a.spec, a.group, a.imageInfo) + if err != nil { + return nil, nil, nil, err + } + + if probeLivenessConfig != nil { + liveness = probeLivenessConfig.Create() + } + + if probeReadinessConfig != nil { + readiness = probeReadinessConfig.Create() + } + + if probeStartupConfig != nil { + startup = probeStartupConfig.Create() + } + + return liveness, readiness, startup, nil +} + +func (a *ArangoGatewayContainer) GetResourceRequirements() core.ResourceRequirements { + return kresources.ExtractPodAcceptedResourceRequirement(a.arangoMember.Spec.Overrides.GetResources(&a.groupSpec)) +} + +func (a *ArangoGatewayContainer) GetLifecycle() (*core.Lifecycle, error) { + return k8sutil.NewLifecycleFinalizers() +} + +func (a *ArangoGatewayContainer) GetImagePullPolicy() core.PullPolicy { + return a.spec.GetImagePullPolicy() +} + +func (a *ArangoGatewayContainer) GetImage() string { + return a.imageInfo.Image +} + +func (a *ArangoGatewayContainer) GetEnvs() ([]core.EnvVar, []core.EnvFromSource) { + envs := NewEnvBuilder() + + envs.Add(true, k8sutil.GetLifecycleEnv()...) + + if len(a.groupSpec.Envs) > 0 { + for _, env := range a.groupSpec.Envs { + // Do not override preset envs + envs.Add(false, core.EnvVar{ + Name: env.Name, + Value: env.Value, + }) + } + } + + return envs.GetEnvList(), nil +} + +func (a *ArangoGatewayContainer) GetVolumeMounts() []core.VolumeMount { + return createGatewayVolumes(a.input).VolumeMounts() +} diff --git a/pkg/deployment/resources/pod_creator_gateway_pod.go b/pkg/deployment/resources/pod_creator_gateway_pod.go new file mode 100644 index 000000000..75daaaf92 --- /dev/null +++ b/pkg/deployment/resources/pod_creator_gateway_pod.go @@ -0,0 +1,242 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "context" + "fmt" + "math" + + core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/integrations/sidecar" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/collection" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" + kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" +) + +var _ interfaces.PodCreator = &MemberGatewayPod{} + +type MemberGatewayPod struct { + podName string + status api.MemberStatus + groupSpec api.ServerGroupSpec + spec api.DeploymentSpec + deploymentStatus api.DeploymentStatus + group api.ServerGroup + arangoMember api.ArangoMember + context Context + resources *Resources + imageInfo api.ImageInfo + cachedStatus interfaces.Inspector +} + +func (m *MemberGatewayPod) GetName() string { + return m.resources.context.GetAPIObject().GetName() +} + +func (m *MemberGatewayPod) GetRole() string { + return m.group.AsRole() +} + +func (m *MemberGatewayPod) GetImagePullSecrets() []string { + return m.spec.ImagePullSecrets +} + +func (m *MemberGatewayPod) GetPodAntiAffinity() *core.PodAntiAffinity { + a := &core.PodAntiAffinity{} + + pod.AppendPodAntiAffinityDefault(m, a) + + a = kresources.MergePodAntiAffinity(a, m.groupSpec.AntiAffinity) + + return kresources.OptionalPodAntiAffinity(a) +} + +func (m *MemberGatewayPod) AsInput() pod.Input { + return pod.Input{ + ApiObject: m.context.GetAPIObject(), + Deployment: m.spec, + Status: m.deploymentStatus, + Group: m.group, + GroupSpec: m.groupSpec, + Version: m.imageInfo.ArangoDBVersion, + Enterprise: m.imageInfo.Enterprise, + Member: m.status, + ArangoMember: m.arangoMember, + } +} + +func (m *MemberGatewayPod) GetPodAffinity() *core.PodAffinity { + a := &core.PodAffinity{} + + pod.AppendAffinityWithRole(m, a, api.ServerGroupDBServers.AsRole()) + + a = kresources.MergePodAffinity(a, m.groupSpec.Affinity) + + return kresources.OptionalPodAffinity(a) +} + +func (m *MemberGatewayPod) GetNodeAffinity() *core.NodeAffinity { + a := &core.NodeAffinity{} + + pod.AppendArchSelector(a, m.status.Architecture.Default(m.spec.Architecture.GetDefault()).AsNodeSelectorRequirement()) + + a = kresources.MergeNodeAffinity(a, m.groupSpec.NodeAffinity) + + return kresources.OptionalNodeAffinity(a) +} + +func (m *MemberGatewayPod) GetNodeSelector() map[string]string { + return m.groupSpec.GetNodeSelector() +} + +func (m *MemberGatewayPod) GetServiceAccountName() string { + return m.groupSpec.GetServiceAccountName() +} + +func (m *MemberGatewayPod) GetSidecars(pod *core.PodTemplateSpec) error { + // A sidecar provided by the user + sidecars := m.groupSpec.GetSidecars() + if len(sidecars) > 0 { + addLifecycleSidecar(m.groupSpec.SidecarCoreNames, sidecars) + pod.Spec.Containers = append(pod.Spec.Containers, sidecars...) + } + + return nil +} + +func (m *MemberGatewayPod) GetVolumes() []core.Volume { + return createGatewayVolumes(m.AsInput()).Volumes() +} + +func (m *MemberGatewayPod) IsDeploymentMode() bool { + return m.spec.IsDevelopment() +} + +func (m *MemberGatewayPod) GetInitContainers(cachedStatus interfaces.Inspector) ([]core.Container, error) { + var initContainers []core.Container + if c := m.groupSpec.InitContainers.GetContainers(); len(c) > 0 { + initContainers = append(initContainers, c...) + } + + res := kresources.ExtractPodInitContainerAcceptedResourceRequirement(m.GetContainerCreator().GetResourceRequirements()) + + initContainers = applyInitContainersResourceResources(initContainers, res) + initContainers = upscaleInitContainersResourceResources(initContainers, res) + + return initContainers, nil +} + +func (m *MemberGatewayPod) GetFinalizers() []string { + return nil +} + +func (m *MemberGatewayPod) GetTolerations() []core.Toleration { + return m.resources.CreatePodTolerations(m.group, m.groupSpec) +} + +func (m *MemberGatewayPod) GetContainerCreator() interfaces.ContainerCreator { + return &ArangoGatewayContainer{ + member: m, + spec: m.spec, + group: m.group, + resources: m.resources, + imageInfo: m.imageInfo, + groupSpec: m.groupSpec, + arangoMember: m.arangoMember, + cachedStatus: m.cachedStatus, + input: m.AsInput(), + status: m.status, + } +} + +func (m *MemberGatewayPod) GetRestartPolicy() core.RestartPolicy { + if features.RestartPolicyAlways().Enabled() { + return core.RestartPolicyAlways + } + return core.RestartPolicyNever +} + +func (m *MemberGatewayPod) Init(ctx context.Context, cachedStatus interfaces.Inspector, pod *core.PodTemplateSpec) error { + terminationGracePeriodSeconds := int64(math.Ceil(m.groupSpec.GetTerminationGracePeriod(m.group).Seconds())) + pod.Spec.TerminationGracePeriodSeconds = &terminationGracePeriodSeconds + pod.Spec.PriorityClassName = m.groupSpec.PriorityClassName + + return nil +} + +func (m *MemberGatewayPod) Validate(_ interfaces.Inspector) error { + if err := validateSidecars(m.groupSpec.SidecarCoreNames, m.groupSpec.GetSidecars()); err != nil { + return err + } + + return nil +} + +func (m *MemberGatewayPod) ApplyPodSpec(spec *core.PodSpec) error { + if s := m.groupSpec.SchedulerName; s != nil { + spec.SchedulerName = *s + } + + m.groupSpec.PodModes.Apply(spec) + + return nil +} + +func (m *MemberGatewayPod) Annotations() map[string]string { + return collection.MergeAnnotations(m.spec.Annotations, m.groupSpec.Annotations) +} + +func (m *MemberGatewayPod) Labels() map[string]string { + l := collection.ReservedLabels().Filter(collection.MergeAnnotations(m.spec.Labels, m.groupSpec.Labels)) + + if m.status.Topology != nil && m.deploymentStatus.Topology.Enabled() && m.deploymentStatus.Topology.ID == m.status.Topology.ID { + if l == nil { + l = map[string]string{} + } + + l[k8sutil.LabelKeyArangoZone] = fmt.Sprintf("%d", m.status.Topology.Zone) + l[k8sutil.LabelKeyArangoTopology] = string(m.status.Topology.ID) + } + + return l +} + +func (m *MemberGatewayPod) Profiles() (schedulerApi.ProfileTemplates, error) { + integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ + Image: util.NewType(m.resources.context.GetOperatorImage()), + }, m.spec.Gateway.GetSidecar(), []string{shared.ServerContainerName}) + + if err != nil { + return nil, err + } + + return []*schedulerApi.ProfileTemplate{integration}, nil +} diff --git a/pkg/deployment/resources/pod_creator_sync.go b/pkg/deployment/resources/pod_creator_sync.go index eeeecb137..fa7b5bb44 100644 --- a/pkg/deployment/resources/pod_creator_sync.go +++ b/pkg/deployment/resources/pod_creator_sync.go @@ -32,6 +32,7 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" @@ -266,7 +267,7 @@ func (m *MemberSyncPod) GetServiceAccountName() string { return m.groupSpec.GetServiceAccountName() } -func (m *MemberSyncPod) GetSidecars(pod *core.Pod) error { +func (m *MemberSyncPod) GetSidecars(pod *core.PodTemplateSpec) error { // A sidecar provided by the user sidecars := m.groupSpec.GetSidecars() if len(sidecars) > 0 { @@ -350,7 +351,7 @@ func (m *MemberSyncPod) GetRestartPolicy() core.RestartPolicy { } // Init initializes the arangosync pod. -func (m *MemberSyncPod) Init(ctx context.Context, cachedStatus interfaces.Inspector, pod *core.Pod) error { +func (m *MemberSyncPod) Init(ctx context.Context, cachedStatus interfaces.Inspector, pod *core.PodTemplateSpec) error { terminationGracePeriodSeconds := int64(math.Ceil(m.groupSpec.GetTerminationGracePeriod(m.group).Seconds())) pod.Spec.TerminationGracePeriodSeconds = &terminationGracePeriodSeconds pod.Spec.PriorityClassName = m.groupSpec.PriorityClassName @@ -517,3 +518,7 @@ func (m *MemberSyncPod) syncHostAlias() *core.HostAlias { return &alias } + +func (m *MemberSyncPod) Profiles() (schedulerApi.ProfileTemplates, error) { + return nil, nil +} diff --git a/pkg/deployment/resources/pod_creator_tolerations.go b/pkg/deployment/resources/pod_creator_tolerations.go new file mode 100644 index 000000000..422d1af78 --- /dev/null +++ b/pkg/deployment/resources/pod_creator_tolerations.go @@ -0,0 +1,68 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "time" + + core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tolerations" +) + +// CreatePodTolerations creates a list of tolerations for a pod created for the given group. +func CreatePodTolerations(mode api.DeploymentMode, group api.ServerGroup) []core.Toleration { + notReadyDur := tolerations.TolerationDuration{Forever: false, TimeSpan: time.Minute} + unreachableDur := tolerations.TolerationDuration{Forever: false, TimeSpan: time.Minute} + switch group { + case api.ServerGroupAgents: + notReadyDur.Forever = true + unreachableDur.Forever = true + case api.ServerGroupCoordinators: + notReadyDur.TimeSpan = 15 * time.Second + unreachableDur.TimeSpan = 15 * time.Second + case api.ServerGroupDBServers: + notReadyDur.TimeSpan = 5 * time.Minute + unreachableDur.TimeSpan = 5 * time.Minute + case api.ServerGroupSingle: + if mode == api.DeploymentModeSingle { + notReadyDur.Forever = true + unreachableDur.Forever = true + } else { + notReadyDur.TimeSpan = 5 * time.Minute + unreachableDur.TimeSpan = 5 * time.Minute + } + case api.ServerGroupSyncMasters: + notReadyDur.TimeSpan = 15 * time.Second + unreachableDur.TimeSpan = 15 * time.Second + case api.ServerGroupSyncWorkers: + notReadyDur.TimeSpan = 1 * time.Minute + unreachableDur.TimeSpan = 1 * time.Minute + case api.ServerGroupGateways: + notReadyDur.TimeSpan = 15 * time.Second + unreachableDur.TimeSpan = 15 * time.Second + } + return []core.Toleration{tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeNotReady, notReadyDur), + tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeUnreachable, unreachableDur), + tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeAlphaUnreachable, unreachableDur), + } +} diff --git a/pkg/deployment/resources/pod_leader.go b/pkg/deployment/resources/pod_leader.go index 6be14bd8a..e72120d28 100644 --- a/pkg/deployment/resources/pod_leader.go +++ b/pkg/deployment/resources/pod_leader.go @@ -125,7 +125,7 @@ func (r *Resources) EnsureLeader(ctx context.Context, cachedStatus inspectorInte selector := k8sutil.LabelsForLeaderMember(deploymentName, group.AsRole(), leaderID) if s, ok := cachedStatus.Service().V1().GetSimple(leaderAgentSvcName); ok { - if c, err := patcher.ServicePatcher(ctx, cachedStatus.ServicesModInterface().V1(), s, meta.PatchOptions{}, patcher.PatchServiceSelector(selector), patcher.PatchServicePorts(ports)); err != nil { + if _, c, err := patcher.Patcher[*core.Service](ctx, cachedStatus.ServicesModInterface().V1(), s, meta.PatchOptions{}, patcher.PatchServiceSelector(selector), patcher.PatchServicePorts(ports)); err != nil { return err } else { if !c { diff --git a/pkg/deployment/resources/secrets.go b/pkg/deployment/resources/secrets.go index f79a7f136..5d6af257e 100644 --- a/pkg/deployment/resources/secrets.go +++ b/pkg/deployment/resources/secrets.go @@ -131,7 +131,7 @@ func (r *Resources) EnsureSecrets(ctx context.Context, cachedStatus inspectorInt if err := reconcileRequired.ParallelAll(len(members), func(id int) error { switch members[id].Group.Type() { - case api.ServerGroupTypeArangoD: + case api.ServerGroupTypeArangoD, api.ServerGroupTypeGateway: memberName := members[id].Member.ArangoMemberName(r.context.GetAPIObject().GetName(), members[id].Group) member, ok := cachedStatus.ArangoMember().V1().GetSimple(memberName) diff --git a/pkg/deployment/resources/services.go b/pkg/deployment/resources/services.go index 869e6b488..a040f6f9b 100644 --- a/pkg/deployment/resources/services.go +++ b/pkg/deployment/resources/services.go @@ -120,7 +120,7 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn continue } else { - if changed, err := patcher.ServicePatcher(ctx, svcs, s, meta.PatchOptions{}, + if _, changed, err := patcher.Patcher[*core.Service](ctx, svcs, s, meta.PatchOptions{}, patcher.PatchServicePorts(ports), patcher.PatchServiceSelector(selector), patcher.PatchServicePublishNotReadyAddresses(true), @@ -176,7 +176,7 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn reconcileRequired.Required() continue } else { - if changed, err := patcher.ServicePatcher(ctx, svcs, s, meta.PatchOptions{}, + if _, changed, err := patcher.Patcher[*core.Service](ctx, svcs, s, meta.PatchOptions{}, patcher.PatchServicePorts(ports), patcher.PatchServiceSelector(selector), patcher.PatchServicePublishNotReadyAddresses(false), @@ -205,7 +205,7 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn log.Str("service", svcName).Debug("Created headless service") } } else { - if changed, err := patcher.ServicePatcher(ctx, svcs, s, meta.PatchOptions{}, patcher.PatchServicePorts(headlessPorts), patcher.PatchServiceSelector(headlessSelector)); err != nil { + if _, changed, err := patcher.Patcher[*core.Service](ctx, svcs, s, meta.PatchOptions{}, patcher.PatchServicePorts(headlessPorts), patcher.PatchServiceSelector(headlessSelector)); err != nil { log.Err(err).Debug("Failed to patch headless service") return errors.WithStack(err) } else if changed { @@ -245,7 +245,7 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn } } } else { - if changed, err := patcher.ServicePatcher(ctx, svcs, s, meta.PatchOptions{}, patcher.PatchServiceOnlyPorts(clientServicePorts...), patcher.PatchServiceSelector(clientServiceSelectors)); err != nil { + if _, changed, err := patcher.Patcher[*core.Service](ctx, svcs, s, meta.PatchOptions{}, patcher.PatchServiceOnlyPorts(clientServicePorts...), patcher.PatchServiceSelector(clientServiceSelectors)); err != nil { log.Err(err).Debug("Failed to patch database client service") return errors.WithStack(err) } else if changed { @@ -380,7 +380,7 @@ func (r *Resources) ensureExternalAccessServices(ctx context.Context, cachedStat } } if !createExternalAccessService && !deleteExternalAccessService { - if changed, err := patcher.ServicePatcher(ctx, svcs, existing, meta.PatchOptions{}, + if _, changed, err := patcher.Patcher[*core.Service](ctx, svcs, existing, meta.PatchOptions{}, patcher.PatchServiceSelector(eaSelector), patcher.Optional(patcher.PatchServiceOnlyPorts(eaPorts...), owned)); err != nil { log.Err(err).Debug("Failed to patch database client service") @@ -434,8 +434,8 @@ func (r *Resources) ensureExternalAccessManagedServices(ctx context.Context, cac log := r.log.Str("section", "service-ea").Str("service", eaServiceName) managedServiceNames := spec.GetManagedServiceNames() - apply := func(svc *core.Service) (bool, error) { - return patcher.ServicePatcher(ctx, cachedStatus.ServicesModInterface().V1(), svc, meta.PatchOptions{}, + apply := func(svc *core.Service) (*core.Service, bool, error) { + return patcher.Patcher[*core.Service](ctx, cachedStatus.ServicesModInterface().V1(), svc, meta.PatchOptions{}, patcher.PatchServiceSelector(selectors)) } @@ -446,7 +446,7 @@ func (r *Resources) ensureExternalAccessManagedServices(ctx context.Context, cac log.Warn("the field \"spec.externalAccess.managedServiceNames\" should be provided for \"managed\" service type") return nil } - } else if changed, err := apply(svc); err != nil { + } else if _, changed, err := apply(svc); err != nil { return errors.WithMessage(err, "failed to ensure service selector") } else if changed { log.Info("selector applied to the managed service \"%s\"", svc.GetName()) @@ -464,7 +464,7 @@ func (r *Resources) ensureExternalAccessManagedServices(ctx context.Context, cac continue } - if changed, err := apply(svc); err != nil { + if _, changed, err := apply(svc); err != nil { return errors.WithMessage(err, "failed to ensure service selector") } else if changed { log.Info("selector applied to the managed service \"%s\"", svcName) diff --git a/pkg/handlers/networking/route/handler_deployment.go b/pkg/handlers/networking/route/handler_deployment.go index 23e16b7fa..86f7faa06 100644 --- a/pkg/handlers/networking/route/handler_deployment.go +++ b/pkg/handlers/networking/route/handler_deployment.go @@ -35,7 +35,7 @@ import ( ) func (h *handler) HandleArangoDeployment(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus) (bool, error) { - var name = util.WithDefault(extension.Spec.DeploymentName) + var name = util.WithDefault(extension.Spec.Deployment) if status.Deployment != nil { name = status.Deployment.GetName() diff --git a/pkg/handlers/networking/route/handler_deployment_test.go b/pkg/handlers/networking/route/handler_deployment_test.go index 53ae7eff5..b79d9f5a2 100644 --- a/pkg/handlers/networking/route/handler_deployment_test.go +++ b/pkg/handlers/networking/route/handler_deployment_test.go @@ -41,7 +41,7 @@ func Test_Handler_Deployment(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -73,7 +73,7 @@ func Test_Handler_MissingDeployment(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment-missing") + obj.Spec.Deployment = util.NewType("deployment-missing") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -105,7 +105,7 @@ func Test_Handler_Deployment_Changed(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ diff --git a/pkg/handlers/networking/route/handler_destination.go b/pkg/handlers/networking/route/handler_destination.go index 0d646a859..80806d135 100644 --- a/pkg/handlers/networking/route/handler_destination.go +++ b/pkg/handlers/networking/route/handler_destination.go @@ -35,7 +35,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util" ) -func (h *handler) HandleArangoDestination(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, _ *api.ArangoDeployment) (*operator.Condition, bool, error) { +func (h *handler) HandleArangoDestination(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, deployment *api.ArangoDeployment) (*operator.Condition, bool, error) { if dest := extension.Spec.GetDestination(); dest != nil { if svc := dest.GetService(); svc != nil { port := svc.Port @@ -117,30 +117,56 @@ func (h *handler) HandleArangoDestination(ctx context.Context, item operation.It }, false, nil } - var targets = networkingApi.ArangoRouteStatusTargets{ - networkingApi.ArangoRouteStatusTarget{ - Url: fmt.Sprintf("%s://%s.%s.svc:%d%s", dest.GetSchema().String(), s.GetName(), s.GetNamespace(), destPort, extension.Spec.GetRoute().GetPath()), - TLS: networkingApi.ArangoRouteStatusTargetTLS{ - Insecure: extension.Spec.Destination.GetTLS().GetInsecure(), + var target networkingApi.ArangoRouteStatusTarget + + target.Path = dest.GetPath() + + if dest.Schema.Get() == networkingApi.ArangoRouteSpecDestinationSchemaHTTPS { + target.TLS = &networkingApi.ArangoRouteStatusTargetTLS{ + Insecure: util.NewType(extension.Spec.Destination.GetTLS().GetInsecure()), + } + } + + if ip := s.Spec.ClusterIP; ip != "" { + target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ + networkingApi.ArangoRouteStatusTargetDestination{ + Host: ip, + Port: destPort, }, - }, + } + } else { + if domain := deployment.Spec.ClusterDomain; domain != nil { + target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ + networkingApi.ArangoRouteStatusTargetDestination{ + Host: fmt.Sprintf("%s.%s.svc.%s", s.GetName(), s.GetNamespace(), *domain), + Port: destPort, + }, + } + } else { + target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ + networkingApi.ArangoRouteStatusTargetDestination{ + Host: fmt.Sprintf("%s.%s.svc", s.GetName(), s.GetNamespace()), + Port: destPort, + }, + } + } } - if status.Targets.Hash() == targets.Hash() { + if status.Target.Hash() == target.Hash() { return &operator.Condition{ Status: true, Reason: "Destination Found", Message: "Destination Found", - Hash: targets.Hash(), + Hash: target.Hash(), }, false, nil } - status.Targets = targets + status.Target = &target return &operator.Condition{ Status: true, Reason: "Destination Found", Message: "Destination Found", - Hash: targets.Hash(), + Hash: target.Hash(), }, true, nil } } @@ -154,8 +180,8 @@ func (h *handler) HandleArangoDestination(ctx context.Context, item operation.It func (h *handler) HandleArangoDestinationWithTargets(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, depl *api.ArangoDeployment) (*operator.Condition, bool, error) { c, changed, err := h.HandleArangoDestination(ctx, item, extension, status, depl) - if c == nil && !c.Status && status.Targets != nil { - status.Targets = nil + if c == nil && !c.Status && status.Target != nil { + status.Target = nil changed = true } diff --git a/pkg/handlers/networking/route/handler_destination_test.go b/pkg/handlers/networking/route/handler_destination_test.go index 81ff36452..e53cd0f7f 100644 --- a/pkg/handlers/networking/route/handler_destination_test.go +++ b/pkg/handlers/networking/route/handler_destination_test.go @@ -42,7 +42,7 @@ func Test_Handler_Destination_Service_Missing(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -81,7 +81,7 @@ func Test_Handler_Destination_Service_Valid(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -114,11 +114,117 @@ func Test_Handler_Destination_Service_Valid(t *testing.T) { require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://deployment.fake.svc:10244/", extension.Status.Target.RenderURLs()[0]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Service_Valid_WithIP(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + obj.Spec.ClusterIP = "127.0.0.2" + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://127.0.0.2:10244/", extension.Status.Target.RenderURLs()[0]) + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) require.True(t, ok) require.EqualValues(t, c.Reason, "Destination Found") require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Service_Valid_WithPath(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + Path: util.NewType("/test/path/"), + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + obj.Spec.ClusterIP = "127.0.0.2" + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://127.0.0.2:10244/test/path/", extension.Status.Target.RenderURLs()[0]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) } func Test_Handler_Destination_Service_ValidName(t *testing.T) { @@ -128,7 +234,7 @@ func Test_Handler_Destination_Service_ValidName(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -170,7 +276,7 @@ func Test_Handler_Destination_Service_ValidName(t *testing.T) { require.True(t, ok) require.EqualValues(t, c.Reason, "Destination Found") require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) } func Test_Handler_Destination_Service_WrongPort(t *testing.T) { @@ -180,7 +286,7 @@ func Test_Handler_Destination_Service_WrongPort(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -226,7 +332,7 @@ func Test_Handler_Destination_Service_WrongPortName(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -272,7 +378,7 @@ func Test_Handler_Destination_Service_Insecure_Default(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -309,10 +415,9 @@ func Test_Handler_Destination_Service_Insecure_Default(t *testing.T) { require.True(t, ok) require.EqualValues(t, c.Reason, "Destination Found") require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) - require.Len(t, extension.Status.Targets, 1) - require.False(t, extension.Status.Targets[0].TLS.Insecure) + require.False(t, extension.Status.Target.TLS.IsInsecure()) } func Test_Handler_Destination_Service_Insecure_Nil(t *testing.T) { @@ -322,7 +427,7 @@ func Test_Handler_Destination_Service_Insecure_Nil(t *testing.T) { // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -362,20 +467,72 @@ func Test_Handler_Destination_Service_Insecure_Nil(t *testing.T) { require.True(t, ok) require.EqualValues(t, c.Reason, "Destination Found") require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) + + require.False(t, extension.Status.Target.TLS.IsInsecure()) +} + +func Test_Handler_Destination_Service_Insecure_HTTPS_Override(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ + Insecure: util.NewType(true), + }, + Schema: util.NewType(networkingApi.ArangoRouteSpecDestinationSchemaHTTPS), + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) - require.Len(t, extension.Status.Targets, 1) - require.False(t, extension.Status.Targets[0].TLS.Insecure) + require.True(t, extension.Status.Target.TLS.IsInsecure()) } -func Test_Handler_Destination_Service_Insecure_Override(t *testing.T) { +func Test_Handler_Destination_Service_Insecure_HTTP_Override(t *testing.T) { // Setup handler := newFakeHandler() // Arrange extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.DeploymentName = util.NewType("deployment") + obj.Spec.Deployment = util.NewType("deployment") }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ @@ -388,6 +545,7 @@ func Test_Handler_Destination_Service_Insecure_Override(t *testing.T) { TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ Insecure: util.NewType(true), }, + Schema: util.NewType(networkingApi.ArangoRouteSpecDestinationSchemaHTTP), } }) deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") @@ -415,8 +573,7 @@ func Test_Handler_Destination_Service_Insecure_Override(t *testing.T) { require.True(t, ok) require.EqualValues(t, c.Reason, "Destination Found") require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Targets.Hash()) + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) - require.Len(t, extension.Status.Targets, 1) - require.True(t, extension.Status.Targets[0].TLS.Insecure) + require.False(t, extension.Status.Target.TLS.IsInsecure()) } diff --git a/pkg/integrations/sidecar/core.go b/pkg/integrations/sidecar/core.go new file mode 100644 index 000000000..fc61f232b --- /dev/null +++ b/pkg/integrations/sidecar/core.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package sidecar + +import ( + "fmt" + "strings" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +type Core struct { + Internal *bool + External *bool +} + +func (c *Core) GetInternal() bool { + if c == nil || c.Internal == nil { + return true + } + + return *c.Internal +} + +func (c *Core) GetExternal() bool { + if c == nil || c.External == nil { + return false + } + + return *c.External +} + +func (c *Core) Args(int Integration) k8sutil.OptionPairs { + var options k8sutil.OptionPairs + name, ver := int.Name() + + options.Add(fmt.Sprintf("--integration.%s.%s.internal", strings.ToLower(name), strings.ToLower(ver)), c.GetInternal()) + options.Add(fmt.Sprintf("--integration.%s.%s.external", strings.ToLower(name), strings.ToLower(ver)), c.GetExternal()) + + return options +} diff --git a/pkg/integrations/sidecar/integration.authentication.v1.go b/pkg/integrations/sidecar/integration.authentication.v1.go new file mode 100644 index 000000000..7fc742fa6 --- /dev/null +++ b/pkg/integrations/sidecar/integration.authentication.v1.go @@ -0,0 +1,85 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package sidecar + +import ( + core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +var _ IntegrationVolumes = IntegrationAuthenticationV1{} + +type IntegrationAuthenticationV1 struct { + Core *Core + Deployment *api.ArangoDeployment +} + +func (i IntegrationAuthenticationV1) Name() (string, string) { + return "AUTHENTICATION", "V1" +} + +func (i IntegrationAuthenticationV1) Validate() error { + if i.Deployment == nil { + return errors.Errorf("Deployment is nil") + } + + return nil +} + +func (i IntegrationAuthenticationV1) Args() (k8sutil.OptionPairs, error) { + options := k8sutil.CreateOptionPairs() + + options.Add("--integration.authentication.v1", true) + options.Add("--integration.authentication.v1.enabled", i.Deployment.GetAcceptedSpec().IsAuthenticated()) + options.Add("--integration.authentication.v1.path", shared.ClusterJWTSecretVolumeMountDir) + + options.Merge(i.Core.Args(i)) + + return options, nil +} + +func (i IntegrationAuthenticationV1) Volumes() ([]core.Volume, []core.VolumeMount, error) { + if i.Deployment.GetAcceptedSpec().IsAuthenticated() { + return []core.Volume{ + { + Name: shared.ClusterJWTSecretVolumeName, + VolumeSource: core.VolumeSource{ + Secret: &core.SecretVolumeSource{ + SecretName: pod.JWTSecretFolder(i.Deployment.GetName()), + }, + }, + }, + }, []core.VolumeMount{ + { + Name: shared.ClusterJWTSecretVolumeName, + ReadOnly: true, + MountPath: shared.ClusterJWTSecretVolumeMountDir, + }, + }, nil + } + + return nil, nil, nil +} diff --git a/pkg/integrations/sidecar/integration.authorization.v1.go b/pkg/integrations/sidecar/integration.authorization.v1.go new file mode 100644 index 000000000..76fbe8b67 --- /dev/null +++ b/pkg/integrations/sidecar/integration.authorization.v1.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package sidecar + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +type IntegrationAuthorizationV0 struct { + Core *Core +} + +func (i IntegrationAuthorizationV0) Name() (string, string) { + return "AUTHORIZATION", "V0" +} + +func (i IntegrationAuthorizationV0) Validate() error { + return nil +} + +func (i IntegrationAuthorizationV0) Args() (k8sutil.OptionPairs, error) { + options := k8sutil.CreateOptionPairs() + + options.Add("--integration.authorization.v0", true) + + options.Merge(i.Core.Args(i)) + + return options, nil +} diff --git a/pkg/integrations/sidecar/integration.envoy.v3.go b/pkg/integrations/sidecar/integration.envoy.v3.go new file mode 100644 index 000000000..08f626871 --- /dev/null +++ b/pkg/integrations/sidecar/integration.envoy.v3.go @@ -0,0 +1,57 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package sidecar + +import ( + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +type IntegrationEnvoyV3 struct { + Core *Core + Deployment *api.ArangoDeployment +} + +func (i IntegrationEnvoyV3) Name() (string, string) { + return "ENVOY", "V3" +} + +func (i IntegrationEnvoyV3) Validate() error { + if i.Deployment == nil { + return errors.Errorf("Deployment is nil") + } + + return nil +} + +func (i IntegrationEnvoyV3) Args() (k8sutil.OptionPairs, error) { + options := k8sutil.CreateOptionPairs() + + options.Add("--integration.authentication.v1", true) + options.Add("--integration.authentication.v1.enabled", i.Deployment.GetAcceptedSpec().IsAuthenticated()) + options.Add("--integration.authentication.v1.path", shared.ClusterJWTSecretVolumeMountDir) + + options.Merge(i.Core.Args(i)) + + return options, nil +} diff --git a/pkg/integrations/sidecar/integration.go b/pkg/integrations/sidecar/integration.go new file mode 100644 index 000000000..53146ff0e --- /dev/null +++ b/pkg/integrations/sidecar/integration.go @@ -0,0 +1,211 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany + +package sidecar + +import ( + "fmt" + "strings" + + core "k8s.io/api/core/v1" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" + schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources" + schedulerPodApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" + schedulerPodResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod/resources" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +const ( + ContainerName = "integration" + ListenPortName = "integration" + ListenPortHealthName = "health" +) + +func WithIntegrationEnvs(in Integration) ([]core.EnvVar, error) { + if v, ok := in.(IntegrationEnvs); ok { + return v.Envs() + } + + return nil, nil +} + +type IntegrationEnvs interface { + Integration + Envs() ([]core.EnvVar, error) +} + +func WithIntegrationVolumes(in Integration) ([]core.Volume, []core.VolumeMount, error) { + if v, ok := in.(IntegrationVolumes); ok { + return v.Volumes() + } + + return nil, nil, nil +} + +type IntegrationVolumes interface { + Integration + Volumes() ([]core.Volume, []core.VolumeMount, error) +} + +type Integration interface { + Name() (string, string) + Args() (k8sutil.OptionPairs, error) + Validate() error +} + +func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *schedulerApi.IntegrationSidecar, coreContainers []string, integrations ...Integration) (*schedulerApi.ProfileTemplate, error) { + for _, integration := range integrations { + if err := integration.Validate(); err != nil { + name, version := integration.Name() + + return nil, errors.Wrapf(err, "Failure in %s/%s", name, version) + } + } + + // Arguments + + exePath := k8sutil.BinaryPath() + lifecycle, err := k8sutil.NewLifecycleFinalizersWithBinary(exePath) + if err != nil { + return nil, errors.Wrapf(err, "NewLifecycleFinalizers failed") + } + + options := k8sutil.CreateOptionPairs(64) + + options.Addf("--services.address", "127.0.0.1:%d", integration.GetListenPort()) + options.Addf("--health.address", "0.0.0.0:%d", integration.GetControllerListenPort()) + + // Volumes + var volumes []core.Volume + var volumeMounts []core.VolumeMount + + // Envs + + var envs = []core.EnvVar{ + { + Name: "INTEGRATION_API_ADDRESS", + Value: fmt.Sprintf("127.0.0.1:%d", integration.GetListenPort()), + }, + { + Name: "INTEGRATION_SERVICE_ADDRESS", + Value: fmt.Sprintf("127.0.0.1:%d", integration.GetListenPort()), + }, + } + + for _, i := range integrations { + name, version := i.Name() + + if err := i.Validate(); err != nil { + return nil, errors.Wrapf(err, "Failure in %s/%s", name, version) + } + + if args, err := i.Args(); err != nil { + return nil, errors.Wrapf(err, "Failure in arguments %s/%s", name, version) + } else if len(args) > 0 { + options.Merge(args) + } + + if lvolumes, lvolumeMounts, err := WithIntegrationVolumes(i); err != nil { + return nil, errors.Wrapf(err, "Failure in volumes %s/%s", name, version) + } else if len(lvolumes) > 0 || len(lvolumeMounts) > 0 { + volumes = append(volumes, lvolumes...) + volumeMounts = append(volumeMounts, lvolumeMounts...) + } + + if lenvs, err := WithIntegrationEnvs(i); err != nil { + return nil, errors.Wrapf(err, "Failure in envs %s/%s", name, version) + } else if len(lenvs) > 0 { + envs = append(envs, lenvs...) + } + + envs = append(envs, core.EnvVar{ + Name: fmt.Sprintf("INTEGRATION_SERVICE_%s_%s", strings.ToUpper(name), strings.ToUpper(version)), + Value: fmt.Sprintf("127.0.0.1:%d", integration.GetListenPort()), + }) + } + + c := schedulerContainerApi.Container{ + Core: &schedulerContainerResourcesApi.Core{ + Command: append([]string{exePath, "integration"}, options.Sort().AsArgs()...), + }, + Environments: &schedulerContainerResourcesApi.Environments{ + Env: k8sutil.GetLifecycleEnv(), + }, + Networking: &schedulerContainerResourcesApi.Networking{ + Ports: []core.ContainerPort{ + { + Name: ListenPortName, + ContainerPort: int32(integration.GetListenPort()), + Protocol: core.ProtocolTCP, + }, + { + Name: ListenPortHealthName, + ContainerPort: int32(integration.GetControllerListenPort()), + Protocol: core.ProtocolTCP, + }, + }, + }, + Image: image, + + Lifecycle: &schedulerContainerResourcesApi.Lifecycle{ + Lifecycle: lifecycle, + }, + + Probes: &schedulerContainerResourcesApi.Probes{ + ReadinessProbe: &core.Probe{ + ProbeHandler: core.ProbeHandler{ + GRPC: &core.GRPCAction{ + Port: int32(integration.GetControllerListenPort()), + }, + }, + InitialDelaySeconds: 1, // Wait 1s before first probe + TimeoutSeconds: 2, // Timeout of each probe is 2s + PeriodSeconds: 30, // Interval between probes is 30s + SuccessThreshold: 1, // Single probe is enough to indicate success + FailureThreshold: 2, // Need 2 failed probes to consider a failed state + }, + }, + + VolumeMounts: &schedulerContainerResourcesApi.VolumeMounts{ + VolumeMounts: volumeMounts, + }, + } + + pt := schedulerApi.ProfileTemplate{ + Container: &schedulerApi.ProfileContainerTemplate{ + Containers: map[string]schedulerContainerApi.Container{ + ContainerName: util.TypeOrDefault(k8sutil.CreateDefaultContainerTemplate(image).With(&c).With(integration.GetContainer())), + }, + }, + Pod: &schedulerPodApi.Pod{ + Metadata: &schedulerPodResourcesApi.Metadata{ + Annotations: map[string]string{}, + }, + Volumes: &schedulerPodResourcesApi.Volumes{ + Volumes: volumes, + }, + }, + } + + for _, container := range coreContainers { + pt.Pod.Metadata.Annotations[fmt.Sprintf("%s/%s", constants.AnnotationShutdownCoreContainer, container)] = constants.AnnotationShutdownCoreContainerModeWait + } + + pt.Pod.Metadata.Annotations[fmt.Sprintf("%s/%s", constants.AnnotationShutdownContainer, ContainerName)] = ListenPortHealthName + pt.Pod.Metadata.Annotations[constants.AnnotationShutdownManagedContainer] = "true" + + pt.Container.Containers.ExtendContainers(&schedulerContainerApi.Container{ + Environments: &schedulerContainerResourcesApi.Environments{ + Env: envs, + }, + }, coreContainers...) + + return &pt, nil +} diff --git a/pkg/integrations/sidecar/integration.shutdown.v1.go b/pkg/integrations/sidecar/integration.shutdown.v1.go new file mode 100644 index 000000000..f8752c6d2 --- /dev/null +++ b/pkg/integrations/sidecar/integration.shutdown.v1.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package sidecar + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +type IntegrationShutdownV1 struct { + Core *Core +} + +func (i IntegrationShutdownV1) Name() (string, string) { + return "SHUTDOWN", "V1" +} + +func (i IntegrationShutdownV1) Validate() error { + return nil +} + +func (i IntegrationShutdownV1) Args() (k8sutil.OptionPairs, error) { + options := k8sutil.CreateOptionPairs() + + options.Add("--integration.shutdown.v1", true) + + options.Merge(i.Core.Args(i)) + + return options, nil +} diff --git a/pkg/util/dict_test.go b/pkg/util/dict_test.go new file mode 100644 index 000000000..b0f1a3014 --- /dev/null +++ b/pkg/util/dict_test.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package util + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/require" +) + +func testDictDefaultValue[T any](t *testing.T, expected T) { + t.Run(reflect.TypeOf(expected).String(), func(t *testing.T) { + m := map[string]T{} + + ev, ok := m["missing"] + require.False(t, ok) + + require.Equal(t, expected, ev) + + evs := m["missing"] + + require.Equal(t, expected, evs) + }) +} + +func Test_Dict_Types(t *testing.T) { + testDictDefaultValue[string](t, "") + testDictDefaultValue[int](t, 0) + testDictDefaultValue[*string](t, nil) + testDictDefaultValue[*int](t, nil) +} diff --git a/pkg/util/k8sutil/interfaces/pod_creator.go b/pkg/util/k8sutil/interfaces/pod_creator.go index aa28aed45..2bfe75934 100644 --- a/pkg/util/k8sutil/interfaces/pod_creator.go +++ b/pkg/util/k8sutil/interfaces/pod_creator.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import ( core "k8s.io/api/core/v1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" ) @@ -39,11 +40,11 @@ type PodModifier interface { } type PodCreator interface { - Init(context.Context, Inspector, *core.Pod) error + Init(context.Context, Inspector, *core.PodTemplateSpec) error GetName() string GetRole() string GetVolumes() []core.Volume - GetSidecars(*core.Pod) error + GetSidecars(*core.PodTemplateSpec) error GetInitContainers(cachedStatus Inspector) ([]core.Container, error) GetFinalizers() []string GetTolerations() []core.Toleration @@ -61,6 +62,8 @@ type PodCreator interface { Annotations() map[string]string Labels() map[string]string + Profiles() (schedulerApi.ProfileTemplates, error) + PodModifier } diff --git a/pkg/util/k8sutil/pair.go b/pkg/util/k8sutil/pair.go index 576bd17fd..082decd49 100644 --- a/pkg/util/k8sutil/pair.go +++ b/pkg/util/k8sutil/pair.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -148,6 +148,17 @@ func (o OptionPairs) AsArgs() []string { return s } +func (o OptionPairs) AsSplittedArgs() []string { + s := make([]string, len(o)*2) + + for id, pair := range o { + s[id*2] = pair.Key + s[id*2+1] = pair.Value + } + + return s +} + // OptionPair key value pair builder type OptionPair struct { Key string diff --git a/pkg/util/k8sutil/patcher/config_map.go b/pkg/util/k8sutil/patcher/config_map.go new file mode 100644 index 000000000..367929fc3 --- /dev/null +++ b/pkg/util/k8sutil/patcher/config_map.go @@ -0,0 +1,40 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package patcher + +import ( + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/equality" + + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" +) + +func PatchConfigMapData(data map[string]string) Patch[*core.ConfigMap] { + return func(in *core.ConfigMap) []patch.Item { + if len(data) == len(in.Data) && equality.Semantic.DeepDerivative(data, in.Data) { + return nil + } + + return []patch.Item{ + patch.ItemReplace(patch.NewPath("data"), data), + } + } +} diff --git a/pkg/util/k8sutil/patcher/config_map_test.go b/pkg/util/k8sutil/patcher/config_map_test.go new file mode 100644 index 000000000..1f471cb58 --- /dev/null +++ b/pkg/util/k8sutil/patcher/config_map_test.go @@ -0,0 +1,105 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package patcher + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_ConfigMap(t *testing.T) { + c := tests.NewEmptyInspector(t) + + t.Run("Create", func(t *testing.T) { + require.NoError(t, c.Refresh(context.Background())) + + _, err := c.ConfigMapsModInterface().V1().Create(context.Background(), &core.ConfigMap{ + ObjectMeta: meta.ObjectMeta{ + Name: "test", + Namespace: c.Namespace(), + }, + }, meta.CreateOptions{}) + require.NoError(t, err) + }) + + require.NoError(t, c.Refresh(context.Background())) + + t.Run("Check", func(t *testing.T) { + cm, ok := c.ConfigMap().V1().GetSimple("test") + require.True(t, ok) + require.Len(t, cm.Data, 0) + }) + + require.NoError(t, c.Refresh(context.Background())) + + t.Run("Update", func(t *testing.T) { + cm, ok := c.ConfigMap().V1().GetSimple("test") + require.True(t, ok) + uCm, ok, err := Patcher[*core.ConfigMap](context.Background(), c.ConfigMapsModInterface().V1(), cm, meta.PatchOptions{}, PatchConfigMapData(map[string]string{ + "A": "B", + })) + require.NoError(t, err) + require.True(t, ok) + + require.NoError(t, c.Refresh(context.Background())) + + cm, ok = c.ConfigMap().V1().GetSimple("test") + require.True(t, ok) + + require.Equal(t, map[string]string{ + "A": "B", + }, uCm.Data) + + require.Equal(t, map[string]string{ + "A": "B", + }, cm.Data) + }) + + t.Run("Reupdate", func(t *testing.T) { + cm, ok := c.ConfigMap().V1().GetSimple("test") + require.True(t, ok) + + uCm, ok, err := Patcher[*core.ConfigMap](context.Background(), c.ConfigMapsModInterface().V1(), cm, meta.PatchOptions{}, PatchConfigMapData(map[string]string{ + "A": "B", + })) + require.NoError(t, err) + require.False(t, ok) + + require.NoError(t, c.Refresh(context.Background())) + + cm, ok = c.ConfigMap().V1().GetSimple("test") + require.True(t, ok) + + require.Equal(t, map[string]string{ + "A": "B", + }, uCm.Data) + + require.Equal(t, map[string]string{ + "A": "B", + }, cm.Data) + }) +} diff --git a/pkg/util/k8sutil/patcher/patcher.go b/pkg/util/k8sutil/patcher/patcher.go new file mode 100644 index 000000000..41bbd53b7 --- /dev/null +++ b/pkg/util/k8sutil/patcher/patcher.go @@ -0,0 +1,89 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package patcher + +import ( + "context" + "reflect" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/globals" +) + +type Patch[T meta.Object] func(in T) []patch.Item + +type Client[T meta.Object] interface { + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result T, err error) +} + +func Patcher[T meta.Object](ctx context.Context, client Client[T], in T, opts meta.PatchOptions, functions ...Patch[T]) (T, bool, error) { + if v := reflect.ValueOf(in); !v.IsValid() || v.IsZero() { + return util.Default[T](), false, nil + } + + if in.GetName() == "" { + return util.Default[T](), false, nil + } + + var items []patch.Item + + for id := range functions { + if f := functions[id]; f != nil { + items = append(items, f(in)...) + } + } + + if len(items) == 0 { + return in, false, nil + } + + data, err := patch.NewPatch(items...).Marshal() + if err != nil { + return util.Default[T](), false, err + } + + nctx, c := globals.GetGlobals().Timeouts().Kubernetes().WithTimeout(ctx) + defer c() + + if obj, err := client.Patch(nctx, in.GetName(), types.JSONPatchType, data, opts); err != nil { + return util.Default[T](), false, err + } else { + return obj, true, nil + } +} + +func Optional[T meta.Object](p Patch[T], enabled bool) Patch[T] { + return func(in T) []patch.Item { + if !enabled { + return nil + } + + if p != nil { + return p(in) + } + + return nil + } +} diff --git a/pkg/util/k8sutil/patcher/service.go b/pkg/util/k8sutil/patcher/service.go index 274560224..4ac7cddb3 100644 --- a/pkg/util/k8sutil/patcher/service.go +++ b/pkg/util/k8sutil/patcher/service.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,57 +21,13 @@ package patcher import ( - "context" - core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - v1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service/v1" ) -type ServicePatch func(in *core.Service) []patch.Item - -func ServicePatcher(ctx context.Context, client v1.ModInterface, in *core.Service, opts meta.PatchOptions, functions ...ServicePatch) (bool, error) { - if in == nil { - return false, nil - } - - if in.GetName() == "" { - return false, nil - } - - var items []patch.Item - - for id := range functions { - if f := functions[id]; f != nil { - items = append(items, f(in)...) - } - } - - if len(items) == 0 { - return false, nil - } - - data, err := patch.NewPatch(items...).Marshal() - if err != nil { - return false, err - } - - nctx, c := globals.GetGlobals().Timeouts().Kubernetes().WithTimeout(ctx) - defer c() - - if _, err := client.Patch(nctx, in.GetName(), types.JSONPatchType, data, opts); err != nil { - return false, err - } - - return true, nil -} - -func PatchServicePorts(ports []core.ServicePort) ServicePatch { +func PatchServicePorts(ports []core.ServicePort) Patch[*core.Service] { return func(in *core.Service) []patch.Item { if len(ports) == len(in.Spec.Ports) && equality.Semantic.DeepDerivative(ports, in.Spec.Ports) { return nil @@ -83,21 +39,7 @@ func PatchServicePorts(ports []core.ServicePort) ServicePatch { } } -func Optional(p ServicePatch, enabled bool) ServicePatch { - return func(in *core.Service) []patch.Item { - if !enabled { - return nil - } - - if p != nil { - return p(in) - } - - return nil - } -} - -func PatchServiceOnlyPorts(ports ...core.ServicePort) ServicePatch { +func PatchServiceOnlyPorts(ports ...core.ServicePort) Patch[*core.Service] { return func(in *core.Service) []patch.Item { psvc := in.Spec.DeepCopy() cp := psvc.Ports @@ -149,7 +91,7 @@ func PatchServiceOnlyPorts(ports ...core.ServicePort) ServicePatch { } } -func PatchServiceSelector(selector map[string]string) ServicePatch { +func PatchServiceSelector(selector map[string]string) Patch[*core.Service] { return func(in *core.Service) []patch.Item { if in.Spec.Selector != nil && equality.Semantic.DeepEqual(in.Spec.Selector, selector) { return nil @@ -161,7 +103,7 @@ func PatchServiceSelector(selector map[string]string) ServicePatch { } } -func PatchServiceType(t core.ServiceType) ServicePatch { +func PatchServiceType(t core.ServiceType) Patch[*core.Service] { return func(in *core.Service) []patch.Item { if in.Spec.Type == t { return nil @@ -173,7 +115,7 @@ func PatchServiceType(t core.ServiceType) ServicePatch { } } -func PatchServicePublishNotReadyAddresses(publishNotReadyAddresses bool) ServicePatch { +func PatchServicePublishNotReadyAddresses(publishNotReadyAddresses bool) Patch[*core.Service] { return func(in *core.Service) []patch.Item { if in.Spec.PublishNotReadyAddresses == publishNotReadyAddresses { return nil diff --git a/pkg/util/k8sutil/patcher/service_test.go b/pkg/util/k8sutil/patcher/service_test.go index 30c8b22b3..9ca3c1736 100644 --- a/pkg/util/k8sutil/patcher/service_test.go +++ b/pkg/util/k8sutil/patcher/service_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ func Test_Service(t *testing.T) { require.True(t, ok) require.False(t, svc.Spec.PublishNotReadyAddresses) - changed, err := ServicePatcher(context.Background(), c.ServicesModInterface().V1(), svc, meta.PatchOptions{}, PatchServicePublishNotReadyAddresses(true)) + _, changed, err := Patcher[*core.Service](context.Background(), c.ServicesModInterface().V1(), svc, meta.PatchOptions{}, PatchServicePublishNotReadyAddresses(true)) require.NoError(t, err) require.True(t, changed) @@ -69,7 +69,7 @@ func Test_Service(t *testing.T) { require.True(t, ok) require.True(t, svc.Spec.PublishNotReadyAddresses) - changed, err := ServicePatcher(context.Background(), c.ServicesModInterface().V1(), svc, meta.PatchOptions{}, PatchServicePublishNotReadyAddresses(true)) + _, changed, err := Patcher[*core.Service](context.Background(), c.ServicesModInterface().V1(), svc, meta.PatchOptions{}, PatchServicePublishNotReadyAddresses(true)) require.NoError(t, err) require.False(t, changed) @@ -85,7 +85,7 @@ func Test_Service(t *testing.T) { require.True(t, ok) require.True(t, svc.Spec.PublishNotReadyAddresses) - changed, err := ServicePatcher(context.Background(), c.ServicesModInterface().V1(), svc, meta.PatchOptions{}, PatchServicePublishNotReadyAddresses(false)) + _, changed, err := Patcher[*core.Service](context.Background(), c.ServicesModInterface().V1(), svc, meta.PatchOptions{}, PatchServicePublishNotReadyAddresses(false)) require.NoError(t, err) require.True(t, changed) diff --git a/pkg/util/k8sutil/pods.go b/pkg/util/k8sutil/pods.go index 91359295b..5d27339e4 100644 --- a/pkg/util/k8sutil/pods.go +++ b/pkg/util/k8sutil/pods.go @@ -560,10 +560,10 @@ func NewContainer(containerCreator interfaces.ContainerCreator) (core.Container, } // NewPod creates a basic Pod for given settings. -func NewPod(deploymentName, role, id, podName string, podCreator interfaces.PodCreator) core.Pod { +func NewPod(deploymentName, role, id, podName string, podCreator interfaces.PodCreator) core.PodTemplateSpec { hostname := shared.CreatePodHostName(deploymentName, role, id) - p := core.Pod{ + p := core.PodTemplateSpec{ ObjectMeta: meta.ObjectMeta{ Name: podName, Labels: LabelsForMember(deploymentName, role, id), diff --git a/pkg/util/k8sutil/services.go b/pkg/util/k8sutil/services.go index 2d9b84afa..f4cbc065b 100644 --- a/pkg/util/k8sutil/services.go +++ b/pkg/util/k8sutil/services.go @@ -82,7 +82,7 @@ func CreateExporterService(ctx context.Context, cachedStatus inspector.Inspector svcName := CreateExporterClientServiceName(deploymentName) if svc, exists := cachedStatus.Service().V1().GetSimple(svcName); exists { - if changed, err := patcher.ServicePatcher(ctx, cachedStatus.ServicesModInterface().V1(), svc, meta.PatchOptions{}, patcher.PatchServiceSelector(selectors), patcher.PatchServicePorts(ports)); err != nil { + if _, changed, err := patcher.Patcher[*core.Service](ctx, cachedStatus.ServicesModInterface().V1(), svc, meta.PatchOptions{}, patcher.PatchServiceSelector(selectors), patcher.PatchServicePorts(ports)); err != nil { return "", false, err } else { return svcName, changed, nil diff --git a/pkg/util/k8sutil/tolerations/tolerations.go b/pkg/util/k8sutil/tolerations/tolerations.go index e0bfa0656..0cc4cf2f0 100644 --- a/pkg/util/k8sutil/tolerations/tolerations.go +++ b/pkg/util/k8sutil/tolerations/tolerations.go @@ -24,8 +24,6 @@ import ( "time" core "k8s.io/api/core/v1" - - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) const ( @@ -105,41 +103,3 @@ func AddTolerationIfNotFound(source []core.Toleration, toAdd core.Toleration) [] return append(source, toAdd) } - -// CreatePodTolerations creates a list of tolerations for a pod created for the given group. -func CreatePodTolerations(mode api.DeploymentMode, group api.ServerGroup) []core.Toleration { - notReadyDur := TolerationDuration{Forever: false, TimeSpan: time.Minute} - unreachableDur := TolerationDuration{Forever: false, TimeSpan: time.Minute} - switch group { - case api.ServerGroupAgents: - notReadyDur.Forever = true - unreachableDur.Forever = true - case api.ServerGroupCoordinators: - notReadyDur.TimeSpan = 15 * time.Second - unreachableDur.TimeSpan = 15 * time.Second - case api.ServerGroupDBServers: - notReadyDur.TimeSpan = 5 * time.Minute - unreachableDur.TimeSpan = 5 * time.Minute - case api.ServerGroupSingle: - if mode == api.DeploymentModeSingle { - notReadyDur.Forever = true - unreachableDur.Forever = true - } else { - notReadyDur.TimeSpan = 5 * time.Minute - unreachableDur.TimeSpan = 5 * time.Minute - } - case api.ServerGroupSyncMasters: - notReadyDur.TimeSpan = 15 * time.Second - unreachableDur.TimeSpan = 15 * time.Second - case api.ServerGroupSyncWorkers: - notReadyDur.TimeSpan = 1 * time.Minute - unreachableDur.TimeSpan = 1 * time.Minute - case api.ServerGroupGateways: - notReadyDur.TimeSpan = 15 * time.Second - unreachableDur.TimeSpan = 15 * time.Second - } - return []core.Toleration{NewNoExecuteToleration(TolerationKeyNodeNotReady, notReadyDur), - NewNoExecuteToleration(TolerationKeyNodeUnreachable, unreachableDur), - NewNoExecuteToleration(TolerationKeyNodeAlphaUnreachable, unreachableDur), - } -} From efbbc794392fd329ca78965aeac1deb353c834fe Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:40:32 +0200 Subject: [PATCH 23/50] [Feature] Integration TLS (#1710) --- .golangci.yaml | 186 +++++++------- CHANGELOG.md | 1 + docs/cli/arangodb_operator_integration.md | 7 + integrations/pong/v1/impl.go | 3 +- pkg/apis/deployment/v1/tls_spec.go | 4 +- pkg/apis/deployment/v1/tls_spec_test.go | 4 +- pkg/apis/deployment/v2alpha1/tls_spec.go | 4 +- pkg/apis/deployment/v2alpha1/tls_spec_test.go | 4 +- pkg/deployment/reconcile/plan_builder_tls.go | 8 +- .../resources/certificates_client_auth.go | 21 +- pkg/deployment/resources/certificates_tls.go | 47 +--- pkg/deployment/resources/pod_creator.go | 4 +- pkg/deployment/resources/secrets.go | 4 +- pkg/integrations/clients/client.go | 36 +++ pkg/integrations/clients/register.go | 8 + pkg/integrations/register.go | 33 ++- pkg/integrations/suite_test.go | 2 + pkg/integrations/tls.go | 39 +++ pkg/integrations/tls_test.go | 243 ++++++++++++++++++ pkg/util/grpc.go | 66 ++++- pkg/util/k8sutil/tls/cert.go | 94 +++++++ pkg/util/k8sutil/tls/tls.go | 4 +- pkg/util/svc/configuration.go | 24 +- pkg/util/svc/service.go | 2 +- pkg/util/tests/network.go | 4 +- 25 files changed, 672 insertions(+), 180 deletions(-) create mode 100644 pkg/integrations/tls.go create mode 100644 pkg/integrations/tls_test.go create mode 100644 pkg/util/k8sutil/tls/cert.go diff --git a/.golangci.yaml b/.golangci.yaml index 5850830be..5db6d1630 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -23,100 +23,102 @@ linters-settings: importas: no-unaliased: true alias: - - pkg: k8s.io/api/core/v1 - alias: core - - pkg: k8s.io/apimachinery/pkg/apis/meta/v1 - alias: meta - - pkg: k8s.io/client-go/kubernetes/typed/core/v1 - alias: typedCore - - pkg: k8s.io/api/apps/v1 - alias: apps - - pkg: k8s.io/api/batch/v1 - alias: batch - - pkg: k8s.io/api/storage/v1 - alias: storage - - pkg: github.com/arangodb/kube-arangodb/pkg/deployment/reconcile/shared - alias: sharedReconcile - - pkg: k8s.io/api/policy/v1 - alias: policy - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/shared/v1 - alias: sharedApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1 - alias: schedulerApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/profiles - alias: schedulerProfiles - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container - alias: schedulerContainerApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources - alias: schedulerContainerResourcesApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod - alias: schedulerPodApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod/resources - alias: schedulerPodResourcesApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1 - alias: schedulerApiv1alpha1 - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/profiles - alias: schedulerProfilesv1alpha1 - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/container - alias: schedulerContainerApiv1alpha1 - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/container/resources - alias: schedulerContainerResourcesApiv1alpha1 - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/pod - alias: schedulerPodApiv1alpha1 - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/pod/resources - alias: schedulerPodResourcesApiv1alpha1 - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/shared - alias: shared - - pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/analytics/shared - alias: analyticsShared - - pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/shared - alias: enterpriseShared - - pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/ml/shared - alias: mlShared - - pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/ml/shared/test - alias: mlSharedTests - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/analytics/v1alpha1 - alias: analyticsApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1 - alias: networkingApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1 - alias: mlApi - - pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1 - alias: mlApiv1alpha1 - - pkg: github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition - alias: pbSchedulerV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/scheduler/v1 - alias: pbImplSchedulerV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/shutdown/v1/definition - alias: pbShutdownV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/shutdown/v1 - alias: pbImplShutdownV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition - alias: pbAuthenticationV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/authentication/v1 - alias: pbImplAuthenticationV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/authorization/v0/definition - alias: pbAuthorizationV0 - - pkg: github.com/arangodb/kube-arangodb/integrations/authorization/v0 - alias: pbImplAuthorizationV0 - - pkg: github.com/arangodb/kube-arangodb/integrations/config/v1/definition - alias: pbConfigV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/config/v1 - alias: pbImplConfigV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/pong/v1/definition - alias: pbPongV1 + - alias: pbImplAuthenticationV1 + pkg: github.com/arangodb/kube-arangodb/integrations/authentication/v1 + - alias: pbAuthenticationV1 + pkg: github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition + - alias: pbImplAuthorizationV0 + pkg: github.com/arangodb/kube-arangodb/integrations/authorization/v0 + - alias: pbAuthorizationV0 + pkg: github.com/arangodb/kube-arangodb/integrations/authorization/v0/definition + - alias: pbImplConfigV1 + pkg: github.com/arangodb/kube-arangodb/integrations/config/v1 + - alias: pbConfigV1 + pkg: github.com/arangodb/kube-arangodb/integrations/config/v1/definition + - alias: pbImplEnvoyAuthV3 + pkg: github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3 - pkg: github.com/arangodb/kube-arangodb/integrations/pong/v1 alias: pbImplPongV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1/definition - alias: pbSharedV1 - - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1 - alias: pbImplSharedV1 - - pkg: github.com/envoyproxy/go-control-plane/envoy/service/auth/v3 - alias: pbEnvoyAuthV3 - - pkg: github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3 - alias: pbImplEnvoyAuthV3 - - pkg: github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources - alias: kresources + - pkg: github.com/arangodb/kube-arangodb/integrations/pong/v1/definition + alias: pbPongV1 + - alias: pbImplSchedulerV1 + pkg: github.com/arangodb/kube-arangodb/integrations/scheduler/v1 + - alias: pbSchedulerV1 + pkg: github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition + - alias: pbImplSharedV1 + pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1 + - alias: pbSharedV1 + pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1/definition + - alias: pbImplShutdownV1 + pkg: github.com/arangodb/kube-arangodb/integrations/shutdown/v1 + - alias: pbShutdownV1 + pkg: github.com/arangodb/kube-arangodb/integrations/shutdown/v1/definition + - alias: analyticsApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/analytics/v1alpha1 + - alias: mlApiv1alpha1 + pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1 + - alias: mlApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1 + - alias: networkingApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1 + - alias: schedulerApiv1alpha1 + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1 + - alias: schedulerContainerApiv1alpha1 + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/container + - alias: schedulerContainerResourcesApiv1alpha1 + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/container/resources + - alias: schedulerPodApiv1alpha1 + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/pod + - alias: schedulerPodResourcesApiv1alpha1 + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/pod/resources + - alias: schedulerProfilesv1alpha1 + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1alpha1/profiles + - alias: schedulerApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1 + - alias: schedulerContainerApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container + - alias: schedulerContainerResourcesApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources + - alias: schedulerPodApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod + - alias: schedulerPodResourcesApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod/resources + - alias: schedulerProfiles + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/profiles + - alias: shared + pkg: github.com/arangodb/kube-arangodb/pkg/apis/shared + - alias: sharedApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/shared/v1 + - alias: sharedReconcile + pkg: github.com/arangodb/kube-arangodb/pkg/deployment/reconcile/shared + - alias: analyticsShared + pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/analytics/shared + - alias: mlShared + pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/ml/shared + - alias: mlSharedTests + pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/ml/shared/test + - alias: enterpriseShared + pkg: github.com/arangodb/kube-arangodb/pkg/handlers/enterprise/shared + - alias: kresources + pkg: github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources + - alias: ktls + pkg: github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls + - alias: pbEnvoyAuthV3 + pkg: github.com/envoyproxy/go-control-plane/envoy/service/auth/v3 + - alias: apps + pkg: k8s.io/api/apps/v1 + - alias: batch + pkg: k8s.io/api/batch/v1 + - alias: core + pkg: k8s.io/api/core/v1 + - alias: policy + pkg: k8s.io/api/policy/v1 + - alias: storage + pkg: k8s.io/api/storage/v1 + - alias: meta + pkg: k8s.io/apimachinery/pkg/apis/meta/v1 + - alias: typedCore + pkg: k8s.io/client-go/kubernetes/typed/core/v1 gci: sections: - standard diff --git a/CHANGELOG.md b/CHANGELOG.md index 2369ea863..ea7db150f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - (Feature) Custom Gateway image - (Bugfix) Fix race condition in ArangoBackup - (Feature) Improve Gateway Config gen +- (Feature) Integration Service TLS ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/docs/cli/arangodb_operator_integration.md b/docs/cli/arangodb_operator_integration.md index d97513f28..3ed59a24b 100644 --- a/docs/cli/arangodb_operator_integration.md +++ b/docs/cli/arangodb_operator_integration.md @@ -22,6 +22,7 @@ Flags: --health.auth.token string Token for health service (when auth service is token) --health.auth.type string Auth type for health service (default "None") --health.shutdown.enabled Determines if shutdown service should be enabled and exposed (default true) + --health.tls.keyfile string Path to the keyfile -h, --help help for arangodb_operator_integration --integration.authentication.v1 Enable AuthenticationV1 Integration Service --integration.authentication.v1.enabled Defines if Authentication is enabled (default true) @@ -74,6 +75,8 @@ Flags: --services.external.auth.token string Token for external service (when auth service is token) --services.external.auth.type string Auth type for external service (default "None") --services.external.enabled Defines if external access is enabled + --services.external.tls.keyfile string Path to the keyfile + --services.tls.keyfile string Path to the keyfile Use "arangodb_operator_integration [command] --help" for more information about a command. ``` @@ -94,6 +97,10 @@ Available Commands: Flags: --address string GRPC Service Address (default "127.0.0.1:8080") -h, --help help for client + --tls.ca string Path to the custom CA + --tls.enabled Defines if GRPC is protected with TLS + --tls.fallback Enables TLS Fallback + --tls.insecure Enables Insecure TLS Connection --token string GRPC Token Use "arangodb_operator_integration client [command] --help" for more information about a command. diff --git a/integrations/pong/v1/impl.go b/integrations/pong/v1/impl.go index e595574b6..42b5e48ba 100644 --- a/integrations/pong/v1/impl.go +++ b/integrations/pong/v1/impl.go @@ -29,7 +29,6 @@ import ( pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" - pbShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1/definition" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) @@ -45,7 +44,7 @@ type impl struct { } func (i *impl) Name() string { - return pbShutdownV1.Name + return pbPongV1.Name } func (i *impl) Health() svc.HealthState { diff --git a/pkg/apis/deployment/v1/tls_spec.go b/pkg/apis/deployment/v1/tls_spec.go index 8255a9a9a..c2e815020 100644 --- a/pkg/apis/deployment/v1/tls_spec.go +++ b/pkg/apis/deployment/v1/tls_spec.go @@ -49,7 +49,7 @@ const ( ) const ( - defaultTLSTTL = Duration("2610h") // About 3 month + DefaultTLSTTL = Duration("2610h") // About 3 month ) // TLSSpec holds TLS specific configuration settings @@ -157,7 +157,7 @@ func (s *TLSSpec) SetDefaults(defaultCASecretName string) { if s.GetTTL() == "" { // Note that we don't check for nil here, since even a specified, but zero // should result in the default value. - s.TTL = NewDuration(defaultTLSTTL) + s.TTL = NewDuration(DefaultTLSTTL) } } diff --git a/pkg/apis/deployment/v1/tls_spec_test.go b/pkg/apis/deployment/v1/tls_spec_test.go index 733ad92a0..2225bb423 100644 --- a/pkg/apis/deployment/v1/tls_spec_test.go +++ b/pkg/apis/deployment/v1/tls_spec_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -60,6 +60,6 @@ func TestTLSSpecSetDefaults(t *testing.T) { assert.Equal(t, "foo", def(TLSSpec{CASecretName: util.NewType[string]("foo")}).GetCASecretName()) assert.Len(t, def(TLSSpec{}).GetAltNames(), 0) assert.Len(t, def(TLSSpec{AltNames: []string{"foo.local"}}).GetAltNames(), 1) - assert.Equal(t, defaultTLSTTL, def(TLSSpec{}).GetTTL()) + assert.Equal(t, DefaultTLSTTL, def(TLSSpec{}).GetTTL()) assert.Equal(t, time.Hour, def(TLSSpec{TTL: NewDuration("1h")}).GetTTL().AsDuration()) } diff --git a/pkg/apis/deployment/v2alpha1/tls_spec.go b/pkg/apis/deployment/v2alpha1/tls_spec.go index 0b055b127..8e0b2a1f3 100644 --- a/pkg/apis/deployment/v2alpha1/tls_spec.go +++ b/pkg/apis/deployment/v2alpha1/tls_spec.go @@ -49,7 +49,7 @@ const ( ) const ( - defaultTLSTTL = Duration("2610h") // About 3 month + DefaultTLSTTL = Duration("2610h") // About 3 month ) // TLSSpec holds TLS specific configuration settings @@ -157,7 +157,7 @@ func (s *TLSSpec) SetDefaults(defaultCASecretName string) { if s.GetTTL() == "" { // Note that we don't check for nil here, since even a specified, but zero // should result in the default value. - s.TTL = NewDuration(defaultTLSTTL) + s.TTL = NewDuration(DefaultTLSTTL) } } diff --git a/pkg/apis/deployment/v2alpha1/tls_spec_test.go b/pkg/apis/deployment/v2alpha1/tls_spec_test.go index 46e67c719..93d171871 100644 --- a/pkg/apis/deployment/v2alpha1/tls_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/tls_spec_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -60,6 +60,6 @@ func TestTLSSpecSetDefaults(t *testing.T) { assert.Equal(t, "foo", def(TLSSpec{CASecretName: util.NewType[string]("foo")}).GetCASecretName()) assert.Len(t, def(TLSSpec{}).GetAltNames(), 0) assert.Len(t, def(TLSSpec{AltNames: []string{"foo.local"}}).GetAltNames(), 1) - assert.Equal(t, defaultTLSTTL, def(TLSSpec{}).GetTTL()) + assert.Equal(t, DefaultTLSTTL, def(TLSSpec{}).GetTTL()) assert.Equal(t, time.Hour, def(TLSSpec{TTL: NewDuration("1h")}).GetTTL().AsDuration()) } diff --git a/pkg/deployment/reconcile/plan_builder_tls.go b/pkg/deployment/reconcile/plan_builder_tls.go index 766716b53..2567a3b7a 100644 --- a/pkg/deployment/reconcile/plan_builder_tls.go +++ b/pkg/deployment/reconcile/plan_builder_tls.go @@ -47,7 +47,7 @@ import ( operatorHTTP "github.com/arangodb/kube-arangodb/pkg/util/http" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - memberTls "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" + ktls "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tools" "github.com/arangodb/kube-arangodb/pkg/util/strings" ) @@ -542,13 +542,13 @@ func (r *Reconciler) keyfileRenewalRequired(ctx context.Context, apiObject k8sut } // Verify AltNames - var altNames memberTls.KeyfileInput + var altNames ktls.KeyfileInput switch group.Type() { case api.ServerGroupTypeArangoD: - altNames, err = memberTls.GetServerAltNames(apiObject, spec, tlsSpec, service, group, member) + altNames, err = ktls.GetServerAltNames(apiObject, spec, tlsSpec, service, group, member) case api.ServerGroupTypeArangoSync: - altNames, err = memberTls.GetSyncAltNames(apiObject, spec, tlsSpec, group, member) + altNames, err = ktls.GetSyncAltNames(apiObject, spec, tlsSpec, group, member) default: assertion.InvalidGroupKey.Assert(true, "Unable to check TLS Key Renewal for an unknown group: %s", group.AsRole()) return false, false diff --git a/pkg/deployment/resources/certificates_client_auth.go b/pkg/deployment/resources/certificates_client_auth.go index 967ce81b7..6d803d7ff 100644 --- a/pkg/deployment/resources/certificates_client_auth.go +++ b/pkg/deployment/resources/certificates_client_auth.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,36 +23,23 @@ package resources import ( "context" "fmt" - "time" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - certificates "github.com/arangodb-helper/go-certificates" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" -) - -const ( - clientAuthECDSACurve = "P256" // This curve is the default that ArangoDB accepts and plenty strong + ktls "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" ) // createClientAuthCACertificate creates a client authentication CA certificate and stores it in a secret with name // specified in the given spec. func (r *Resources) createClientAuthCACertificate(ctx context.Context, secrets secretv1.ModInterface, spec api.SyncAuthenticationSpec, deploymentName string, ownerRef *meta.OwnerReference) error { log := r.log.Str("section", "secrets") - options := certificates.CreateCertificateOptions{ - CommonName: fmt.Sprintf("%s Client Authentication Root Certificate", deploymentName), - ValidFrom: time.Now(), - ValidFor: caTTL, - IsCA: true, - IsClientAuth: true, - ECDSACurve: clientAuthECDSACurve, - } - cert, priv, err := certificates.CreateCertificate(options, nil) + + cert, priv, err := ktls.CreateTLSCACertificate(fmt.Sprintf("%s Client Authentication Root Certificate", deploymentName)) if err != nil { log.Err(err).Str("name", spec.GetClientCASecretName()).Debug("Failed to create CA certificate") return errors.WithStack(err) diff --git a/pkg/deployment/resources/certificates_tls.go b/pkg/deployment/resources/certificates_tls.go index d7ad24b4d..06daaa109 100644 --- a/pkg/deployment/resources/certificates_tls.go +++ b/pkg/deployment/resources/certificates_tls.go @@ -23,27 +23,19 @@ package resources import ( "context" "fmt" - "strings" - "time" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - certificates "github.com/arangodb-helper/go-certificates" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" -) - -const ( - caTTL = time.Hour * 24 * 365 * 10 // 10 year - tlsECDSACurve = "P256" // This curve is the default that ArangoDB accepts and plenty strong + ktls "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" ) // createTLSCACertificate creates a CA certificate and stores it in a secret with name @@ -52,18 +44,12 @@ func (r *Resources) createTLSCACertificate(ctx context.Context, secrets secretv1 deploymentName string, ownerRef *meta.OwnerReference) error { log := r.log.Str("section", "tls").Str("secret", spec.GetCASecretName()) - options := certificates.CreateCertificateOptions{ - CommonName: fmt.Sprintf("%s Root Certificate", deploymentName), - ValidFrom: time.Now(), - ValidFor: caTTL, - IsCA: true, - ECDSACurve: tlsECDSACurve, - } - cert, priv, err := certificates.CreateCertificate(options, nil) + cert, priv, err := ktls.CreateTLSCACertificate(fmt.Sprintf("%s Root Certificate", deploymentName)) if err != nil { log.Err(err).Debug("Failed to create CA certificate") return errors.WithStack(err) } + if err := k8sutil.CreateCASecret(ctx, secrets, spec.GetCASecretName(), cert, priv, ownerRef); err != nil { if kerrors.IsAlreadyExists(err) { log.Debug("CA Secret already exists") @@ -78,9 +64,13 @@ func (r *Resources) createTLSCACertificate(ctx context.Context, secrets secretv1 // createTLSServerCertificate creates a TLS certificate for a specific server and stores // it in a secret with the given name. -func createTLSServerCertificate(ctx context.Context, log logging.Logger, cachedStatus inspectorInterface.Inspector, secrets secretv1.ModInterface, names tls.KeyfileInput, spec api.TLSSpec, +func createTLSServerCertificate(ctx context.Context, log logging.Logger, cachedStatus inspectorInterface.Inspector, secrets secretv1.ModInterface, names ktls.KeyfileInput, spec api.TLSSpec, secretName string, ownerRef *meta.OwnerReference) (bool, error) { log = log.Str("secret", secretName) + // Setup defaults + if names.TTL == nil { + names.TTL = util.NewType(spec.GetTTL().AsDuration()) + } // Load CA certificate ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) defer cancel() @@ -89,28 +79,11 @@ func createTLSServerCertificate(ctx context.Context, log logging.Logger, cachedS log.Err(err).Debug("Failed to load CA certificate") return false, errors.WithStack(err) } - ca, err := certificates.LoadCAFromPEM(caCert, caKey) - if err != nil { - log.Err(err).Debug("Failed to decode CA certificate") - return false, errors.WithStack(err) - } - - options := certificates.CreateCertificateOptions{ - CommonName: names.AltNames[0], - Hosts: names.AltNames, - EmailAddresses: names.Email, - ValidFrom: time.Now(), - ValidFor: spec.GetTTL().AsDuration(), - IsCA: false, - ECDSACurve: tlsECDSACurve, - } - cert, priv, err := certificates.CreateCertificate(options, &ca) + keyfile, err := ktls.CreateTLSServerKeyfile(caCert, caKey, names) if err != nil { log.Err(err).Debug("Failed to create server certificate") return false, errors.WithStack(err) } - keyfile := strings.TrimSpace(cert) + "\n" + - strings.TrimSpace(priv) err = globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { _, err := k8sutil.CreateTLSKeyfileSecret(ctxChild, secrets, secretName, keyfile, ownerRef) diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index d70c91874..2b1782f2c 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -51,7 +51,7 @@ import ( podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" + ktls "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tolerations" ) @@ -549,7 +549,7 @@ func (r *Resources) createPodForMember(ctx context.Context, cachedStatus inspect // Create TLS secret tlsKeyfileSecretName := k8sutil.CreateTLSKeyfileSecretName(apiObject.GetName(), role, m.ID) - names, err := tls.GetSyncAltNames(apiObject, spec, spec.Sync.TLS, group, m) + names, err := ktls.GetSyncAltNames(apiObject, spec, spec.Sync.TLS, group, m) if err != nil { return errors.WithStack(errors.Wrapf(err, "Failed to render alt names")) } diff --git a/pkg/deployment/resources/secrets.go b/pkg/deployment/resources/secrets.go index 5d6af257e..e08302238 100644 --- a/pkg/deployment/resources/secrets.go +++ b/pkg/deployment/resources/secrets.go @@ -49,7 +49,7 @@ import ( inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" + ktls "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" "github.com/arangodb/kube-arangodb/pkg/util/token" ) @@ -146,7 +146,7 @@ func (r *Resources) EnsureSecrets(ctx context.Context, cachedStatus inspectorInt tlsKeyfileSecretName := k8sutil.AppendTLSKeyfileSecretPostfix(member.GetName()) if _, exists := cachedStatus.Secret().V1().GetSimple(tlsKeyfileSecretName); !exists { - serverNames, err := tls.GetServerAltNames(apiObject, spec, spec.TLS, service, members[id].Group, members[id].Member) + serverNames, err := ktls.GetServerAltNames(apiObject, spec, spec.TLS, service, members[id].Group, members[id].Member) if err != nil { return errors.WithStack(errors.Wrapf(err, "Failed to render alt names")) } diff --git a/pkg/integrations/clients/client.go b/pkg/integrations/clients/client.go index 0c28a502a..0b59a8016 100644 --- a/pkg/integrations/clients/client.go +++ b/pkg/integrations/clients/client.go @@ -22,7 +22,10 @@ package clients import ( "context" + "crypto/tls" + "crypto/x509" "io" + "os" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -74,6 +77,39 @@ func client[T any](ctx context.Context, cfg *Config, in func(cc grpc.ClientConnI opts = append(opts, util.TokenAuthInterceptors(token)...) } + if cfg.TLS.Enabled { + config := &tls.Config{} + + if ca := cfg.TLS.CA; ca != "" { + pemServerCA, err := os.ReadFile(ca) + if err != nil { + return util.Default[T](), nil, err + } + + certPool := x509.NewCertPool() + if !certPool.AppendCertsFromPEM(pemServerCA) { + return util.Default[T](), nil, err + } + + config.RootCAs = certPool + } + + if cfg.TLS.Insecure { + config.InsecureSkipVerify = true + } + + if cfg.TLS.Fallback { + client, closer, err := util.NewOptionalTLSGRPCClient(ctx, in, cfg.Address, config, opts...) + if err != nil { + return util.Default[T](), nil, err + } + + return client, closer, nil + } else { + opts = append(opts, util.ClientTLS(config)...) + } + } + client, closer, err := util.NewGRPCClient(ctx, in, cfg.Address, opts...) if err != nil { return util.Default[T](), nil, err diff --git a/pkg/integrations/clients/register.go b/pkg/integrations/clients/register.go index 95863a790..07b54be86 100644 --- a/pkg/integrations/clients/register.go +++ b/pkg/integrations/clients/register.go @@ -33,6 +33,10 @@ type Factory func(c *Config) Client type Config struct { Address string Token string + TLS struct { + Enabled, Insecure, Fallback bool + CA string + } } func (c *Config) Register(cmd *cobra.Command) error { @@ -40,6 +44,10 @@ func (c *Config) Register(cmd *cobra.Command) error { f.StringVar(&c.Address, "address", "127.0.0.1:8080", "GRPC Service Address") f.StringVar(&c.Token, "token", "", "GRPC Token") + f.BoolVar(&c.TLS.Enabled, "tls.enabled", false, "Defines if GRPC is protected with TLS") + f.StringVar(&c.TLS.CA, "tls.ca", "", "Path to the custom CA") + f.BoolVar(&c.TLS.Insecure, "tls.insecure", false, "Enables Insecure TLS Connection") + f.BoolVar(&c.TLS.Fallback, "tls.fallback", false, "Enables TLS Fallback") return nil } diff --git a/pkg/integrations/register.go b/pkg/integrations/register.go index 5482126c4..8799452dc 100644 --- a/pkg/integrations/register.go +++ b/pkg/integrations/register.go @@ -28,7 +28,6 @@ import ( "sync" "github.com/spf13/cobra" - "google.golang.org/grpc" pbImplPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1" pbImplShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1" @@ -73,6 +72,10 @@ type serviceConfiguration struct { address string + tls struct { + keyfile string + } + auth struct { t string @@ -81,7 +84,9 @@ type serviceConfiguration struct { } func (s *serviceConfiguration) Config() (svc.Configuration, error) { - var opts []grpc.ServerOption + var cfg svc.Configuration + + cfg.Address = s.address switch strings.ToLower(s.auth.t) { case "none": @@ -91,16 +96,21 @@ func (s *serviceConfiguration) Config() (svc.Configuration, error) { return util.Default[svc.Configuration](), errors.Errorf("Token is empty") } - opts = append(opts, + cfg.Options = append(cfg.Options, basicTokenAuthUnaryInterceptor(s.auth.token), basicTokenAuthStreamInterceptor(s.auth.token), ) } - return svc.Configuration{ - Options: opts, - Address: s.address, - }, nil + if keyfile := s.tls.keyfile; keyfile != "" { + if tls, err := tlsServerOptions(keyfile); err != nil { + return svc.Configuration{}, err + } else { + cfg.TLSOptions = tls + } + } + + return cfg, nil } func (c *configuration) Register(cmd *cobra.Command) error { @@ -120,16 +130,19 @@ func (c *configuration) Register(cmd *cobra.Command) error { f.BoolVar(&c.health.shutdownEnabled, "health.shutdown.enabled", true, "Determines if shutdown service should be enabled and exposed") f.StringVar(&c.health.auth.t, "health.auth.type", "None", "Auth type for health service") f.StringVar(&c.health.auth.token, "health.auth.token", "", "Token for health service (when auth service is token)") + f.StringVar(&c.health.tls.keyfile, "health.tls.keyfile", "", "Path to the keyfile") f.BoolVar(&c.services.internal.enabled, "services.enabled", true, "Defines if internal access is enabled") f.StringVar(&c.services.internal.address, "services.address", "127.0.0.1:9092", "Address to expose internal services") f.StringVar(&c.services.internal.auth.t, "services.auth.type", "None", "Auth type for internal service") f.StringVar(&c.services.internal.auth.token, "services.auth.token", "", "Token for internal service (when auth service is token)") + f.StringVar(&c.services.internal.tls.keyfile, "services.tls.keyfile", "", "Path to the keyfile") f.BoolVar(&c.services.external.enabled, "services.external.enabled", false, "Defines if external access is enabled") f.StringVar(&c.services.external.address, "services.external.address", "0.0.0.0:9093", "Address to expose external services") f.StringVar(&c.services.external.auth.t, "services.external.auth.type", "None", "Auth type for external service") f.StringVar(&c.services.external.auth.token, "services.external.auth.token", "", "Token for external service (when auth service is token)") + f.StringVar(&c.services.external.tls.keyfile, "services.external.tls.keyfile", "", "Path to the keyfile") for _, service := range c.registered { prefix := fmt.Sprintf("integration.%s", service.Name()) @@ -227,7 +240,7 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance healthHandler := health.Start(ctx) - logger.Str("address", healthHandler.Address()).Info("Health handler started") + logger.Str("address", healthHandler.Address()).Bool("ssl", healthConfig.TLSOptions != nil).Info("Health handler started") var wg sync.WaitGroup @@ -240,7 +253,7 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance defer wg.Done() s := svc.NewService(internalConfig, internalHandlers...).StartWithHealth(ctx, health) - logger.Str("address", s.Address()).Str("type", "internal").Info("Service handler started") + logger.Str("address", s.Address()).Str("type", "internal").Bool("ssl", internalConfig.TLSOptions != nil).Info("Service handler started") internal = s.Wait() @@ -257,7 +270,7 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance defer wg.Done() s := svc.NewService(externalConfig, externalHandlers...).StartWithHealth(ctx, health) - logger.Str("address", s.Address()).Str("type", "external").Info("Service handler started") + logger.Str("address", s.Address()).Str("type", "external").Bool("ssl", externalConfig.TLSOptions != nil).Info("Service handler started") external = s.Wait() diff --git a/pkg/integrations/suite_test.go b/pkg/integrations/suite_test.go index e3c903621..c2c17244b 100644 --- a/pkg/integrations/suite_test.go +++ b/pkg/integrations/suite_test.go @@ -24,6 +24,7 @@ import ( "context" "fmt" "os" + "strings" "testing" "github.com/spf13/cobra" @@ -68,6 +69,7 @@ func executeSync(t *testing.T, ctx context.Context, args ...string) error { cmd.SetOut(os.Stdout) cmd.SetArgs(append([]string{"test"}, args...)) + logger.Info("Command: %s", strings.Join(args, " ")) return cmd.Execute() } diff --git a/pkg/integrations/tls.go b/pkg/integrations/tls.go new file mode 100644 index 000000000..a5ef6f751 --- /dev/null +++ b/pkg/integrations/tls.go @@ -0,0 +1,39 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "crypto/tls" + + "github.com/arangodb-helper/go-certificates" +) + +func tlsServerOptions(keyfile string) (*tls.Config, error) { + cert, err := certificates.LoadKeyFile(keyfile) + if err != nil { + return nil, err + } + + return &tls.Config{ + Certificates: []tls.Certificate{cert}, + ClientAuth: tls.NoClientCert, + }, nil +} diff --git a/pkg/integrations/tls_test.go b/pkg/integrations/tls_test.go new file mode 100644 index 000000000..79aa38f6d --- /dev/null +++ b/pkg/integrations/tls_test.go @@ -0,0 +1,243 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "fmt" + "os" + "path" + "testing" + + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + + ktls "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Test_TLSCases(t *testing.T) { + directory := t.TempDir() + + ca1 := path.Join(directory, "CA1.keyfile") + ca1Pem := path.Join(directory, "CA1.pem") + server1 := path.Join(directory, "server1.keyfile") + + ca2 := path.Join(directory, "CA2.keyfile") + ca2Pem := path.Join(directory, "CA2.pem") + server2 := path.Join(directory, "server2.keyfile") + + t.Run("Arrange CA 1", func(t *testing.T) { + caCert, caKey, err := ktls.CreateTLSCACertificate("Test Root Certificate") + + require.NoError(t, err) + + require.NoError(t, os.WriteFile(ca1, []byte(ktls.AsKeyfile(caCert, caKey)), 0644)) + + require.NoError(t, os.WriteFile(ca1Pem, []byte(caCert), 0644)) + + serverCert, serverKey, err := ktls.CreateTLSServerCertificate(caCert, caKey, ktls.KeyfileInput{ + AltNames: []string{ + "127.0.0.1", + }, + Email: nil, + }) + + require.NoError(t, err) + + require.NoError(t, os.WriteFile(server1, []byte(ktls.AsKeyfile(serverCert, serverKey)), 0644)) + }) + + t.Run("Arrange CA 2", func(t *testing.T) { + caCert, caKey, err := ktls.CreateTLSCACertificate("Test Root Certificate") + + require.NoError(t, err) + + require.NoError(t, os.WriteFile(ca2, []byte(ktls.AsKeyfile(caCert, caKey)), 0644)) + + require.NoError(t, os.WriteFile(ca2Pem, []byte(caCert), 0644)) + + serverCert, serverKey, err := ktls.CreateTLSServerCertificate(caCert, caKey, ktls.KeyfileInput{ + AltNames: []string{ + "127.0.0.1", + }, + Email: nil, + }) + + require.NoError(t, err) + + require.NoError(t, os.WriteFile(server2, []byte(ktls.AsKeyfile(serverCert, serverKey)), 0644)) + }) + + c, health, internal, external := startService(t, + "--health.tls.keyfile=", + fmt.Sprintf("--services.tls.keyfile=%s", server1), + fmt.Sprintf("--services.external.tls.keyfile=%s", server2), + ) + defer c.Require(t) + + t.Run("Without TLS", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--tls.enabled=false", + "client", + "health", + "v1")) + }) + t.Run("internal", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--tls.enabled=false", + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"error reading server preface: EOF\"") + }) + t.Run("external", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--tls.enabled=false", + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"error reading server preface: EOF\"") + }) + }) + + t.Run("With TLS Fallback", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--tls.enabled=true", + "--tls.fallback=true", + "--tls.insecure=true", + "client", + "health", + "v1")) + }) + t.Run("internal", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--tls.enabled=true", + "--tls.insecure=true", + "--tls.fallback=true", + "client", + "health", + "v1")) + }) + t.Run("external", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--tls.enabled=true", + "--tls.insecure=true", + "--tls.fallback=true", + "client", + "health", + "v1")) + }) + }) + + t.Run("With TLS - wrong CA", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--tls.enabled=true", + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"transport: authentication handshake failed: tls: first record does not look like a TLS handshake\"") + }) + t.Run("internal", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--tls.enabled=true", + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"transport: authentication handshake failed: tls: failed to verify certificate: x509: certificate signed by unknown authority\"") + }) + t.Run("external", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--tls.enabled=true", + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"transport: authentication handshake failed: tls: failed to verify certificate: x509: certificate signed by unknown authority\"") + }) + }) + + t.Run("With TLS - valid CA1", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--tls.enabled=true", + fmt.Sprintf("--tls.ca=%s", ca1Pem), + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"transport: authentication handshake failed: tls: first record does not look like a TLS handshake\"") + }) + t.Run("internal", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--tls.enabled=true", + fmt.Sprintf("--tls.ca=%s", ca1Pem), + "client", + "health", + "v1")) + }) + t.Run("external", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--tls.enabled=true", + fmt.Sprintf("--tls.ca=%s", ca1Pem), + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"transport: authentication handshake failed: tls: failed to verify certificate: x509: certificate signed by unknown authority (possibly because of \\\"x509: ECDSA verification failure\\\" while trying to verify candidate authority certificate \\\"Test Root Certificate\\\")\"") + }) + }) + + t.Run("With TLS - insecure", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--tls.enabled=true", + "--tls.insecure=true", + "client", + "health", + "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"transport: authentication handshake failed: tls: first record does not look like a TLS handshake\"") + }) + t.Run("internal", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--tls.enabled=true", + "--tls.insecure=true", + "client", + "health", + "v1")) + }) + t.Run("external", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--tls.enabled=true", + "--tls.insecure=true", + "client", + "health", + "v1")) + }) + }) +} diff --git a/pkg/util/grpc.go b/pkg/util/grpc.go index 1bad6ea1f..2ed559baf 100644 --- a/pkg/util/grpc.go +++ b/pkg/util/grpc.go @@ -22,11 +22,18 @@ package util import ( "context" + "crypto/tls" "io" "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" + + pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/svc" ) const AuthorizationGRPCHeader = "adb-authorization" @@ -40,7 +47,54 @@ func NewGRPCClient[T any](ctx context.Context, in func(cc grpc.ClientConnInterfa return in(con), con, nil } -func NewGRPCConn(ctx context.Context, addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { +func NewOptionalTLSGRPCClient[T any](ctx context.Context, in func(cc grpc.ClientConnInterface) T, addr string, tls *tls.Config, opts ...grpc.DialOption) (T, io.Closer, error) { + con, err := NewOptionalTLSGRPCConn(ctx, addr, tls, opts...) + if err != nil { + return Default[T](), nil, err + } + + return in(con), con, nil +} + +func NewOptionalTLSGRPCConn(ctx context.Context, addr string, tls *tls.Config, opts ...grpc.DialOption) (*grpc.ClientConn, error) { + if tls != nil { + // Try with TLS + tlsOpts := ClientTLS(tls) + newOpts := make([]grpc.DialOption, len(opts)+len(tlsOpts)) + copy(newOpts, opts) + copy(newOpts[len(opts):], tlsOpts) + + // Create conn + conn, err := newGRPCConn(ctx, addr, tlsOpts...) + if err != nil { + return nil, err + } + + if _, err := pbPongV1.NewPongV1Client(conn).Ping(ctx, &pbSharedV1.Empty{}); err != nil { + if v, ok := svc.AsGRPCErrorStatus(err); !ok { + return nil, err + } else { + if status := v.GRPCStatus(); status == nil { + return nil, err + } else { + if status.Code() != codes.Unavailable { + return nil, err + } + } + } + } else { + return conn, nil + } + + if err := conn.Close(); err != nil { + return nil, err + } + } + + return newGRPCConn(ctx, addr, opts...) +} + +func newGRPCConn(ctx context.Context, addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { var z []grpc.DialOption z = append(z, grpc.WithTransportCredentials(insecure.NewCredentials())) @@ -55,6 +109,16 @@ func NewGRPCConn(ctx context.Context, addr string, opts ...grpc.DialOption) (*gr return conn, nil } +func NewGRPCConn(ctx context.Context, addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { + return newGRPCConn(ctx, addr, opts...) +} + +func ClientTLS(config *tls.Config) []grpc.DialOption { + return []grpc.DialOption{ + grpc.WithTransportCredentials(credentials.NewTLS(config)), + } +} + func TokenAuthInterceptors(token string) []grpc.DialOption { return []grpc.DialOption{ grpc.WithUnaryInterceptor(func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { diff --git a/pkg/util/k8sutil/tls/cert.go b/pkg/util/k8sutil/tls/cert.go new file mode 100644 index 000000000..55aa548a3 --- /dev/null +++ b/pkg/util/k8sutil/tls/cert.go @@ -0,0 +1,94 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package tls + +import ( + "strings" + "time" + + "github.com/arangodb-helper/go-certificates" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +const ( + caTTL = time.Hour * 24 * 365 * 10 // 10 year + tlsECDSACurve = "P256" // This curve is the default that ArangoDB accepts and plenty strong +) + +// CreateTLSCACertificate creates a CA certificate +func CreateTLSCACertificate(commonName string) (string, string, error) { + options := certificates.CreateCertificateOptions{ + CommonName: commonName, + ValidFrom: time.Now(), + ValidFor: caTTL, + IsCA: true, + ECDSACurve: tlsECDSACurve, + } + + cert, priv, err := certificates.CreateCertificate(options, nil) + if err != nil { + return "", "", errors.WithStack(err) + } + + return cert, priv, nil +} + +// CreateTLSServerCertificate creates Sever Cert in PEM Format +func CreateTLSServerCertificate(caCert, caKey string, names KeyfileInput) (string, string, error) { + ca, err := certificates.LoadCAFromPEM(caCert, caKey) + if err != nil { + return "", "", errors.WithStack(err) + } + + options := certificates.CreateCertificateOptions{ + CommonName: names.AltNames[0], + Hosts: names.AltNames, + EmailAddresses: names.Email, + ValidFrom: time.Now(), + ValidFor: util.TypeOrDefault(names.TTL, api.DefaultTLSTTL.AsDuration()), + IsCA: false, + ECDSACurve: tlsECDSACurve, + } + cert, priv, err := certificates.CreateCertificate(options, &ca) + if err != nil { + return "", "", errors.WithStack(err) + } + + return cert, priv, nil +} + +// CreateTLSServerKeyfile creates Sever Cert in Keyfile Format +func CreateTLSServerKeyfile(caCert, caKey string, names KeyfileInput) (string, error) { + cert, priv, err := CreateTLSServerCertificate(caCert, caKey, names) + if err != nil { + return "", err + } + + return AsKeyfile(cert, priv), nil +} + +func AsKeyfile(cert, priv string) string { + return strings.TrimSpace(cert) + "\n" + + strings.TrimSpace(priv) +} diff --git a/pkg/util/k8sutil/tls/tls.go b/pkg/util/k8sutil/tls/tls.go index 5f598c08d..b8da8a387 100644 --- a/pkg/util/k8sutil/tls/tls.go +++ b/pkg/util/k8sutil/tls/tls.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package tls import ( "net/url" + "time" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,6 +34,7 @@ import ( ) type KeyfileInput struct { + TTL *time.Duration AltNames []string Email []string } diff --git a/pkg/util/svc/configuration.go b/pkg/util/svc/configuration.go index e5f7008b7..a6ea34b0b 100644 --- a/pkg/util/svc/configuration.go +++ b/pkg/util/svc/configuration.go @@ -20,10 +20,32 @@ package svc -import "google.golang.org/grpc" +import ( + "crypto/tls" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) type Configuration struct { Address string + TLSOptions *tls.Config + Options []grpc.ServerOption } + +func (c *Configuration) RenderOptions() []grpc.ServerOption { + if c == nil { + return nil + } + + ret := make([]grpc.ServerOption, len(c.Options)) + copy(ret, c.Options) + + if tls := c.TLSOptions; tls != nil { + ret = append(ret, grpc.Creds(credentials.NewTLS(tls))) + } + + return ret +} diff --git a/pkg/util/svc/service.go b/pkg/util/svc/service.go index 0db469d23..dcc09b326 100644 --- a/pkg/util/svc/service.go +++ b/pkg/util/svc/service.go @@ -56,7 +56,7 @@ func newService(cfg Configuration, handlers ...Handler) *service { var q service q.cfg = cfg - q.server = grpc.NewServer(cfg.Options...) + q.server = grpc.NewServer(cfg.RenderOptions()...) q.handlers = handlers for _, handler := range q.handlers { diff --git a/pkg/util/tests/network.go b/pkg/util/tests/network.go index cfbf2b10e..57bc203f7 100644 --- a/pkg/util/tests/network.go +++ b/pkg/util/tests/network.go @@ -46,13 +46,13 @@ func WaitForAddress(t *testing.T, addr string, port int) { tickerT := time.NewTicker(125 * time.Millisecond) defer tickerT.Stop() - timerT := time.NewTimer(1 * time.Second) + timerT := time.NewTimer(5 * time.Second) defer timerT.Stop() for { select { case <-timerT.C: - require.Fail(t, "Timeouted") + require.Fail(t, "Timeouted", addr, port) case <-tickerT.C: conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", addr, port), 125*time.Millisecond) if err != nil { From db5406e868163d15f19b0ab756a8ff8769369baf Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:37:36 +0200 Subject: [PATCH 24/50] [Feature] [Gateway] SNI and Authz support (#1714) --- CHANGELOG.md | 1 + Dockerfile | 4 +- Makefile | 12 +- README.md | 2 +- chart/arangodb-ingress-proxy/Chart.yaml | 4 - chart/arangodb-ingress-proxy/LICENSE | 15 -- chart/arangodb-ingress-proxy/README.md | 20 --- .../templates/NOTES.txt | 3 - .../templates/_helpers.tpl | 15 -- .../templates/configmap.yaml | 46 ------- .../templates/deployment.yaml | 68 --------- .../templates/service.yaml | 23 ---- chart/arangodb-ingress-proxy/values.yaml | 3 - docs/cli/arangodb_operator.md | 2 +- integrations/envoy/auth/v3/impl.go | 7 +- integrations/envoy/auth/v3/logger.go | 25 ++++ integrations/envoy/auth/v3/service_test.go | 4 +- pkg/apis/shared/validate.go | 16 ++- pkg/deployment/features/gateway.go | 6 + pkg/deployment/pod/sni-gateway.go | 117 ++++++++++++++++ pkg/deployment/pod/sni.go | 15 +- .../reconcile/plan_builder_rebalancer_v2.go | 2 +- .../reconcile/plan_builder_scale.go | 2 +- .../reconcile/plan_builder_tls_sni.go | 8 +- .../resources/config_map_gateway.go | 33 ++++- pkg/deployment/resources/config_maps.go | 2 +- pkg/deployment/resources/gateway/consts.go | 25 ++++ .../resources/gateway/gateway_config.go | 129 ++++++++++++++++-- .../gateway/gateway_config_destination.go | 15 +- .../gateway_config_destination_target.go | 10 +- .../resources/gateway/gateway_config_sni.go | 82 +++++++++++ .../resources/gateway/gateway_config_test.go | 41 ++++++ pkg/deployment/resources/pdbs.go | 2 +- .../resources/pod_creator_gateway.go | 15 +- .../pod_creator_gateway_container.go | 13 ++ .../resources/pod_creator_gateway_pod.go | 12 +- pkg/deployment/resources/pod_inspector.go | 2 +- pkg/deployment/resources/services.go | 2 +- pkg/integrations/sidecar/core.go | 9 +- .../sidecar/integration.authentication.v1.go | 4 +- .../sidecar/integration.authorization.v1.go | 4 +- .../sidecar/integration.envoy.v3.go | 18 +-- pkg/integrations/sidecar/integration.go | 20 +-- .../sidecar/integration.shutdown.v1.go | 4 +- pkg/util/k8sutil/interfaces/pod_creator.go | 2 + pkg/util/list.go | 6 + pkg/util/tests/cast.go | 33 +++++ 47 files changed, 623 insertions(+), 280 deletions(-) delete mode 100644 chart/arangodb-ingress-proxy/Chart.yaml delete mode 100644 chart/arangodb-ingress-proxy/LICENSE delete mode 100644 chart/arangodb-ingress-proxy/README.md delete mode 100644 chart/arangodb-ingress-proxy/templates/NOTES.txt delete mode 100644 chart/arangodb-ingress-proxy/templates/_helpers.tpl delete mode 100644 chart/arangodb-ingress-proxy/templates/configmap.yaml delete mode 100644 chart/arangodb-ingress-proxy/templates/deployment.yaml delete mode 100644 chart/arangodb-ingress-proxy/templates/service.yaml delete mode 100644 chart/arangodb-ingress-proxy/values.yaml create mode 100644 integrations/envoy/auth/v3/logger.go create mode 100644 pkg/deployment/pod/sni-gateway.go create mode 100644 pkg/deployment/resources/gateway/consts.go create mode 100644 pkg/deployment/resources/gateway/gateway_config_sni.go create mode 100644 pkg/util/tests/cast.go diff --git a/CHANGELOG.md b/CHANGELOG.md index ea7db150f..68b34d2d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - (Bugfix) Fix race condition in ArangoBackup - (Feature) Improve Gateway Config gen - (Feature) Integration Service TLS +- (Feature) (Gateway) SNI and Authz support ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Dockerfile b/Dockerfile index 9cfc8a5d8..0c5d1c196 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,9 @@ FROM ${ENVOY_IMAGE} AS envoy FROM ${IMAGE} AS base -RUN apt-get update && apt-get upgrade -y && apt-get clean +ARG BUILD_SKIP_UPDATE=false +ENV BUILD_SKIP_UPDATE=${BUILD_SKIP_UPDATE} +RUN if [ X"${BUILD_SKIP_UPDATE}" = X"true" ]; then echo "Update skipped!"; else apt-get update && apt-get upgrade -y && apt-get clean; fi FROM base diff --git a/Makefile b/Makefile index 2cadcdadb..7760ebab0 100644 --- a/Makefile +++ b/Makefile @@ -121,6 +121,8 @@ ifndef LOCALONLY PUSHIMAGES := 1 endif +BUILD_SKIP_UPDATE ?= false + ifdef IMAGETAG IMAGESUFFIX := :$(IMAGETAG) else @@ -272,7 +274,7 @@ NON_EE_SOURCES := $(shell $(NON_EE_SOURCES_QUERY)) YAML_EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated/clientset pkg/generated/informers pkg/generated/listers \ chart/kube-arangodb/templates chart/kube-arangodb-arm64/templates chart/kube-arangodb-enterprise/templates chart/kube-arangodb-enterprise-arm64/templates \ - chart/kube-arangodb-crd/templates chart/arangodb-ingress-proxy/templates + chart/kube-arangodb-crd/templates YAML_EXCLUDE_FILES := YAML_QUERY := find ./ -type f -name '*.yaml' $(foreach EXCLUDE_DIR,$(YAML_EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(YAML_EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)") YAMLS := $(shell $(YAML_QUERY)) @@ -478,11 +480,11 @@ $(BIN): $(VBIN_LINUX_AMD64) $(VBIN_OPS_LINUX_AMD64) $(VBIN_INT_LINUX_AMD64) docker: clean check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64) ifdef PUSHIMAGES docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \ - --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \ + --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "BUILD_SKIP_UPDATE=${BUILD_SKIP_UPDATE}" \ --platform linux/amd64,linux/arm64 --push -t $(OPERATORIMAGE) . else docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \ - --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \ + --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "BUILD_SKIP_UPDATE=${BUILD_SKIP_UPDATE}" \ --platform linux/amd64,linux/arm64 -t $(OPERATORIMAGE) . endif @@ -802,6 +804,7 @@ set-typed-api-version/%: @grep -rHn "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/$*/v[A-Za-z0-9]\+" \ "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ + "$(ROOT)/pkg/integrations/" \ "$(ROOT)/pkg/operator/" \ "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ @@ -818,6 +821,7 @@ set-api-version/%: @grep -rHn "github.com/arangodb/kube-arangodb/pkg/apis/$*/v[A-Za-z0-9]\+" \ "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ + "$(ROOT)/pkg/integrations/" \ "$(ROOT)/pkg/operator/" \ "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ @@ -831,6 +835,7 @@ set-api-version/%: @grep -rHn "DatabaseV[A-Za-z0-9]\+()" \ "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ + "$(ROOT)/pkg/integrations/" \ "$(ROOT)/pkg/operator/" \ "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ @@ -844,6 +849,7 @@ set-api-version/%: @grep -rHn "ReplicationV[A-Za-z0-9]\+()" \ "$(ROOT)/pkg/deployment/" \ "$(ROOT)/pkg/replication/" \ + "$(ROOT)/pkg/integrations/" \ "$(ROOT)/pkg/operator/" \ "$(ROOT)/pkg/operatorV2/" \ "$(ROOT)/pkg/server/" \ diff --git a/README.md b/README.md index 863f667b5..71e7392a3 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes diff --git a/chart/arangodb-ingress-proxy/Chart.yaml b/chart/arangodb-ingress-proxy/Chart.yaml deleted file mode 100644 index 74d1c8abe..000000000 --- a/chart/arangodb-ingress-proxy/Chart.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: ArangoDB Ingress Proxy -name: arangodb-ingress-proxy -tillerVersion: '>2.7' -version: 1.0.0 diff --git a/chart/arangodb-ingress-proxy/LICENSE b/chart/arangodb-ingress-proxy/LICENSE deleted file mode 100644 index 79013b689..000000000 --- a/chart/arangodb-ingress-proxy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany - -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 holder is ArangoDB GmbH, Cologne, Germany \ No newline at end of file diff --git a/chart/arangodb-ingress-proxy/README.md b/chart/arangodb-ingress-proxy/README.md deleted file mode 100644 index 9b5499e96..000000000 --- a/chart/arangodb-ingress-proxy/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Introduction - -Kubernetes ArangoDB Ingress for custom certificates. - -ArangoDB supports more than only HTTP protocol, so simple Ingress is not enough. - -## Before - -Before Ingress proxy will be installed certificate secret needs to be created: - -``` -kubectl -n create secret tls --cert --key -``` - -## Installation - -To install Ingress: -``` -helm install --name --namespace /chart/arangodb-ingress-proxy --set replicas=2 --set tls=TLS Secret name> --set deployment= -``` \ No newline at end of file diff --git a/chart/arangodb-ingress-proxy/templates/NOTES.txt b/chart/arangodb-ingress-proxy/templates/NOTES.txt deleted file mode 100644 index b99bf1620..000000000 --- a/chart/arangodb-ingress-proxy/templates/NOTES.txt +++ /dev/null @@ -1,3 +0,0 @@ -Your LB is ready! - -Get LoadBalancer IP using `kubectl --namespace "{{ .Release.Namespace }}" get svc "{{ template "arangodb-ingress-proxy.name" . }}" -o jsonpath="{.status.loadBalancer.ingress[0].ip}"` \ No newline at end of file diff --git a/chart/arangodb-ingress-proxy/templates/_helpers.tpl b/chart/arangodb-ingress-proxy/templates/_helpers.tpl deleted file mode 100644 index d35a6ae38..000000000 --- a/chart/arangodb-ingress-proxy/templates/_helpers.tpl +++ /dev/null @@ -1,15 +0,0 @@ -{{/* vim: set filetype=mustache: */}} - -{{/* -Expand the name of the chart. -*/}} -{{- define "arangodb-ingress-proxy.name" -}} -{{- printf "%s" .Chart.Name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Expand the name of the release. -*/}} -{{- define "arangodb-ingress-proxy.releaseName" -}} -{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/chart/arangodb-ingress-proxy/templates/configmap.yaml b/chart/arangodb-ingress-proxy/templates/configmap.yaml deleted file mode 100644 index cfa7b9592..000000000 --- a/chart/arangodb-ingress-proxy/templates/configmap.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "arangodb-ingress-proxy.name" . }} - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - release: {{ .Release.Name }} -data: - config: | - user nginx; - worker_processes 1; - - error_log /dev/stdout info; - - pid /var/run/nginx.pid; - - - events { - worker_connections 1024; - } - - stream { - log_format basic '$remote_addr [$time_local] ' - '$protocol $status $bytes_sent $bytes_received ' - '$session_time'; - access_log /dev/stdout basic; - - server { - listen 8529 ssl; - proxy_pass {{ required "Arango Deployment name needs to be provided!" .Values.deployment }}:8529; - - proxy_ssl on; - - ssl_certificate /etc/nginx/local-tls/tls.crt; - ssl_certificate_key /etc/nginx/local-tls/tls.key; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers HIGH:!aNULL:!MD5; - ssl_session_timeout 4h; - ssl_handshake_timeout 30s; - proxy_timeout 6h; - } - } \ No newline at end of file diff --git a/chart/arangodb-ingress-proxy/templates/deployment.yaml b/chart/arangodb-ingress-proxy/templates/deployment.yaml deleted file mode 100644 index ff40aaa2a..000000000 --- a/chart/arangodb-ingress-proxy/templates/deployment.yaml +++ /dev/null @@ -1,68 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "arangodb-ingress-proxy.name" . }} - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - release: {{ .Release.Name }} -spec: - replicas: {{ .Values.replicas }} - selector: - matchLabels: - app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app.kubernetes.io/instance: {{ .Release.Name }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - release: {{ .Release.Name }} - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - topologyKey: "kubernetes.io/hostname" - labelSelector: - matchExpressions: - - key: app.kubernetes.io/name - operator: In - values: - - {{ template "arangodb-ingress-proxy.name" . }} - containers: - - name: nginx - imagePullPolicy: {{ .Values.imagePullPolicy }} - image: {{ .Values.image }} - ports: - - name: nginx - containerPort: 8529 - volumeMounts: - - mountPath: /etc/nginx/nginx.conf - name: config - subPath: config - - mountPath: /etc/nginx/local-tls - name: tls - volumes: - - name: config - configMap: - name: {{ template "arangodb-ingress-proxy.name" . }} - - name: tls - secret: - secretName: {{ required "TLS certificate need to be provided!" .Values.tls }} \ No newline at end of file diff --git a/chart/arangodb-ingress-proxy/templates/service.yaml b/chart/arangodb-ingress-proxy/templates/service.yaml deleted file mode 100644 index f11e2c815..000000000 --- a/chart/arangodb-ingress-proxy/templates/service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "arangodb-ingress-proxy.name" . }} - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - release: {{ .Release.Name }} -spec: - ports: - - name: server - port: 8529 - protocol: TCP - targetPort: 8529 - selector: - app.kubernetes.io/name: {{ template "arangodb-ingress-proxy.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - release: {{ .Release.Name }} - type: LoadBalancer \ No newline at end of file diff --git a/chart/arangodb-ingress-proxy/values.yaml b/chart/arangodb-ingress-proxy/values.yaml deleted file mode 100644 index 186e10dd7..000000000 --- a/chart/arangodb-ingress-proxy/values.yaml +++ /dev/null @@ -1,3 +0,0 @@ -replicas: 2 -imagePullPolicy: Always -image: nginx:1.16.1-alpine diff --git a/docs/cli/arangodb_operator.md b/docs/cli/arangodb_operator.md index e9629d728..938126a07 100644 --- a/docs/cli/arangodb_operator.md +++ b/docs/cli/arangodb_operator.md @@ -80,7 +80,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes diff --git a/integrations/envoy/auth/v3/impl.go b/integrations/envoy/auth/v3/impl.go index b85bd2c40..c3930b08b 100644 --- a/integrations/envoy/auth/v3/impl.go +++ b/integrations/envoy/auth/v3/impl.go @@ -53,5 +53,10 @@ func (i *impl) Register(registrar *grpc.Server) { } func (i *impl) Check(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest) (*pbEnvoyAuthV3.CheckResponse, error) { - return &pbEnvoyAuthV3.CheckResponse{}, nil + logger.Info("Request Received") + return &pbEnvoyAuthV3.CheckResponse{ + HttpResponse: &pbEnvoyAuthV3.CheckResponse_OkResponse{ + OkResponse: &pbEnvoyAuthV3.OkHttpResponse{}, + }, + }, nil } diff --git a/integrations/envoy/auth/v3/logger.go b/integrations/envoy/auth/v3/logger.go new file mode 100644 index 000000000..26d7ae87d --- /dev/null +++ b/integrations/envoy/auth/v3/logger.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +import "github.com/arangodb/kube-arangodb/pkg/logging" + +var logger = logging.Global().RegisterAndGetLogger("integration-envoy-auth-v3", logging.Info) diff --git a/integrations/envoy/auth/v3/service_test.go b/integrations/envoy/auth/v3/service_test.go index 440182d9d..a1eeb34c3 100644 --- a/integrations/envoy/auth/v3/service_test.go +++ b/integrations/envoy/auth/v3/service_test.go @@ -28,6 +28,7 @@ import ( "github.com/stretchr/testify/require" "github.com/arangodb/kube-arangodb/pkg/util/svc" + "github.com/arangodb/kube-arangodb/pkg/util/tests" "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" ) @@ -53,6 +54,7 @@ func Test_AllowAll(t *testing.T) { require.NoError(t, err) require.NoError(t, resp.Validate()) require.Nil(t, resp.Status) - require.Nil(t, resp.HttpResponse) + require.NotNil(t, resp.HttpResponse) + require.NotNil(t, tests.CastAs[*pbEnvoyAuthV3.CheckResponse_OkResponse](t, resp.GetHttpResponse()).OkResponse) require.Nil(t, resp.DynamicMetadata) } diff --git a/pkg/apis/shared/validate.go b/pkg/apis/shared/validate.go index 2c746f63e..431b5f241 100644 --- a/pkg/apis/shared/validate.go +++ b/pkg/apis/shared/validate.go @@ -180,19 +180,23 @@ func ValidateRequiredInterfacePath[T ValidateInterface](path string, in T) error } // ValidateList validates all elements on the list -func ValidateList[T any](in []T, validator func(T) error) error { - errors := make([]error, len(in)) +func ValidateList[T any](in []T, validator func(T) error, checks ...func(in []T) error) error { + errors := make([]error, len(in)+len(checks)) for id := range in { errors[id] = PrefixResourceError(fmt.Sprintf("[%d]", id), validator(in[id])) } + for id, c := range checks { + errors[len(in)+id] = c(in) + } + return WithErrors(errors...) } // ValidateMap validates all elements on the list -func ValidateMap[T any](in map[string]T, validator func(string, T) error) error { - errors := make([]error, 0, len(in)) +func ValidateMap[T any](in map[string]T, validator func(string, T) error, checks ...func(in map[string]T) error) error { + errors := make([]error, 0, len(in)+len(checks)) for id := range in { if err := PrefixResourceError(fmt.Sprintf("`%s`", id), validator(id, in[id])); err != nil { @@ -200,6 +204,10 @@ func ValidateMap[T any](in map[string]T, validator func(string, T) error) error } } + for id, c := range checks { + errors[len(in)+id] = c(in) + } + return WithErrors(errors...) } diff --git a/pkg/deployment/features/gateway.go b/pkg/deployment/features/gateway.go index 40173ef50..ce2c7b454 100644 --- a/pkg/deployment/features/gateway.go +++ b/pkg/deployment/features/gateway.go @@ -20,6 +20,8 @@ package features +import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + func init() { registerFeature(gateway) } @@ -35,3 +37,7 @@ var gateway = &feature{ func Gateway() Feature { return gateway } + +func IsGatewayEnabled(spec api.DeploymentSpec) bool { + return Gateway().Enabled() && spec.IsGatewayEnabled() +} diff --git a/pkg/deployment/pod/sni-gateway.go b/pkg/deployment/pod/sni-gateway.go new file mode 100644 index 000000000..2bdf15d0b --- /dev/null +++ b/pkg/deployment/pod/sni-gateway.go @@ -0,0 +1,117 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package pod + +import ( + "fmt" + + core "k8s.io/api/core/v1" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" +) + +func SNIGateway() Builder { + return sniGateway{} +} + +type sniGateway struct{} + +func (s sniGateway) Envs(i Input) []core.EnvVar { + return nil +} + +func (s sniGateway) isSupported(i Input) bool { + if !i.Deployment.TLS.IsSecure() { + return false + } + + if !features.Gateway().Supported(i.Version, i.Enterprise) { + // We need 3.7.0+ and Enterprise to support this + return false + } + + return GroupSNISupported(i.Deployment, i.Group) +} + +func (s sniGateway) Verify(i Input, cachedStatus interfaces.Inspector) error { + if !s.isSupported(i) { + return nil + } + + for _, secret := range util.SortKeys(i.Deployment.TLS.GetSNI().Mapping) { + kubeSecret, exists := cachedStatus.Secret().V1().GetSimple(secret) + if !exists { + return errors.Errorf("SNI Secret not found %s", secret) + } + + _, ok := kubeSecret.Data[constants.SecretTLSKeyfile] + if !ok { + return errors.Errorf("Unable to find secret key %s/%s for SNI", secret, constants.SecretTLSKeyfile) + } + } + return nil +} + +func (s sniGateway) Volumes(i Input) ([]core.Volume, []core.VolumeMount) { + if !s.isSupported(i) { + return nil, nil + } + + sni := i.Deployment.TLS.GetSNI() + volumes := make([]core.Volume, 0, len(sni.Mapping)) + volumeMounts := make([]core.VolumeMount, 0, len(sni.Mapping)) + + for _, secret := range util.SortKeys(sni.Mapping) { + secretNameSha := util.SHA256FromString(secret) + + secretNameSha = fmt.Sprintf("sni-%s", secretNameSha[:48]) + + vol := core.Volume{ + Name: secretNameSha, + VolumeSource: core.VolumeSource{ + Secret: &core.SecretVolumeSource{ + SecretName: secret, + }, + }, + } + + volMount := core.VolumeMount{ + Name: secretNameSha, + MountPath: fmt.Sprintf("%s/%s", shared.TLSSNIKeyfileVolumeMountDir, secret), + ReadOnly: true, + } + + volumes = append(volumes, vol) + volumeMounts = append(volumeMounts, volMount) + } + + return volumes, volumeMounts +} + +func (s sniGateway) Args(i Input) k8sutil.OptionPairs { + return nil +} diff --git a/pkg/deployment/pod/sni.go b/pkg/deployment/pod/sni.go index 4b6da103b..74f66e7a2 100644 --- a/pkg/deployment/pod/sni.go +++ b/pkg/deployment/pod/sni.go @@ -21,7 +21,6 @@ package pod import ( - "crypto/sha256" "fmt" core "k8s.io/api/core/v1" @@ -36,12 +35,18 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" ) -func GroupSNISupported(mode api.DeploymentMode, group api.ServerGroup) bool { - switch mode { +func GroupSNISupported(spec api.DeploymentSpec, group api.ServerGroup) bool { + switch spec.Mode.Get() { case api.DeploymentModeCluster: + if features.IsGatewayEnabled(spec) { + return group == api.ServerGroupGateways + } return group == api.ServerGroupCoordinators case api.DeploymentModeSingle: + if features.IsGatewayEnabled(spec) { + return group == api.ServerGroupGateways + } fallthrough case api.DeploymentModeActiveFailover: return group == api.ServerGroupSingle @@ -70,7 +75,7 @@ func (s sni) isSupported(i Input) bool { return false } - return GroupSNISupported(i.Deployment.Mode.Get(), i.Group) + return GroupSNISupported(i.Deployment, i.Group) } func (s sni) Verify(i Input, cachedStatus interfaces.Inspector) error { @@ -102,7 +107,7 @@ func (s sni) Volumes(i Input) ([]core.Volume, []core.VolumeMount) { volumeMounts := make([]core.VolumeMount, 0, len(sni.Mapping)) for _, secret := range util.SortKeys(sni.Mapping) { - secretNameSha := fmt.Sprintf("%0x", sha256.Sum256([]byte(secret))) + secretNameSha := util.SHA256FromString(secret) secretNameSha = fmt.Sprintf("sni-%s", secretNameSha[:48]) diff --git a/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go b/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go index cf76139f2..13178b430 100644 --- a/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go +++ b/pkg/deployment/reconcile/plan_builder_rebalancer_v2.go @@ -45,7 +45,7 @@ func (r *Reconciler) createRebalancerV2GeneratePlan(spec api.DeploymentSpec, sta r.metrics.Rebalancer.SetEnabled(true) - if !status.Members.AllMembersReady(spec.Mode.Get(), spec.Sync.IsEnabled(), features.Gateway().Enabled() && spec.IsGatewayEnabled()) { + if !status.Members.AllMembersReady(spec.Mode.Get(), spec.Sync.IsEnabled(), features.IsGatewayEnabled(spec)) { return nil } diff --git a/pkg/deployment/reconcile/plan_builder_scale.go b/pkg/deployment/reconcile/plan_builder_scale.go index 8ae98d66f..2744263b1 100644 --- a/pkg/deployment/reconcile/plan_builder_scale.go +++ b/pkg/deployment/reconcile/plan_builder_scale.go @@ -70,7 +70,7 @@ func (r *Reconciler) createScaleMemberPlan(ctx context.Context, apiObject k8suti plan = append(plan, r.createScalePlan(status, status.Members.SyncWorkers, api.ServerGroupSyncWorkers, 0, context)...) } } - if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + if features.IsGatewayEnabled(spec) { plan = append(plan, r.createScalePlan(status, status.Members.Gateways, api.ServerGroupGateways, spec.Gateways.GetCount(), context)...) } else { plan = append(plan, r.createScalePlan(status, status.Members.Gateways, api.ServerGroupGateways, 0, context)...) diff --git a/pkg/deployment/reconcile/plan_builder_tls_sni.go b/pkg/deployment/reconcile/plan_builder_tls_sni.go index 0e314fc94..b9dd4ebfc 100644 --- a/pkg/deployment/reconcile/plan_builder_tls_sni.go +++ b/pkg/deployment/reconcile/plan_builder_tls_sni.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -57,7 +57,11 @@ func (r *Reconciler) createRotateTLSServerSNIPlan(ctx context.Context, apiObject var plan api.Plan for _, group := range api.AllServerGroups { - if !pod.GroupSNISupported(spec.Mode.Get(), group) { + if group == api.ServerGroupGateways { + // Gateways are managed differently + continue + } + if !pod.GroupSNISupported(spec, group) { continue } for _, m := range status.Members.MembersOfGroup(group) { diff --git a/pkg/deployment/resources/config_map_gateway.go b/pkg/deployment/resources/config_map_gateway.go index 6f1668696..739474f8e 100644 --- a/pkg/deployment/resources/config_map_gateway.go +++ b/pkg/deployment/resources/config_map_gateway.go @@ -23,6 +23,7 @@ package resources import ( "context" "fmt" + "path" "path/filepath" core "k8s.io/api/core/v1" @@ -65,7 +66,8 @@ func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspec Name: configMapName, }, Data: map[string]string{ - GatewayConfigFileName: string(gatewayCfgYaml), + GatewayConfigFileName: string(gatewayCfgYaml), + GatewayConfigChecksumFileName: gatewayCfgChecksum, }, } @@ -85,11 +87,12 @@ func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspec return errors.Reconcile() } else { // CM Exists, checks checksum - if key is not in the map we return empty string - if existingSha := util.SHA256FromString(cm.Data[GatewayConfigFileName]); existingSha != gatewayCfgChecksum { + if existingSha, existingChecksumSha := util.SHA256FromString(cm.Data[GatewayConfigFileName]), cm.Data[GatewayConfigChecksumFileName]; existingSha != gatewayCfgChecksum || existingChecksumSha != gatewayCfgChecksum { // We need to do the update if _, changed, err := patcher.Patcher[*core.ConfigMap](ctx, cachedStatus.ConfigMapsModInterface().V1(), cm, meta.PatchOptions{}, patcher.PatchConfigMapData(map[string]string{ - GatewayConfigFileName: string(gatewayCfgYaml), + GatewayConfigFileName: string(gatewayCfgYaml), + GatewayConfigChecksumFileName: gatewayCfgChecksum, })); err != nil { log.Err(err).Debug("Failed to patch GatewayConfig ConfigMap") return errors.WithStack(err) @@ -116,6 +119,11 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto var cfg gateway.Config + cfg.IntegrationSidecar = &gateway.ConfigDestinationTarget{ + Host: "127.0.0.1", + Port: int32(r.context.GetSpec().Gateway.GetSidecar().GetListenPort()), + } + cfg.DefaultDestination = gateway.ConfigDestination{ Targets: []gateway.ConfigDestinationTarget{ { @@ -133,6 +141,25 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto PrivateKeyPath: keyPath, } cfg.DefaultDestination.Type = util.NewType(gateway.ConfigDestinationTypeHTTPS) + + // Check SNI + if sni := spec.TLS.GetSNI().Mapping; len(sni) > 0 { + for _, volume := range util.SortKeys(sni) { + servers, ok := sni[volume] + if !ok { + continue + } + + var s gateway.ConfigSNI + f := path.Join(shared.TLSSNIKeyfileVolumeMountDir, volume, constants.SecretTLSKeyfile) + s.ConfigTLS = gateway.ConfigTLS{ + CertificatePath: f, + PrivateKeyPath: f, + } + s.ServerNames = servers + cfg.SNI = append(cfg.SNI, s) + } + } } // Check ArangoRoutes diff --git a/pkg/deployment/resources/config_maps.go b/pkg/deployment/resources/config_maps.go index 29a7f7317..e6fec0239 100644 --- a/pkg/deployment/resources/config_maps.go +++ b/pkg/deployment/resources/config_maps.go @@ -49,7 +49,7 @@ func (r *Resources) EnsureConfigMaps(ctx context.Context, cachedStatus inspector reconcileRequired := k8sutil.NewReconcile(cachedStatus) - if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + if features.IsGatewayEnabled(spec) { counterMetric.Inc() if err := reconcileRequired.WithError(r.ensureGatewayConfig(ctx, cachedStatus, configMaps)); err != nil { return errors.Section(err, "Gateway ConfigMap") diff --git a/pkg/deployment/resources/gateway/consts.go b/pkg/deployment/resources/gateway/consts.go new file mode 100644 index 000000000..a624495df --- /dev/null +++ b/pkg/deployment/resources/gateway/consts.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +const ( + IntegrationSidecarFilterName = "envoy.filters.http.ext_authz" +) diff --git a/pkg/deployment/resources/gateway/gateway_config.go b/pkg/deployment/resources/gateway/gateway_config.go index 465ee41f1..5206aaafd 100644 --- a/pkg/deployment/resources/gateway/gateway_config.go +++ b/pkg/deployment/resources/gateway/gateway_config.go @@ -23,16 +23,23 @@ package gateway import ( "fmt" "sort" + "time" bootstrapAPI "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3" clusterAPI "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + endpointAPI "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" listenerAPI "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" routeAPI "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + httpFilterAuthzApi "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_authz/v3" routerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3" + tlsInspectorApi "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/listener/tls_inspector/v3" httpConnectionManagerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" + upstreamHttpApi "github.com/envoyproxy/go-control-plane/envoy/extensions/upstreams/http/v3" + "github.com/golang/protobuf/ptypes/any" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/durationpb" "sigs.k8s.io/yaml" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" @@ -46,12 +53,18 @@ type Config struct { Destinations ConfigDestinations `json:"destinations,omitempty"` DefaultTLS *ConfigTLS `json:"defaultTLS,omitempty"` + + IntegrationSidecar *ConfigDestinationTarget `json:"integrationSidecar,omitempty"` + + SNI ConfigSNIList `json:"sni,omitempty"` } func (c Config) Validate() error { return errors.Errors( shared.PrefixResourceErrors("defaultDestination", c.DefaultDestination.Validate()), + shared.PrefixResourceErrors("integrationSidecar", c.IntegrationSidecar.Validate()), shared.PrefixResourceErrors("destinations", c.Destinations.Validate()), + shared.PrefixResourceErrors("sni", c.SNI.Validate()), ) } @@ -116,6 +129,41 @@ func (c Config) RenderClusters() ([]*clusterAPI.Cluster, error) { def, } + if i := c.IntegrationSidecar; i != nil { + hpo, err := anypb.New(&upstreamHttpApi.HttpProtocolOptions{ + UpstreamProtocolOptions: &upstreamHttpApi.HttpProtocolOptions_ExplicitHttpConfig_{ + ExplicitHttpConfig: &upstreamHttpApi.HttpProtocolOptions_ExplicitHttpConfig{ + ProtocolConfig: &upstreamHttpApi.HttpProtocolOptions_ExplicitHttpConfig_Http2ProtocolOptions{ + Http2ProtocolOptions: &coreAPI.Http2ProtocolOptions{}, + }, + }, + }, + }) + if err != nil { + return nil, err + } + cluster := &clusterAPI.Cluster{ + Name: "integration_sidecar", + ConnectTimeout: durationpb.New(time.Second), + LbPolicy: clusterAPI.Cluster_ROUND_ROBIN, + LoadAssignment: &endpointAPI.ClusterLoadAssignment{ + ClusterName: "integration_sidecar", + Endpoints: []*endpointAPI.LocalityLbEndpoints{ + { + LbEndpoints: []*endpointAPI.LbEndpoint{ + i.RenderEndpoint(), + }, + }, + }, + }, + TypedExtensionProtocolOptions: map[string]*any.Any{ + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": hpo, + }, + } + + clusters = append(clusters, cluster) + } + for k, v := range c.Destinations { name := fmt.Sprintf("cluster_%s", util.SHA256FromString(k)) c, err := v.RenderCluster(name) @@ -159,6 +207,33 @@ func (c Config) RenderRoutes() ([]*routeAPI.Route, error) { return routes, nil } +func (c Config) RenderIntegrationSidecarFilter() (*httpConnectionManagerAPI.HttpFilter, error) { + e, err := anypb.New(&httpFilterAuthzApi.ExtAuthz{ + Services: &httpFilterAuthzApi.ExtAuthz_GrpcService{ + GrpcService: &coreAPI.GrpcService{ + TargetSpecifier: &coreAPI.GrpcService_EnvoyGrpc_{ + EnvoyGrpc: &coreAPI.GrpcService_EnvoyGrpc{ + ClusterName: "integration_sidecar", + }, + }, + Timeout: durationpb.New(500 * time.Millisecond), + }, + }, + IncludePeerCertificate: true, + }) + if err != nil { + return nil, err + } + + return &httpConnectionManagerAPI.HttpFilter{ + Name: IntegrationSidecarFilterName, + ConfigType: &httpConnectionManagerAPI.HttpFilter_TypedConfig{ + TypedConfig: e, + }, + IsOptional: false, + }, nil +} + func (c Config) RenderFilters() ([]*listenerAPI.Filter, error) { httpFilterConfigType, err := anypb.New(&routerAPI.Router{}) if err != nil { @@ -170,6 +245,16 @@ func (c Config) RenderFilters() ([]*listenerAPI.Filter, error) { return nil, errors.Wrapf(err, "Unable to render routes") } + var httpFilters []*httpConnectionManagerAPI.HttpFilter + + if i := c.IntegrationSidecar; i != nil { + q, err := c.RenderIntegrationSidecarFilter() + if err != nil { + return nil, err + } + httpFilters = append(httpFilters, q) + } + filterConfigType, err := anypb.New(&httpConnectionManagerAPI.HttpConnectionManager{ StatPrefix: "ingress_http", CodecType: httpConnectionManagerAPI.HttpConnectionManager_AUTO, @@ -185,14 +270,13 @@ func (c Config) RenderFilters() ([]*listenerAPI.Filter, error) { }, }, }, - HttpFilters: []*httpConnectionManagerAPI.HttpFilter{ - { - Name: "envoy.filters.http.routerAPI", - ConfigType: &httpConnectionManagerAPI.HttpFilter_TypedConfig{ - TypedConfig: httpFilterConfigType, - }, + HttpFilters: append(httpFilters, &httpConnectionManagerAPI.HttpFilter{ + Name: "envoy.filters.http.routerAPI", + ConfigType: &httpConnectionManagerAPI.HttpFilter_TypedConfig{ + TypedConfig: httpFilterConfigType, }, }, + ), }) if err != nil { return nil, errors.Wrapf(err, "Unable to render http connection manager") @@ -211,7 +295,7 @@ func (c Config) RenderFilters() ([]*listenerAPI.Filter, error) { func (c Config) RenderDefaultFilterChain() (*listenerAPI.FilterChain, error) { filters, err := c.RenderFilters() if err != nil { - return nil, errors.Wrapf(err, "Unable to render filters") + return nil, err } ret := &listenerAPI.FilterChain{ @@ -228,7 +312,16 @@ func (c Config) RenderDefaultFilterChain() (*listenerAPI.FilterChain, error) { } func (c Config) RenderSecondaryFilterChains() ([]*listenerAPI.FilterChain, error) { - return nil, nil + if len(c.SNI) == 0 { + return nil, nil + } + + filters, err := c.RenderFilters() + if err != nil { + return nil, err + } + + return c.SNI.RenderFilterChain(filters) } func (c Config) RenderListener() (*listenerAPI.Listener, error) { @@ -242,6 +335,22 @@ func (c Config) RenderListener() (*listenerAPI.Listener, error) { return nil, errors.Wrapf(err, "Unable to render default filter") } + var listenerFilters []*listenerAPI.ListenerFilter + + if c.DefaultTLS != nil { + w, err := anypb.New(&tlsInspectorApi.TlsInspector{}) + if err != nil { + return nil, errors.Wrapf(err, "Unable to render TLS Inspector") + } + + listenerFilters = append(listenerFilters, &listenerAPI.ListenerFilter{ + Name: "envoy.filters.listener.tls_inspector", + ConfigType: &listenerAPI.ListenerFilter_TypedConfig{ + TypedConfig: w, + }, + }) + } + return &listenerAPI.Listener{ Name: "default", Address: &coreAPI.Address{ @@ -252,8 +361,8 @@ func (c Config) RenderListener() (*listenerAPI.Listener, error) { }, }, }, - FilterChains: filterChains, - + FilterChains: filterChains, + ListenerFilters: listenerFilters, DefaultFilterChain: defaultFilterChain, }, nil } diff --git a/pkg/deployment/resources/gateway/gateway_config_destination.go b/pkg/deployment/resources/gateway/gateway_config_destination.go index 29dbcace1..f8ee81c63 100644 --- a/pkg/deployment/resources/gateway/gateway_config_destination.go +++ b/pkg/deployment/resources/gateway/gateway_config_destination.go @@ -26,6 +26,7 @@ import ( clusterAPI "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" endpointAPI "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" routeAPI "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + anypb "github.com/golang/protobuf/ptypes/any" "google.golang.org/protobuf/types/known/durationpb" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" @@ -63,7 +64,10 @@ type ConfigDestination struct { Path *string `json:"path,omitempty"` } -func (c ConfigDestination) Validate() error { +func (c *ConfigDestination) Validate() error { + if c == nil { + c = &ConfigDestination{} + } return shared.WithErrors( shared.PrefixResourceError("targets", c.Targets.Validate()), shared.PrefixResourceError("type", c.Type.Validate()), @@ -71,15 +75,15 @@ func (c ConfigDestination) Validate() error { ) } -func (c ConfigDestination) GetPath() string { - if c.Path == nil { +func (c *ConfigDestination) GetPath() string { + if c == nil || c.Path == nil { return "/" } return *c.Path } -func (c ConfigDestination) RenderRoute(name, prefix string) (*routeAPI.Route, error) { +func (c *ConfigDestination) RenderRoute(name, prefix string) (*routeAPI.Route, error) { return &routeAPI.Route{ Match: &routeAPI.RouteMatch{ PathSpecifier: &routeAPI.RouteMatch_Prefix{ @@ -94,10 +98,11 @@ func (c ConfigDestination) RenderRoute(name, prefix string) (*routeAPI.Route, er PrefixRewrite: c.GetPath(), }, }, + TypedPerFilterConfig: map[string]*anypb.Any{}, }, nil } -func (c ConfigDestination) RenderCluster(name string) (*clusterAPI.Cluster, error) { +func (c *ConfigDestination) RenderCluster(name string) (*clusterAPI.Cluster, error) { cluster := &clusterAPI.Cluster{ Name: name, ConnectTimeout: durationpb.New(time.Second), diff --git a/pkg/deployment/resources/gateway/gateway_config_destination_target.go b/pkg/deployment/resources/gateway/gateway_config_destination_target.go index 4f2d974c9..74227a22d 100644 --- a/pkg/deployment/resources/gateway/gateway_config_destination_target.go +++ b/pkg/deployment/resources/gateway/gateway_config_destination_target.go @@ -54,7 +54,10 @@ type ConfigDestinationTarget struct { Port int32 `json:"port,omitempty"` } -func (c ConfigDestinationTarget) Validate() error { +func (c *ConfigDestinationTarget) Validate() error { + if c == nil { + return nil + } return shared.WithErrors( shared.ValidateRequiredPath("ip", &c.Host, func(t string) error { if t == "" { @@ -71,7 +74,10 @@ func (c ConfigDestinationTarget) Validate() error { ) } -func (c ConfigDestinationTarget) RenderEndpoint() *endpointAPI.LbEndpoint { +func (c *ConfigDestinationTarget) RenderEndpoint() *endpointAPI.LbEndpoint { + if c == nil { + return nil + } return &endpointAPI.LbEndpoint{ HostIdentifier: &endpointAPI.LbEndpoint_Endpoint{ Endpoint: &endpointAPI.Endpoint{ diff --git a/pkg/deployment/resources/gateway/gateway_config_sni.go b/pkg/deployment/resources/gateway/gateway_config_sni.go new file mode 100644 index 000000000..6eae003ab --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_config_sni.go @@ -0,0 +1,82 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + listenerAPI "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type ConfigSNIList []ConfigSNI + +func (c ConfigSNIList) RenderFilterChain(filters []*listenerAPI.Filter) ([]*listenerAPI.FilterChain, error) { + var r = make([]*listenerAPI.FilterChain, len(filters)) + for id := range filters { + if f, err := c[id].RenderFilterChain(filters); err != nil { + return nil, err + } else { + r[id] = f + } + } + return r, nil +} + +func (c ConfigSNIList) Validate() error { + return shared.ValidateList(c, func(sni ConfigSNI) error { + return sni.Validate() + }) +} + +type ConfigSNI struct { + ConfigTLS `json:",inline"` + + ServerNames []string `json:"serverNames,omitempty"` +} + +func (c ConfigSNI) RenderFilterChain(filters []*listenerAPI.Filter) (*listenerAPI.FilterChain, error) { + transport, err := c.RenderListenerTransportSocket() + if err != nil { + return nil, err + } + + return &listenerAPI.FilterChain{ + TransportSocket: transport, + FilterChainMatch: &listenerAPI.FilterChainMatch{ + ServerNames: util.CopyList(c.ServerNames), + }, + Filters: filters, + }, nil +} + +func (c ConfigSNI) Validate() error { + return shared.WithErrors( + shared.ValidateList(c.ServerNames, sharedApi.IsValidDomain, func(in []string) error { + if len(in) == 0 { + return errors.Errorf("AtLeast one element required on list") + } + return nil + }), + ) +} diff --git a/pkg/deployment/resources/gateway/gateway_config_test.go b/pkg/deployment/resources/gateway/gateway_config_test.go index d8655f03f..0d0a86599 100644 --- a/pkg/deployment/resources/gateway/gateway_config_test.go +++ b/pkg/deployment/resources/gateway/gateway_config_test.go @@ -147,4 +147,45 @@ func Test_GatewayConfig(t *testing.T) { }, }) }) + t.Run("Default", func(t *testing.T) { + renderAndPrintGatewayConfig(t, Config{ + DefaultDestination: ConfigDestination{ + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12345, + }, + }, + Path: util.NewType("/test/path/"), + Type: util.NewType(ConfigDestinationTypeHTTPS), + }, + DefaultTLS: &ConfigTLS{ + CertificatePath: "/test", + PrivateKeyPath: "/test12", + }, + SNI: []ConfigSNI{ + { + ConfigTLS: ConfigTLS{ + CertificatePath: "/cp", + PrivateKeyPath: "/pp", + }, + ServerNames: []string{ + "example.com", + }, + }, + }, + Destinations: ConfigDestinations{ + "/_test/": { + Targets: []ConfigDestinationTarget{ + { + Host: "127.0.0.1", + Port: 12346, + }, + }, + Path: util.NewType("/test/path/"), + Type: util.NewType(ConfigDestinationTypeHTTP), + }, + }, + }) + }) } diff --git a/pkg/deployment/resources/pdbs.go b/pkg/deployment/resources/pdbs.go index 36530396c..abd10ed79 100644 --- a/pkg/deployment/resources/pdbs.go +++ b/pkg/deployment/resources/pdbs.go @@ -74,7 +74,7 @@ func (r *Resources) EnsurePDBs(ctx context.Context) error { } minGateways, currGateways := 0, 0 - if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + if features.IsGatewayEnabled(spec) { minGateways = spec.GetServerGroupSpec(api.ServerGroupGateways).New().GetCount() - 1 currGateways = status.Members.Gateways.MembersReady() } diff --git a/pkg/deployment/resources/pod_creator_gateway.go b/pkg/deployment/resources/pod_creator_gateway.go index 993e6f820..55df1a4b3 100644 --- a/pkg/deployment/resources/pod_creator_gateway.go +++ b/pkg/deployment/resources/pod_creator_gateway.go @@ -30,11 +30,13 @@ import ( ) const ( - ArangoGatewayExecutor string = "/usr/local/bin/envoy" - GatewayVolumeMountDir = "/etc/gateway/" - GatewayVolumeName = "gateway" - GatewayConfigFileName = "gateway.yaml" - GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName + ArangoGatewayExecutor string = "/usr/local/bin/envoy" + GatewayVolumeMountDir = "/etc/gateway/" + GatewayVolumeName = "gateway" + GatewayConfigFileName = "gateway.yaml" + GatewayConfigChecksumFileName = "gateway.checksum" + GatewayConfigChecksumENV = "GATEWAY_CONFIG_CHECKSUM" + GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName ) func GetGatewayConfigMapName(name string) string { @@ -50,6 +52,9 @@ func createGatewayVolumes(input pod.Input) pod.Volumes { // TLS volumes.Append(pod.TLS(), input) + // SNI + volumes.Append(pod.SNIGateway(), input) + return volumes } diff --git a/pkg/deployment/resources/pod_creator_gateway_container.go b/pkg/deployment/resources/pod_creator_gateway_container.go index 6510b4e72..cc4a3767c 100644 --- a/pkg/deployment/resources/pod_creator_gateway_container.go +++ b/pkg/deployment/resources/pod_creator_gateway_container.go @@ -131,6 +131,19 @@ func (a *ArangoGatewayContainer) GetEnvs() ([]core.EnvVar, []core.EnvFromSource) envs.Add(true, k8sutil.GetLifecycleEnv()...) + var cmChecksum = "" + + if cm, ok := a.cachedStatus.ConfigMap().V1().GetSimple(GetGatewayConfigMapName(a.input.ApiObject.GetName())); ok { + if v, ok := cm.Data[GatewayConfigChecksumFileName]; ok { + cmChecksum = v + } + } + + envs.Add(true, core.EnvVar{ + Name: GatewayConfigChecksumENV, + Value: cmChecksum, + }) + if len(a.groupSpec.Envs) > 0 { for _, env := range a.groupSpec.Envs { // Do not override preset envs diff --git a/pkg/deployment/resources/pod_creator_gateway_pod.go b/pkg/deployment/resources/pod_creator_gateway_pod.go index 75daaaf92..5f8fc16bf 100644 --- a/pkg/deployment/resources/pod_creator_gateway_pod.go +++ b/pkg/deployment/resources/pod_creator_gateway_pod.go @@ -192,7 +192,13 @@ func (m *MemberGatewayPod) Init(ctx context.Context, cachedStatus interfaces.Ins return nil } -func (m *MemberGatewayPod) Validate(_ interfaces.Inspector) error { +func (m *MemberGatewayPod) Validate(cachedStatus interfaces.Inspector) error { + i := m.AsInput() + + if err := pod.SNI().Verify(i, cachedStatus); err != nil { + return err + } + if err := validateSidecars(m.groupSpec.SidecarCoreNames, m.groupSpec.GetSidecars()); err != nil { return err } @@ -232,7 +238,9 @@ func (m *MemberGatewayPod) Labels() map[string]string { func (m *MemberGatewayPod) Profiles() (schedulerApi.ProfileTemplates, error) { integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ Image: util.NewType(m.resources.context.GetOperatorImage()), - }, m.spec.Gateway.GetSidecar(), []string{shared.ServerContainerName}) + }, m.spec.Gateway.GetSidecar(), []string{shared.ServerContainerName}, sidecar.IntegrationEnvoyV3{ + Spec: m.spec, + }) if err != nil { return nil, err diff --git a/pkg/deployment/resources/pod_inspector.go b/pkg/deployment/resources/pod_inspector.go index 1a51f28e3..1d6e2e3b8 100644 --- a/pkg/deployment/resources/pod_inspector.go +++ b/pkg/deployment/resources/pod_inspector.go @@ -531,7 +531,7 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter } spec := r.context.GetSpec() - allMembersReady := status.Members.AllMembersReady(spec.GetMode(), r.context.IsSyncEnabled(), features.Gateway().Enabled() && spec.IsGatewayEnabled()) + allMembersReady := status.Members.AllMembersReady(spec.GetMode(), r.context.IsSyncEnabled(), features.IsGatewayEnabled(spec)) status.Conditions.Update(api.ConditionTypeReady, allMembersReady, "", "") // Update conditions diff --git a/pkg/deployment/resources/services.go b/pkg/deployment/resources/services.go index a040f6f9b..6e691e41a 100644 --- a/pkg/deployment/resources/services.go +++ b/pkg/deployment/resources/services.go @@ -82,7 +82,7 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn defer metrics.SetDuration(inspectServicesDurationGauges.WithLabelValues(deploymentName), start) counterMetric := inspectedServicesCounters.WithLabelValues(deploymentName) - if features.Gateway().Enabled() && spec.IsGatewayEnabled() { + if features.IsGatewayEnabled(spec) { role = api.ServerGroupGateways.AsRole() } diff --git a/pkg/integrations/sidecar/core.go b/pkg/integrations/sidecar/core.go index fc61f232b..a79132cf2 100644 --- a/pkg/integrations/sidecar/core.go +++ b/pkg/integrations/sidecar/core.go @@ -24,6 +24,7 @@ import ( "fmt" "strings" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) @@ -50,10 +51,12 @@ func (c *Core) GetExternal() bool { func (c *Core) Args(int Integration) k8sutil.OptionPairs { var options k8sutil.OptionPairs - name, ver := int.Name() + cmd := strings.Join(util.FormatList(int.Name(), func(a string) string { + return strings.ToLower(a) + }), ".") - options.Add(fmt.Sprintf("--integration.%s.%s.internal", strings.ToLower(name), strings.ToLower(ver)), c.GetInternal()) - options.Add(fmt.Sprintf("--integration.%s.%s.external", strings.ToLower(name), strings.ToLower(ver)), c.GetExternal()) + options.Add(fmt.Sprintf("--integration.%s.internal", cmd), c.GetInternal()) + options.Add(fmt.Sprintf("--integration.%s.external", cmd), c.GetExternal()) return options } diff --git a/pkg/integrations/sidecar/integration.authentication.v1.go b/pkg/integrations/sidecar/integration.authentication.v1.go index 7fc742fa6..a51df0c78 100644 --- a/pkg/integrations/sidecar/integration.authentication.v1.go +++ b/pkg/integrations/sidecar/integration.authentication.v1.go @@ -37,8 +37,8 @@ type IntegrationAuthenticationV1 struct { Deployment *api.ArangoDeployment } -func (i IntegrationAuthenticationV1) Name() (string, string) { - return "AUTHENTICATION", "V1" +func (i IntegrationAuthenticationV1) Name() []string { + return []string{"AUTHENTICATION", "V1"} } func (i IntegrationAuthenticationV1) Validate() error { diff --git a/pkg/integrations/sidecar/integration.authorization.v1.go b/pkg/integrations/sidecar/integration.authorization.v1.go index 76fbe8b67..a94653e7f 100644 --- a/pkg/integrations/sidecar/integration.authorization.v1.go +++ b/pkg/integrations/sidecar/integration.authorization.v1.go @@ -28,8 +28,8 @@ type IntegrationAuthorizationV0 struct { Core *Core } -func (i IntegrationAuthorizationV0) Name() (string, string) { - return "AUTHORIZATION", "V0" +func (i IntegrationAuthorizationV0) Name() []string { + return []string{"AUTHORIZATION", "V0"} } func (i IntegrationAuthorizationV0) Validate() error { diff --git a/pkg/integrations/sidecar/integration.envoy.v3.go b/pkg/integrations/sidecar/integration.envoy.v3.go index 08f626871..e8509eeb7 100644 --- a/pkg/integrations/sidecar/integration.envoy.v3.go +++ b/pkg/integrations/sidecar/integration.envoy.v3.go @@ -22,34 +22,26 @@ package sidecar import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) type IntegrationEnvoyV3 struct { - Core *Core - Deployment *api.ArangoDeployment + Core *Core + Spec api.DeploymentSpec } -func (i IntegrationEnvoyV3) Name() (string, string) { - return "ENVOY", "V3" +func (i IntegrationEnvoyV3) Name() []string { + return []string{"ENVOY", "AUTH", "V3"} } func (i IntegrationEnvoyV3) Validate() error { - if i.Deployment == nil { - return errors.Errorf("Deployment is nil") - } - return nil } func (i IntegrationEnvoyV3) Args() (k8sutil.OptionPairs, error) { options := k8sutil.CreateOptionPairs() - options.Add("--integration.authentication.v1", true) - options.Add("--integration.authentication.v1.enabled", i.Deployment.GetAcceptedSpec().IsAuthenticated()) - options.Add("--integration.authentication.v1.path", shared.ClusterJWTSecretVolumeMountDir) + options.Add("--integration.envoy.auth.v3", true) options.Merge(i.Core.Args(i)) diff --git a/pkg/integrations/sidecar/integration.go b/pkg/integrations/sidecar/integration.go index 53146ff0e..0512fc8cb 100644 --- a/pkg/integrations/sidecar/integration.go +++ b/pkg/integrations/sidecar/integration.go @@ -55,7 +55,7 @@ type IntegrationVolumes interface { } type Integration interface { - Name() (string, string) + Name() []string Args() (k8sutil.OptionPairs, error) Validate() error } @@ -63,9 +63,9 @@ type Integration interface { func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *schedulerApi.IntegrationSidecar, coreContainers []string, integrations ...Integration) (*schedulerApi.ProfileTemplate, error) { for _, integration := range integrations { if err := integration.Validate(); err != nil { - name, version := integration.Name() + name := strings.Join(integration.Name(), "/") - return nil, errors.Wrapf(err, "Failure in %s/%s", name, version) + return nil, errors.Wrapf(err, "Failure in %s", name) } } @@ -100,33 +100,35 @@ func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *sc } for _, i := range integrations { - name, version := i.Name() + name := strings.Join(i.Name(), "/") if err := i.Validate(); err != nil { - return nil, errors.Wrapf(err, "Failure in %s/%s", name, version) + return nil, errors.Wrapf(err, "Failure in %s", name) } if args, err := i.Args(); err != nil { - return nil, errors.Wrapf(err, "Failure in arguments %s/%s", name, version) + return nil, errors.Wrapf(err, "Failure in arguments %s", name) } else if len(args) > 0 { options.Merge(args) } if lvolumes, lvolumeMounts, err := WithIntegrationVolumes(i); err != nil { - return nil, errors.Wrapf(err, "Failure in volumes %s/%s", name, version) + return nil, errors.Wrapf(err, "Failure in volumes %s", name) } else if len(lvolumes) > 0 || len(lvolumeMounts) > 0 { volumes = append(volumes, lvolumes...) volumeMounts = append(volumeMounts, lvolumeMounts...) } if lenvs, err := WithIntegrationEnvs(i); err != nil { - return nil, errors.Wrapf(err, "Failure in envs %s/%s", name, version) + return nil, errors.Wrapf(err, "Failure in envs %s", name) } else if len(lenvs) > 0 { envs = append(envs, lenvs...) } envs = append(envs, core.EnvVar{ - Name: fmt.Sprintf("INTEGRATION_SERVICE_%s_%s", strings.ToUpper(name), strings.ToUpper(version)), + Name: fmt.Sprintf("INTEGRATION_SERVICE_%s", strings.Join(util.FormatList(i.Name(), func(a string) string { + return strings.ToUpper(a) + }), "_")), Value: fmt.Sprintf("127.0.0.1:%d", integration.GetListenPort()), }) } diff --git a/pkg/integrations/sidecar/integration.shutdown.v1.go b/pkg/integrations/sidecar/integration.shutdown.v1.go index f8752c6d2..c990cf7a7 100644 --- a/pkg/integrations/sidecar/integration.shutdown.v1.go +++ b/pkg/integrations/sidecar/integration.shutdown.v1.go @@ -28,8 +28,8 @@ type IntegrationShutdownV1 struct { Core *Core } -func (i IntegrationShutdownV1) Name() (string, string) { - return "SHUTDOWN", "V1" +func (i IntegrationShutdownV1) Name() []string { + return []string{"SHUTDOWN", "V1"} } func (i IntegrationShutdownV1) Validate() error { diff --git a/pkg/util/k8sutil/interfaces/pod_creator.go b/pkg/util/k8sutil/interfaces/pod_creator.go index 2bfe75934..577302ede 100644 --- a/pkg/util/k8sutil/interfaces/pod_creator.go +++ b/pkg/util/k8sutil/interfaces/pod_creator.go @@ -26,6 +26,7 @@ import ( core "k8s.io/api/core/v1" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" ) @@ -33,6 +34,7 @@ import ( type Inspector interface { secret.Inspector service.Inspector + configmap.Inspector } type PodModifier interface { diff --git a/pkg/util/list.go b/pkg/util/list.go index d58b2c6dc..2046e4ee8 100644 --- a/pkg/util/list.go +++ b/pkg/util/list.go @@ -101,3 +101,9 @@ func FormatListErr[A, B any](in []A, format func(A) (B, error)) ([]B, error) { return r, nil } + +func CopyList[A any](in []A) []A { + ret := make([]A, len(in)) + copy(ret, in) + return ret +} diff --git a/pkg/util/tests/cast.go b/pkg/util/tests/cast.go new file mode 100644 index 000000000..e0bda955b --- /dev/null +++ b/pkg/util/tests/cast.go @@ -0,0 +1,33 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package tests + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func CastAs[A any](t *testing.T, in any) A { + v, ok := in.(A) + require.True(t, ok) + return v +} From 81dfd875666925c1a3bd66e803fcbb3eed2f5fe4 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:02:24 +0200 Subject: [PATCH 25/50] [Maintenance] Bump ArangoDB to 3.12 in examples (#1713) --- CHANGELOG.md | 1 + examples/cluster1-with-sync.yaml | 2 +- examples/cluster2-with-sync.yaml | 2 +- examples/production-cluster-with-metrics.yaml | 2 +- examples/production-cluster.yaml | 2 +- examples/reboot-pod.yaml | 2 +- examples/simple-cluster-with-metrics.yaml | 2 +- examples/simple-cluster.yaml | 2 +- examples/single-server.yaml | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b34d2d0..4b1a550f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - (Feature) Improve Gateway Config gen - (Feature) Integration Service TLS - (Feature) (Gateway) SNI and Authz support +- (Maintenance) Bump Examples to ArangoDB 3.12 ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/examples/cluster1-with-sync.yaml b/examples/cluster1-with-sync.yaml index 28e173856..4c85b4bff 100644 --- a/examples/cluster1-with-sync.yaml +++ b/examples/cluster1-with-sync.yaml @@ -4,7 +4,7 @@ metadata: name: "cluster1-with-sync" spec: mode: Cluster - image: 'arangodb/arangodb:3.10.8' + image: 'arangodb/arangodb:3.12.2' tls: altNames: ["kube-01", "kube-02", "kube-03"] sync: diff --git a/examples/cluster2-with-sync.yaml b/examples/cluster2-with-sync.yaml index 2b11e0d25..c4180e602 100644 --- a/examples/cluster2-with-sync.yaml +++ b/examples/cluster2-with-sync.yaml @@ -4,7 +4,7 @@ metadata: name: "cluster2-with-sync" spec: mode: Cluster - image: 'arangodb/arangodb:3.10.8' + image: 'arangodb/arangodb:3.12.2' tls: altNames: ["kube-01", "kube-02", "kube-03"] sync: diff --git a/examples/production-cluster-with-metrics.yaml b/examples/production-cluster-with-metrics.yaml index d04b4f9ae..d03b6b4c0 100644 --- a/examples/production-cluster-with-metrics.yaml +++ b/examples/production-cluster-with-metrics.yaml @@ -13,5 +13,5 @@ spec: prometheus.io/port: '9101' prometheus.io/scrape_interval: '5s' mode: Cluster - image: 'arangodb/arangodb:3.10.8' + image: 'arangodb/arangodb:3.12.2' environment: Production diff --git a/examples/production-cluster.yaml b/examples/production-cluster.yaml index 44aec8847..4b95c8716 100644 --- a/examples/production-cluster.yaml +++ b/examples/production-cluster.yaml @@ -4,5 +4,5 @@ metadata: name: "production-cluster" spec: mode: Cluster - image: 'arangodb/arangodb:3.10.8' + image: 'arangodb/arangodb:3.12.2' environment: Production diff --git a/examples/reboot-pod.yaml b/examples/reboot-pod.yaml index 2eb730071..34fd6ec09 100644 --- a/examples/reboot-pod.yaml +++ b/examples/reboot-pod.yaml @@ -11,7 +11,7 @@ spec: command: ["arangodb_operator", "reboot"] args: - --deployment-name=my-arangodb-cluster - - --image-name=arangodb/enterprise:3.10.8 + - --image-name=arangodb/enterprise:3.12.2 - --license-secret-name=arangodb-license-key - --coordinators=3 - pvc-9aa241f7-df94-11e9-b74c-42010aac0044 diff --git a/examples/simple-cluster-with-metrics.yaml b/examples/simple-cluster-with-metrics.yaml index d4f64e713..36a94a69a 100644 --- a/examples/simple-cluster-with-metrics.yaml +++ b/examples/simple-cluster-with-metrics.yaml @@ -13,4 +13,4 @@ spec: prometheus.io/port: '9101' prometheus.io/scrape_interval: '5s' mode: Cluster - image: 'arangodb/arangodb:3.10.8' + image: 'arangodb/arangodb:3.12.2' diff --git a/examples/simple-cluster.yaml b/examples/simple-cluster.yaml index a5601c125..be7f42cf8 100644 --- a/examples/simple-cluster.yaml +++ b/examples/simple-cluster.yaml @@ -4,4 +4,4 @@ metadata: name: "example-simple-cluster" spec: mode: Cluster - image: 'arangodb/arangodb:3.10.8' + image: 'arangodb/arangodb:3.12.2' diff --git a/examples/single-server.yaml b/examples/single-server.yaml index 8fc6dda61..59197993a 100644 --- a/examples/single-server.yaml +++ b/examples/single-server.yaml @@ -4,4 +4,4 @@ metadata: name: "example-simple-single" spec: mode: Single - image: 'arangodb/arangodb:3.10.8' + image: 'arangodb/arangodb:3.12.2' From fb2ac883ae7d826612e6a0cde4b26b38d94050ca Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:50:59 +0200 Subject: [PATCH 26/50] [Feature] [Gateway] ArangoDB AuthIntegration (#1715) --- CHANGELOG.md | 1 + cmd/version.go | 7 +- docs/api/ArangoRoute.V1Alpha1.md | 14 ++- integrations/envoy/auth/v3/check.go | 46 ++++++++++ integrations/envoy/auth/v3/check_adb_jwt.go | 60 ++++++++++++ integrations/envoy/auth/v3/consts.go | 14 +++ integrations/envoy/auth/v3/impl.go | 92 ++++++++++++++++++- integrations/envoy/auth/v3/response.go | 85 +++++++++++++++++ integrations/envoy/auth/v3/service_test.go | 27 +++++- .../v1alpha1/route_spec_authentication.go | 62 +++++++++++++ .../v1alpha1/route_spec_destination.go | 12 +++ .../route_spec_destination_authentication.go | 47 ++++++++++ .../v1alpha1/route_status_target.go | 5 +- .../route_status_target_authentication.go | 34 +++++++ .../v1alpha1/zz_generated.deepcopy.go | 47 +++++++++- .../networking-route.schema.generated.yaml | 6 ++ .../resources/config_map_gateway.go | 7 ++ .../gateway/gateway_authz_extension.go | 67 ++++++++++++++ .../gateway/gateway_config_destination.go | 16 +++- .../gateway/gateway_filter_extension.go | 58 ++++++++++++ .../resources/pod_creator_gateway_pod.go | 10 +- .../networking/route/handler_destination.go | 4 + pkg/integrations/authentication_v1.go | 6 +- pkg/integrations/authorization_v0.go | 6 +- pkg/integrations/config_v1.go | 6 +- pkg/integrations/envoy_auth_v3.go | 22 ++++- pkg/integrations/integration.go | 2 +- pkg/integrations/register.go | 5 +- pkg/integrations/scheduler_v1.go | 6 +- pkg/integrations/shutdown_v1.go | 6 +- .../sidecar/integration.authentication.v1.go | 17 ++-- pkg/integrations/storage_v1.go | 6 +- pkg/integrations/tls_test.go | 4 +- pkg/util/dict.go | 9 ++ pkg/util/errors/panics/recovery.go | 16 +++- pkg/version/version.go | 7 +- 36 files changed, 792 insertions(+), 47 deletions(-) create mode 100644 integrations/envoy/auth/v3/check.go create mode 100644 integrations/envoy/auth/v3/check_adb_jwt.go create mode 100644 integrations/envoy/auth/v3/response.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_authentication.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go create mode 100644 pkg/apis/networking/v1alpha1/route_status_target_authentication.go create mode 100644 pkg/deployment/resources/gateway/gateway_authz_extension.go create mode 100644 pkg/deployment/resources/gateway/gateway_filter_extension.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1a550f0..3c076e232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - (Feature) Integration Service TLS - (Feature) (Gateway) SNI and Authz support - (Maintenance) Bump Examples to ArangoDB 3.12 +- (Feature) (Gateway) ArangoDB JWT Auth Integration ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/cmd/version.go b/cmd/version.go index fb4c9d920..f489ec786 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,8 +21,6 @@ package cmd import ( - "fmt" - "github.com/spf13/cobra" "github.com/arangodb/kube-arangodb/pkg/version" @@ -38,6 +36,5 @@ var cmdVersion = &cobra.Command{ } func versionRun(cmd *cobra.Command, args []string) { - v := version.GetVersionV1() - println(fmt.Sprintf("Version: %s %s, Build: %s, Go: %s, Build Date: %s", v.Edition.Title(), v.Version, v.Build, v.GoVersion, v.BuildDate)) + println(version.GetVersionV1().String()) } diff --git a/docs/api/ArangoRoute.V1Alpha1.md b/docs/api/ArangoRoute.V1Alpha1.md index e69bf4c81..b083aa436 100644 --- a/docs/api/ArangoRoute.V1Alpha1.md +++ b/docs/api/ArangoRoute.V1Alpha1.md @@ -16,6 +16,12 @@ Deployment specifies the ArangoDeployment object name *** +### .spec.destination.authentication.type + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L28) + +*** + ### .spec.destination.path Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L36) @@ -131,6 +137,12 @@ UID keeps the information about object UID *** +### .status.target.authentication.type + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_authentication.go#L26) + +*** + ### .status.target.destinations\[int\].host Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_destination.go#L38) @@ -145,7 +157,7 @@ Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. ### .status.target.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L37) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L40) Path specifies request path override diff --git a/integrations/envoy/auth/v3/check.go b/integrations/envoy/auth/v3/check.go new file mode 100644 index 000000000..c462276fe --- /dev/null +++ b/integrations/envoy/auth/v3/check.go @@ -0,0 +1,46 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +import ( + "context" + + pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" +) + +type AuthResponse struct { + Username string +} + +type AuthRequestFunc func(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest, current *AuthResponse) (*AuthResponse, error) + +func MergeAuthRequest(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest, requests ...AuthRequestFunc) (*AuthResponse, error) { + var resp *AuthResponse + for _, r := range requests { + if v, err := r(ctx, request, resp); err != nil { + return nil, err + } else { + resp = v + } + } + + return resp, nil +} diff --git a/integrations/envoy/auth/v3/check_adb_jwt.go b/integrations/envoy/auth/v3/check_adb_jwt.go new file mode 100644 index 000000000..fc96d9ba4 --- /dev/null +++ b/integrations/envoy/auth/v3/check_adb_jwt.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +import ( + "context" + + pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" + + pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/strings" +) + +func (i *impl) checkADBJWT(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest, current *AuthResponse) (*AuthResponse, error) { + if current != nil { + // Already authenticated + return current, nil + } + if auth, ok := request.GetAttributes().GetRequest().GetHttp().GetHeaders()["authorization"]; ok { + parts := strings.SplitN(auth, " ", 2) + if len(parts) == 2 { + if strings.ToLower(parts[0]) == "bearer" { + resp, err := i.authClient.Validate(ctx, &pbAuthenticationV1.ValidateRequest{ + Token: parts[1], + }) + if err != nil { + logger.Err(err).Warn("Auth failure") + return nil, nil + } + + if err == nil && resp.GetIsValid() { + // All went fine! + return &AuthResponse{ + Username: resp.GetDetails().GetUser(), + }, nil + } + } + } + } + + return nil, nil +} diff --git a/integrations/envoy/auth/v3/consts.go b/integrations/envoy/auth/v3/consts.go index 7cd7c3413..ae414cd3e 100644 --- a/integrations/envoy/auth/v3/consts.go +++ b/integrations/envoy/auth/v3/consts.go @@ -22,4 +22,18 @@ package v3 const ( Name = "envoy.auth.v3" + + AuthConfigKeywordTrue = "true" + AuthConfigKeywordFalse = "false" + + AuthConfigNamespace = "platform.arangodb.com" + AuthConfigAuthNamespace = "auth." + AuthConfigNamespace + + AuthConfigTypeKey = AuthConfigNamespace + "/type" + AuthConfigTypeValue = "ArangoDBPlatform" + + AuthConfigAuthRequiredKey = AuthConfigAuthNamespace + "/required" + + AuthUsernameHeader = "arangodb-platform-user" + AuthAuthenticatedHeader = "arangodb-platform-authenticated" ) diff --git a/integrations/envoy/auth/v3/impl.go b/integrations/envoy/auth/v3/impl.go index c3930b08b..7c6a96bf7 100644 --- a/integrations/envoy/auth/v3/impl.go +++ b/integrations/envoy/auth/v3/impl.go @@ -22,15 +22,23 @@ package v3 import ( "context" + "net/http" + corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" "google.golang.org/grpc" + pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/errors/panics" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) -func New() svc.Handler { - return &impl{} +func New(authClient pbAuthenticationV1.AuthenticationV1Client) svc.Handler { + return &impl{ + authClient: authClient, + } } var _ pbEnvoyAuthV3.AuthorizationServer = &impl{} @@ -38,6 +46,8 @@ var _ svc.Handler = &impl{} type impl struct { pbEnvoyAuthV3.UnimplementedAuthorizationServer + + authClient pbAuthenticationV1.AuthenticationV1Client } func (i *impl) Name() string { @@ -53,10 +63,84 @@ func (i *impl) Register(registrar *grpc.Server) { } func (i *impl) Check(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest) (*pbEnvoyAuthV3.CheckResponse, error) { - logger.Info("Request Received") + resp, err := panics.RecoverO1(func() (*pbEnvoyAuthV3.CheckResponse, error) { + return i.check(ctx, request) + }) + + if err != nil { + var v DeniedResponse + if errors.As(err, &v) { + return v.GetCheckResponse() + } + return nil, err + } + return resp, nil +} + +func (i *impl) check(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest) (*pbEnvoyAuthV3.CheckResponse, error) { + ext := request.GetAttributes().GetContextExtensions() + + if v, ok := ext[AuthConfigTypeKey]; !ok || v != AuthConfigTypeValue { + return nil, DeniedResponse{ + Code: http.StatusBadRequest, + Message: &DeniedMessage{ + Message: "Auth plugin is not enabled for this request", + }, + } + } + + authenticated, err := MergeAuthRequest(ctx, request, i.checkADBJWT) + if err != nil { + return nil, err + } + + if util.Optional(ext, AuthConfigAuthRequiredKey, AuthConfigKeywordFalse) == AuthConfigKeywordTrue && authenticated == nil { + return nil, DeniedResponse{ + Code: http.StatusUnauthorized, + Message: &DeniedMessage{ + Message: "Unauthorized", + }, + } + } + + if authenticated != nil { + return &pbEnvoyAuthV3.CheckResponse{ + HttpResponse: &pbEnvoyAuthV3.CheckResponse_OkResponse{ + OkResponse: &pbEnvoyAuthV3.OkHttpResponse{ + Headers: []*corev3.HeaderValueOption{ + { + Header: &corev3.HeaderValue{ + Key: AuthUsernameHeader, + Value: authenticated.Username, + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }, + { + Header: &corev3.HeaderValue{ + Key: AuthAuthenticatedHeader, + Value: "true", + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }, + }, + }, + }, + }, nil + } + return &pbEnvoyAuthV3.CheckResponse{ HttpResponse: &pbEnvoyAuthV3.CheckResponse_OkResponse{ - OkResponse: &pbEnvoyAuthV3.OkHttpResponse{}, + OkResponse: &pbEnvoyAuthV3.OkHttpResponse{ + Headers: []*corev3.HeaderValueOption{ + { + Header: &corev3.HeaderValue{ + Key: AuthAuthenticatedHeader, + Value: "false", + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }, + }, + }, }, }, nil } diff --git a/integrations/envoy/auth/v3/response.go b/integrations/envoy/auth/v3/response.go new file mode 100644 index 000000000..15cc2499b --- /dev/null +++ b/integrations/envoy/auth/v3/response.go @@ -0,0 +1,85 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +import ( + "encoding/json" + "fmt" + + corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" + typev3 "github.com/envoyproxy/go-control-plane/envoy/type/v3" + status "google.golang.org/genproto/googleapis/rpc/status" +) + +type DeniedMessage struct { + Message string `json:"message,omitempty"` +} + +type DeniedResponse struct { + Code int32 + Headers map[string]string + Message *DeniedMessage +} + +func (d DeniedResponse) Error() string { + return fmt.Sprintf("Request denied with code: %d", d.Code) +} + +func (d DeniedResponse) GetCheckResponse() (*pbEnvoyAuthV3.CheckResponse, error) { + var resp pbEnvoyAuthV3.DeniedHttpResponse + + for k, v := range d.Headers { + resp.Headers = append(resp.Headers, &corev3.HeaderValueOption{ + Header: &corev3.HeaderValue{ + Key: k, + Value: v, + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }) + } + + if data := d.Message; data != nil { + z, err := json.Marshal(data) + if err != nil { + return nil, err + } + + resp.Body = string(z) + resp.Headers = append(resp.Headers, &corev3.HeaderValueOption{ + Header: &corev3.HeaderValue{ + Key: "content/type", + Value: "application/json", + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }) + } + + resp.Status = &typev3.HttpStatus{ + Code: typev3.StatusCode(d.Code), + } + + return &pbEnvoyAuthV3.CheckResponse{ + HttpResponse: &pbEnvoyAuthV3.CheckResponse_DeniedResponse{DeniedResponse: &resp}, + Status: &status.Status{ + Code: d.Code, + }}, nil +} diff --git a/integrations/envoy/auth/v3/service_test.go b/integrations/envoy/auth/v3/service_test.go index a1eeb34c3..18e25c454 100644 --- a/integrations/envoy/auth/v3/service_test.go +++ b/integrations/envoy/auth/v3/service_test.go @@ -22,6 +22,7 @@ package v3 import ( "context" + "net/http" "testing" pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" @@ -35,7 +36,7 @@ import ( func Client(t *testing.T, ctx context.Context) pbEnvoyAuthV3.AuthorizationClient { local := svc.NewService(svc.Configuration{ Address: "127.0.0.1:0", - }, New()) + }, New(nil)) start := local.Start(ctx) @@ -44,7 +45,7 @@ func Client(t *testing.T, ctx context.Context) pbEnvoyAuthV3.AuthorizationClient return client } -func Test_AllowAll(t *testing.T) { +func Test_DenyHeader(t *testing.T) { ctx, c := context.WithCancel(context.Background()) defer c() @@ -53,8 +54,28 @@ func Test_AllowAll(t *testing.T) { resp, err := client.Check(ctx, &pbEnvoyAuthV3.CheckRequest{}) require.NoError(t, err) require.NoError(t, resp.Validate()) + require.NotNil(t, resp.Status) + require.NotNil(t, resp.HttpResponse) + require.NotNil(t, tests.CastAs[*pbEnvoyAuthV3.CheckResponse_DeniedResponse](t, resp.GetHttpResponse()).DeniedResponse) + require.EqualValues(t, http.StatusBadRequest, tests.CastAs[*pbEnvoyAuthV3.CheckResponse_DeniedResponse](t, resp.GetHttpResponse()).DeniedResponse.GetStatus().GetCode()) +} + +func Test_AllowAll(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + client := Client(t, ctx) + + resp, err := client.Check(ctx, &pbEnvoyAuthV3.CheckRequest{ + Attributes: &pbEnvoyAuthV3.AttributeContext{ + ContextExtensions: map[string]string{ + AuthConfigTypeKey: AuthConfigTypeValue, + }, + }, + }) + require.NoError(t, err) + require.NoError(t, resp.Validate()) require.Nil(t, resp.Status) require.NotNil(t, resp.HttpResponse) require.NotNil(t, tests.CastAs[*pbEnvoyAuthV3.CheckResponse_OkResponse](t, resp.GetHttpResponse()).OkResponse) - require.Nil(t, resp.DynamicMetadata) } diff --git a/pkg/apis/networking/v1alpha1/route_spec_authentication.go b/pkg/apis/networking/v1alpha1/route_spec_authentication.go new file mode 100644 index 000000000..249302f0e --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_authentication.go @@ -0,0 +1,62 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type ArangoRouteSpecAuthenticationType string + +const ( + ArangoRouteSpecAuthenticationTypeRequired ArangoRouteSpecAuthenticationType = "required" + ArangoRouteSpecAuthenticationTypeOptional ArangoRouteSpecAuthenticationType = "optional" +) + +func (a *ArangoRouteSpecAuthenticationType) Get() ArangoRouteSpecAuthenticationType { + if a == nil { + return ArangoRouteSpecAuthenticationTypeOptional + } + switch v := *a; v { + case ArangoRouteSpecAuthenticationTypeOptional, ArangoRouteSpecAuthenticationTypeRequired: + return v + } + + return "" +} + +func (a *ArangoRouteSpecAuthenticationType) Validate() error { + switch v := a.Get(); v { + case ArangoRouteSpecAuthenticationTypeOptional, ArangoRouteSpecAuthenticationTypeRequired: + return nil + default: + return errors.Errorf("Invalid AuthType: %s", v) + } +} + +func (a *ArangoRouteSpecAuthenticationType) Hash() string { + if a == nil { + return "" + } + + return util.SHA256FromString(string(*a)) +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination.go b/pkg/apis/networking/v1alpha1/route_spec_destination.go index ff1c58018..055fd6cbf 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination.go @@ -34,6 +34,9 @@ type ArangoRouteSpecDestination struct { // Path defines service path used for overrides Path *string `json:"path,omitempty"` + + // Authentication defines auth methods + Authentication *ArangoRouteSpecDestinationAuthentication `json:"authentication,omitempty"` } func (a *ArangoRouteSpecDestination) GetService() *ArangoRouteSpecDestinationService { @@ -68,6 +71,14 @@ func (a *ArangoRouteSpecDestination) GetTLS() *ArangoRouteSpecDestinationTLS { return a.TLS } +func (a *ArangoRouteSpecDestination) GetAuthentication() *ArangoRouteSpecDestinationAuthentication { + if a == nil || a.Authentication == nil { + return nil + } + + return a.Authentication +} + func (a *ArangoRouteSpecDestination) Validate() error { if a == nil { a = &ArangoRouteSpecDestination{} @@ -77,6 +88,7 @@ func (a *ArangoRouteSpecDestination) Validate() error { shared.ValidateOptionalInterfacePath("service", a.Service), shared.ValidateOptionalInterfacePath("schema", a.Schema), shared.ValidateOptionalInterfacePath("tls", a.TLS), + shared.ValidateOptionalInterfacePath("authentication", a.Authentication), shared.PrefixResourceError("path", shared.ValidateAPIPath(a.GetPath())), ); err != nil { return err diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go b/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go new file mode 100644 index 000000000..47225cab4 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" +) + +type ArangoRouteSpecDestinationAuthentication struct { + Type *ArangoRouteSpecAuthenticationType `json:"type,omitempty"` +} + +func (a *ArangoRouteSpecDestinationAuthentication) GetType() ArangoRouteSpecAuthenticationType { + if a == nil { + return ArangoRouteSpecAuthenticationTypeOptional + } + + return a.Type.Get() +} + +func (a *ArangoRouteSpecDestinationAuthentication) Validate() error { + if a == nil { + return nil + } + + return shared.WithErrors( + shared.ValidateOptionalInterfacePath("type", a.Type), + ) +} diff --git a/pkg/apis/networking/v1alpha1/route_status_target.go b/pkg/apis/networking/v1alpha1/route_status_target.go index 89f1b7a0d..26d67b1d3 100644 --- a/pkg/apis/networking/v1alpha1/route_status_target.go +++ b/pkg/apis/networking/v1alpha1/route_status_target.go @@ -33,6 +33,9 @@ type ArangoRouteStatusTarget struct { // TLS Keeps target TLS Settings (if not nil, TLS is enabled) TLS *ArangoRouteStatusTargetTLS `json:"TLS,omitempty"` + // Authentication specifies the authentication details + Authentication ArangoRouteStatusTargetAuthentication `json:"authentication,omitempty"` + // Path specifies request path override Path string `json:"path,omitempty"` } @@ -61,5 +64,5 @@ func (a *ArangoRouteStatusTarget) Hash() string { if a == nil { return "" } - return util.SHA256FromStringArray(a.Destinations.Hash(), a.TLS.Hash(), a.Path) + return util.SHA256FromStringArray(a.Destinations.Hash(), a.TLS.Hash(), a.Path, a.Authentication.Hash()) } diff --git a/pkg/apis/networking/v1alpha1/route_status_target_authentication.go b/pkg/apis/networking/v1alpha1/route_status_target_authentication.go new file mode 100644 index 000000000..e24014189 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_status_target_authentication.go @@ -0,0 +1,34 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import "github.com/arangodb/kube-arangodb/pkg/util" + +type ArangoRouteStatusTargetAuthentication struct { + Type ArangoRouteSpecAuthenticationType `json:"type,omitempty"` +} + +func (a *ArangoRouteStatusTargetAuthentication) Hash() string { + if a == nil { + return "" + } + return util.SHA256FromStringArray(a.Type.Hash()) +} diff --git a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go index ba179a20b..b1cf33eed 100644 --- a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go @@ -26,7 +26,7 @@ package v1alpha1 import ( - v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" runtime "k8s.io/apimachinery/pkg/runtime" intstr "k8s.io/apimachinery/pkg/util/intstr" @@ -147,6 +147,11 @@ func (in *ArangoRouteSpecDestination) DeepCopyInto(out *ArangoRouteSpecDestinati *out = new(string) **out = **in } + if in.Authentication != nil { + in, out := &in.Authentication, &out.Authentication + *out = new(ArangoRouteSpecDestinationAuthentication) + (*in).DeepCopyInto(*out) + } return } @@ -160,6 +165,27 @@ func (in *ArangoRouteSpecDestination) DeepCopy() *ArangoRouteSpecDestination { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteSpecDestinationAuthentication) DeepCopyInto(out *ArangoRouteSpecDestinationAuthentication) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(ArangoRouteSpecAuthenticationType) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteSpecDestinationAuthentication. +func (in *ArangoRouteSpecDestinationAuthentication) DeepCopy() *ArangoRouteSpecDestinationAuthentication { + if in == nil { + return nil + } + out := new(ArangoRouteSpecDestinationAuthentication) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArangoRouteSpecDestinationService) DeepCopyInto(out *ArangoRouteSpecDestinationService) { *out = *in @@ -233,7 +259,7 @@ func (in *ArangoRouteStatus) DeepCopyInto(out *ArangoRouteStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(v2alpha1.ConditionList, len(*in)) + *out = make(deploymentv1.ConditionList, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -274,6 +300,7 @@ func (in *ArangoRouteStatusTarget) DeepCopyInto(out *ArangoRouteStatusTarget) { *out = new(ArangoRouteStatusTargetTLS) (*in).DeepCopyInto(*out) } + out.Authentication = in.Authentication return } @@ -287,6 +314,22 @@ func (in *ArangoRouteStatusTarget) DeepCopy() *ArangoRouteStatusTarget { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteStatusTargetAuthentication) DeepCopyInto(out *ArangoRouteStatusTargetAuthentication) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteStatusTargetAuthentication. +func (in *ArangoRouteStatusTargetAuthentication) DeepCopy() *ArangoRouteStatusTargetAuthentication { + if in == nil { + return nil + } + out := new(ArangoRouteStatusTargetAuthentication) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArangoRouteStatusTargetDestination) DeepCopyInto(out *ArangoRouteStatusTargetDestination) { *out = *in diff --git a/pkg/crd/crds/networking-route.schema.generated.yaml b/pkg/crd/crds/networking-route.schema.generated.yaml index 49d93b356..5751f46b1 100644 --- a/pkg/crd/crds/networking-route.schema.generated.yaml +++ b/pkg/crd/crds/networking-route.schema.generated.yaml @@ -9,6 +9,12 @@ v1alpha1: destination: description: Destination defines the route destination properties: + authentication: + description: Authentication defines auth methods + properties: + type: + type: string + type: object path: description: Path defines service path used for overrides type: string diff --git a/pkg/deployment/resources/config_map_gateway.go b/pkg/deployment/resources/config_map_gateway.go index 739474f8e..9285e38f8 100644 --- a/pkg/deployment/resources/config_map_gateway.go +++ b/pkg/deployment/resources/config_map_gateway.go @@ -30,6 +30,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + pbImplEnvoyAuthV3 "github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3" networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/resources/gateway" @@ -131,6 +132,7 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto Port: shared.ArangoPort, }, }, + AuthExtension: &gateway.ConfigAuthZExtension{}, } if spec.TLS.IsSecure() { @@ -193,6 +195,11 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto dest.Type = util.NewType(gateway.ConfigDestinationTypeHTTPS) } dest.Path = util.NewType(target.Path) + dest.AuthExtension = &gateway.ConfigAuthZExtension{ + AuthZExtension: map[string]string{ + pbImplEnvoyAuthV3.AuthConfigAuthRequiredKey: util.BoolSwitch(target.Authentication.Type.Get() == networkingApi.ArangoRouteSpecAuthenticationTypeRequired, pbImplEnvoyAuthV3.AuthConfigKeywordTrue, pbImplEnvoyAuthV3.AuthConfigKeywordFalse), + }, + } cfg.Destinations[at.Spec.GetRoute().GetPath()] = dest } diff --git a/pkg/deployment/resources/gateway/gateway_authz_extension.go b/pkg/deployment/resources/gateway/gateway_authz_extension.go new file mode 100644 index 000000000..b7e6edf0c --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_authz_extension.go @@ -0,0 +1,67 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + httpFilterAuthzApi "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_authz/v3" + "google.golang.org/protobuf/types/known/anypb" + + pbImplEnvoyAuthV3 "github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +type ConfigAuthZExtension struct { + AuthZExtension map[string]string `json:"authZExtension,omitempty"` +} + +func (c *ConfigAuthZExtension) RenderTypedFilterConfig() (util.KV[string, *anypb.Any], error) { + if c == nil { + return util.KV[string, *anypb.Any]{}, nil + } + + var data = map[string]string{} + + for k, v := range c.AuthZExtension { + data[k] = v + } + + data[pbImplEnvoyAuthV3.AuthConfigTypeKey] = pbImplEnvoyAuthV3.AuthConfigTypeValue + + q, err := anypb.New(&httpFilterAuthzApi.ExtAuthzPerRoute{ + Override: &httpFilterAuthzApi.ExtAuthzPerRoute_CheckSettings{ + CheckSettings: &httpFilterAuthzApi.CheckSettings{ + ContextExtensions: data, + }, + }, + }) + if err != nil { + return util.KV[string, *anypb.Any]{}, err + } + + return util.KV[string, *anypb.Any]{ + K: IntegrationSidecarFilterName, + V: q, + }, nil +} + +func (c *ConfigAuthZExtension) Validate() error { + return nil +} diff --git a/pkg/deployment/resources/gateway/gateway_config_destination.go b/pkg/deployment/resources/gateway/gateway_config_destination.go index f8ee81c63..3139b3f31 100644 --- a/pkg/deployment/resources/gateway/gateway_config_destination.go +++ b/pkg/deployment/resources/gateway/gateway_config_destination.go @@ -26,7 +26,6 @@ import ( clusterAPI "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" endpointAPI "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" routeAPI "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" - anypb "github.com/golang/protobuf/ptypes/any" "google.golang.org/protobuf/types/known/durationpb" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" @@ -62,6 +61,8 @@ type ConfigDestination struct { Type *ConfigDestinationType `json:"type,omitempty"` Path *string `json:"path,omitempty"` + + AuthExtension *ConfigAuthZExtension `json:"authExtension,omitempty"` } func (c *ConfigDestination) Validate() error { @@ -72,6 +73,7 @@ func (c *ConfigDestination) Validate() error { shared.PrefixResourceError("targets", c.Targets.Validate()), shared.PrefixResourceError("type", c.Type.Validate()), shared.PrefixResourceError("path", shared.ValidateAPIPath(c.GetPath())), + shared.PrefixResourceError("authExtension", c.AuthExtension.Validate()), ) } @@ -84,6 +86,16 @@ func (c *ConfigDestination) GetPath() string { } func (c *ConfigDestination) RenderRoute(name, prefix string) (*routeAPI.Route, error) { + var tcg []TypedFilterConfigGen + + if c != nil && c.AuthExtension != nil { + tcg = append(tcg, c.AuthExtension) + } + tc, err := NewTypedFilterConfig(tcg...) + if err != nil { + return nil, err + } + return &routeAPI.Route{ Match: &routeAPI.RouteMatch{ PathSpecifier: &routeAPI.RouteMatch_Prefix{ @@ -98,7 +110,7 @@ func (c *ConfigDestination) RenderRoute(name, prefix string) (*routeAPI.Route, e PrefixRewrite: c.GetPath(), }, }, - TypedPerFilterConfig: map[string]*anypb.Any{}, + TypedPerFilterConfig: tc, }, nil } diff --git a/pkg/deployment/resources/gateway/gateway_filter_extension.go b/pkg/deployment/resources/gateway/gateway_filter_extension.go new file mode 100644 index 000000000..f711e952e --- /dev/null +++ b/pkg/deployment/resources/gateway/gateway_filter_extension.go @@ -0,0 +1,58 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + "google.golang.org/protobuf/types/known/anypb" + + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type TypedFilterConfigGen interface { + RenderTypedFilterConfig() (util.KV[string, *anypb.Any], error) +} + +func NewTypedFilterConfig(gens ...TypedFilterConfigGen) (map[string]*anypb.Any, error) { + generated := map[string]*anypb.Any{} + + for _, g := range gens { + if k, err := g.RenderTypedFilterConfig(); err != nil { + return nil, err + } else { + if _, ok := generated[k.K]; ok { + return nil, errors.Errorf("Duplicated key: %s", k.K) + } + + if k.V == nil { + continue + } + + generated[k.K] = k.V + } + } + + if len(generated) == 0 { + return nil, nil + } + + return generated, nil +} diff --git a/pkg/deployment/resources/pod_creator_gateway_pod.go b/pkg/deployment/resources/pod_creator_gateway_pod.go index 5f8fc16bf..16d14c89d 100644 --- a/pkg/deployment/resources/pod_creator_gateway_pod.go +++ b/pkg/deployment/resources/pod_creator_gateway_pod.go @@ -238,9 +238,13 @@ func (m *MemberGatewayPod) Labels() map[string]string { func (m *MemberGatewayPod) Profiles() (schedulerApi.ProfileTemplates, error) { integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ Image: util.NewType(m.resources.context.GetOperatorImage()), - }, m.spec.Gateway.GetSidecar(), []string{shared.ServerContainerName}, sidecar.IntegrationEnvoyV3{ - Spec: m.spec, - }) + }, m.spec.Gateway.GetSidecar(), []string{shared.ServerContainerName}, + sidecar.IntegrationEnvoyV3{ + Spec: m.spec, + }, sidecar.IntegrationAuthenticationV1{ + DeploymentName: m.context.GetName(), + Spec: m.spec, + }) if err != nil { return nil, err diff --git a/pkg/handlers/networking/route/handler_destination.go b/pkg/handlers/networking/route/handler_destination.go index 80806d135..7a618ffed 100644 --- a/pkg/handlers/networking/route/handler_destination.go +++ b/pkg/handlers/networking/route/handler_destination.go @@ -121,6 +121,10 @@ func (h *handler) HandleArangoDestination(ctx context.Context, item operation.It target.Path = dest.GetPath() + // Render Auth Settings + + target.Authentication.Type = dest.GetAuthentication().GetType() + if dest.Schema.Get() == networkingApi.ArangoRouteSpecDestinationSchemaHTTPS { target.TLS = &networkingApi.ArangoRouteStatusTargetTLS{ Insecure: util.NewType(extension.Spec.Destination.GetTLS().GetInsecure()), diff --git a/pkg/integrations/authentication_v1.go b/pkg/integrations/authentication_v1.go index 3de449d76..60bc77afa 100644 --- a/pkg/integrations/authentication_v1.go +++ b/pkg/integrations/authentication_v1.go @@ -56,7 +56,7 @@ func (a *authenticationV1) Register(cmd *cobra.Command, arg ArgGen) error { return nil } -func (a *authenticationV1) Handler(ctx context.Context) (svc.Handler, error) { +func (a *authenticationV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { return pbImplAuthenticationV1.New(ctx, a.config) } @@ -67,3 +67,7 @@ func (a *authenticationV1) Name() string { func (a *authenticationV1) Description() string { return "Enable AuthenticationV1 Integration Service" } + +func (*authenticationV1) Init(ctx context.Context, cmd *cobra.Command) error { + return nil +} diff --git a/pkg/integrations/authorization_v0.go b/pkg/integrations/authorization_v0.go index d63ab33d5..fd001d687 100644 --- a/pkg/integrations/authorization_v0.go +++ b/pkg/integrations/authorization_v0.go @@ -51,6 +51,10 @@ func (a authorizationV0) Register(cmd *cobra.Command, arg ArgGen) error { return nil } -func (a authorizationV0) Handler(ctx context.Context) (svc.Handler, error) { +func (a authorizationV0) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { return pbImplAuthorizationV0.New(), nil } + +func (a authorizationV0) Init(ctx context.Context, cmd *cobra.Command) error { + return nil +} diff --git a/pkg/integrations/config_v1.go b/pkg/integrations/config_v1.go index 582605a03..d0ff5faeb 100644 --- a/pkg/integrations/config_v1.go +++ b/pkg/integrations/config_v1.go @@ -49,7 +49,7 @@ func (a *configV1) Register(cmd *cobra.Command, arg ArgGen) error { return nil } -func (a *configV1) Handler(ctx context.Context) (svc.Handler, error) { +func (a *configV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { var cfg pbImplConfigV1.Config cfg.Modules = map[string]pbImplConfigV1.ModuleDefinition{} @@ -75,3 +75,7 @@ func (a *configV1) Name() string { func (a *configV1) Description() string { return "Enable ConfigV1 Integration Service" } + +func (*configV1) Init(ctx context.Context, cmd *cobra.Command) error { + return nil +} diff --git a/pkg/integrations/envoy_auth_v3.go b/pkg/integrations/envoy_auth_v3.go index aadfabacc..c8cb55808 100644 --- a/pkg/integrations/envoy_auth_v3.go +++ b/pkg/integrations/envoy_auth_v3.go @@ -25,7 +25,9 @@ import ( "github.com/spf13/cobra" + pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition" pbImplEnvoyAuthV3 "github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) @@ -42,14 +44,26 @@ func (a envoyAuthV3) Name() string { return pbImplEnvoyAuthV3.Name } -func (a envoyAuthV3) Description() string { +func (a *envoyAuthV3) Description() string { return "Enable EnvoyAuthV3 Integration Service" } -func (a envoyAuthV3) Register(cmd *cobra.Command, arg ArgGen) error { +func (a *envoyAuthV3) Register(cmd *cobra.Command, arg ArgGen) error { return nil } -func (a envoyAuthV3) Handler(ctx context.Context) (svc.Handler, error) { - return pbImplEnvoyAuthV3.New(), nil +func (a *envoyAuthV3) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { + f := cmd.Flags() + + v, err := f.GetString("services.address") + if err != nil { + return nil, err + } + + c, _, err := util.NewGRPCClient(ctx, pbAuthenticationV1.NewAuthenticationV1Client, v) + if err != nil { + return nil, err + } + + return pbImplEnvoyAuthV3.New(c), nil } diff --git a/pkg/integrations/integration.go b/pkg/integrations/integration.go index 0b6543177..d896c7f00 100644 --- a/pkg/integrations/integration.go +++ b/pkg/integrations/integration.go @@ -38,7 +38,7 @@ type Integration interface { Register(cmd *cobra.Command, arg ArgGen) error - Handler(ctx context.Context) (svc.Handler, error) + Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) } type IntegrationEnablement interface { diff --git a/pkg/integrations/register.go b/pkg/integrations/register.go index 8799452dc..d20a8b0d8 100644 --- a/pkg/integrations/register.go +++ b/pkg/integrations/register.go @@ -36,6 +36,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/shutdown" "github.com/arangodb/kube-arangodb/pkg/util/svc" + "github.com/arangodb/kube-arangodb/pkg/version" ) var registerer = util.NewRegisterer[string, Factory]() @@ -171,6 +172,8 @@ func (c *configuration) run(cmd *cobra.Command, args []string) error { } func (c *configuration) runWithContext(ctx context.Context, cancel context.CancelFunc, cmd *cobra.Command) error { + println(version.GetVersionV1().String()) + healthConfig, err := c.health.Config() if err != nil { return errors.Wrapf(err, "Unable to parse health config") @@ -214,7 +217,7 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance Info("Service discovered") if ok && (internalEnabled || externalEnabled) { - if svc, err := handler.Handler(ctx); err != nil { + if svc, err := handler.Handler(ctx, cmd); err != nil { return err } else { if internalEnabled { diff --git a/pkg/integrations/scheduler_v1.go b/pkg/integrations/scheduler_v1.go index e6d906797..ad84aec7f 100644 --- a/pkg/integrations/scheduler_v1.go +++ b/pkg/integrations/scheduler_v1.go @@ -59,7 +59,7 @@ func (b *schedulerV1) Register(cmd *cobra.Command, arg ArgGen) error { return nil } -func (b *schedulerV1) Handler(ctx context.Context) (svc.Handler, error) { +func (b *schedulerV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { client, ok := kclient.GetDefaultFactory().Client() if !ok { return nil, errors.Errorf("Unable to create Kubernetes Client") @@ -67,3 +67,7 @@ func (b *schedulerV1) Handler(ctx context.Context) (svc.Handler, error) { return pbImplSchedulerV1.New(ctx, client, b.Configuration) } + +func (*schedulerV1) Init(ctx context.Context, cmd *cobra.Command) error { + return nil +} diff --git a/pkg/integrations/shutdown_v1.go b/pkg/integrations/shutdown_v1.go index 504f1931f..93c4c4a9c 100644 --- a/pkg/integrations/shutdown_v1.go +++ b/pkg/integrations/shutdown_v1.go @@ -40,7 +40,7 @@ func init() { type shutdownV1 struct { } -func (s *shutdownV1) Handler(ctx context.Context) (svc.Handler, error) { +func (s *shutdownV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { return pbImplShutdownV1.New(shutdown.Stop), nil } @@ -55,3 +55,7 @@ func (s *shutdownV1) Description() string { func (s *shutdownV1) Register(cmd *cobra.Command, arg ArgGen) error { return nil } + +func (*shutdownV1) Init(ctx context.Context, cmd *cobra.Command) error { + return nil +} diff --git a/pkg/integrations/sidecar/integration.authentication.v1.go b/pkg/integrations/sidecar/integration.authentication.v1.go index a51df0c78..9504877df 100644 --- a/pkg/integrations/sidecar/integration.authentication.v1.go +++ b/pkg/integrations/sidecar/integration.authentication.v1.go @@ -26,15 +26,16 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) var _ IntegrationVolumes = IntegrationAuthenticationV1{} type IntegrationAuthenticationV1 struct { - Core *Core - Deployment *api.ArangoDeployment + Core *Core + + DeploymentName string + Spec api.DeploymentSpec } func (i IntegrationAuthenticationV1) Name() []string { @@ -42,10 +43,6 @@ func (i IntegrationAuthenticationV1) Name() []string { } func (i IntegrationAuthenticationV1) Validate() error { - if i.Deployment == nil { - return errors.Errorf("Deployment is nil") - } - return nil } @@ -53,7 +50,7 @@ func (i IntegrationAuthenticationV1) Args() (k8sutil.OptionPairs, error) { options := k8sutil.CreateOptionPairs() options.Add("--integration.authentication.v1", true) - options.Add("--integration.authentication.v1.enabled", i.Deployment.GetAcceptedSpec().IsAuthenticated()) + options.Add("--integration.authentication.v1.enabled", i.Spec.IsAuthenticated()) options.Add("--integration.authentication.v1.path", shared.ClusterJWTSecretVolumeMountDir) options.Merge(i.Core.Args(i)) @@ -62,13 +59,13 @@ func (i IntegrationAuthenticationV1) Args() (k8sutil.OptionPairs, error) { } func (i IntegrationAuthenticationV1) Volumes() ([]core.Volume, []core.VolumeMount, error) { - if i.Deployment.GetAcceptedSpec().IsAuthenticated() { + if i.Spec.IsAuthenticated() { return []core.Volume{ { Name: shared.ClusterJWTSecretVolumeName, VolumeSource: core.VolumeSource{ Secret: &core.SecretVolumeSource{ - SecretName: pod.JWTSecretFolder(i.Deployment.GetName()), + SecretName: pod.JWTSecretFolder(i.DeploymentName), }, }, }, diff --git a/pkg/integrations/storage_v1.go b/pkg/integrations/storage_v1.go index ffa351f4e..9ca2a1f00 100644 --- a/pkg/integrations/storage_v1.go +++ b/pkg/integrations/storage_v1.go @@ -64,6 +64,10 @@ func (b *storageV1) Register(cmd *cobra.Command, arg ArgGen) error { return nil } -func (b *storageV1) Handler(ctx context.Context) (svc.Handler, error) { +func (b *storageV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { return storage.NewService(ctx, b.Configuration) } + +func (*storageV1) Init(ctx context.Context, cmd *cobra.Command) error { + return nil +} diff --git a/pkg/integrations/tls_test.go b/pkg/integrations/tls_test.go index 79aa38f6d..0bb1616da 100644 --- a/pkg/integrations/tls_test.go +++ b/pkg/integrations/tls_test.go @@ -109,7 +109,7 @@ func Test_TLSCases(t *testing.T) { "--tls.enabled=false", "client", "health", - "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"error reading server preface: EOF\"") + "v1")).Code(t, codes.Unavailable) }) t.Run("external", func(t *testing.T) { tgrpc.AsGRPCError(t, executeSync(t, shutdown.Context(), @@ -117,7 +117,7 @@ func Test_TLSCases(t *testing.T) { "--tls.enabled=false", "client", "health", - "v1")).Code(t, codes.Unavailable).Errorf(t, "connection error: desc = \"error reading server preface: EOF\"") + "v1")).Code(t, codes.Unavailable) }) }) diff --git a/pkg/util/dict.go b/pkg/util/dict.go index edcd37fc4..38af1a980 100644 --- a/pkg/util/dict.go +++ b/pkg/util/dict.go @@ -115,3 +115,12 @@ func IterateSorted[V any](m map[string]V, cb func(string, V)) { cb(k, m[k]) } } + +func Optional[K comparable, V any](m map[K]V, key K, def V) V { + v, ok := m[key] + if ok { + return v + } + + return def +} diff --git a/pkg/util/errors/panics/recovery.go b/pkg/util/errors/panics/recovery.go index 3a54e4f05..9556da94f 100644 --- a/pkg/util/errors/panics/recovery.go +++ b/pkg/util/errors/panics/recovery.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,6 +30,20 @@ func recoverPanic(skipFrames int, in func() error) (err error) { return in() } +func recoverPanicO1[O1 any](skipFrames int, in func() (O1, error)) (o1 O1, err error) { + defer func() { + if r := recover(); r != nil { + err = newPanicError(r, GetStack(skipFrames)) + } + }() + + return in() +} + func Recover(in func() error) (err error) { return recoverPanic(4, in) } + +func RecoverO1[O1 any](in func() (O1, error)) (O1, error) { + return recoverPanicO1(4, in) +} diff --git a/pkg/version/version.go b/pkg/version/version.go index 0115a34ea..94e81316c 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ package version import ( + "fmt" "runtime" "github.com/arangodb/go-driver" @@ -58,6 +59,10 @@ func (i InfoV1) IsEnterprise() bool { return i.Edition == EnterpriseEdition } +func (i InfoV1) String() string { + return fmt.Sprintf("Version: %s %s, Build: %s, Go: %s, Build Date: %s", i.Edition.Title(), i.Version, i.Build, i.GoVersion, i.BuildDate) +} + func GetVersionV1() InfoV1 { return InfoV1{ Version: driver.Version(version), From 713d92702e74c3c8fd5caf85584a15ffb3ada067 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:52:37 +0200 Subject: [PATCH 27/50] [Feature] Scheduler Handler (#1716) --- CHANGELOG.md | 1 + README.md | 3 +- .../templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 +++ .../scheduler-operator/cluster-role.yaml | 22 ++ .../scheduler-operator/role-binding.yaml | 25 +++ .../templates/scheduler-operator/role.yaml | 32 +++ .../templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 +++ .../scheduler-operator/cluster-role.yaml | 22 ++ .../scheduler-operator/role-binding.yaml | 25 +++ .../templates/scheduler-operator/role.yaml | 32 +++ .../templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 +++ .../scheduler-operator/cluster-role.yaml | 22 ++ .../scheduler-operator/role-binding.yaml | 25 +++ .../templates/scheduler-operator/role.yaml | 32 +++ chart/kube-arangodb/templates/deployment.yaml | 3 + .../cluster-role-binding.yaml | 26 +++ .../scheduler-operator/cluster-role.yaml | 22 ++ .../scheduler-operator/role-binding.yaml | 25 +++ .../templates/scheduler-operator/role.yaml | 32 +++ chart/kube-arangodb/values.yaml | 1 + cmd/cmd.go | 18 +- docs/cli/arangodb_operator.md | 3 +- pkg/apis/scheduler/v1alpha1/profile.go | 8 + pkg/apis/scheduler/v1beta1/profile.go | 8 + pkg/apis/scheduler/v1beta1/profile_status.go | 3 +- pkg/deployment/resources/inspector/ap.go | 192 ++++++++++++++++++ .../resources/inspector/ap_anonymous.go | 45 ++++ pkg/deployment/resources/inspector/ap_gvk.go | 43 ++++ pkg/deployment/resources/inspector/ap_mod.go | 47 +++++ .../resources/inspector/ap_v1beta1.go | 138 +++++++++++++ .../resources/inspector/inspector.go | 19 ++ .../resources/inspector/inspector_test.go | 4 +- .../resources/inspector/pdbs_version_test.go | 2 +- .../resources/inspector/throttles.go | 1 + pkg/handlers/networking/route/suite_test.go | 4 +- pkg/handlers/scheduler/profile/handler.go | 104 ++++++++++ .../scheduler/profile/handler_test.go | 59 ++++++ pkg/handlers/scheduler/profile/local.go | 38 ++++ pkg/handlers/scheduler/profile/register.go | 60 ++++++ pkg/handlers/scheduler/profile/suite_test.go | 61 ++++++ pkg/operator/operator.go | 32 +++ pkg/operatorV2/update_wraps.go | 5 + pkg/server/server.go | 5 + pkg/util/constants/constants.go | 1 + .../inspector/arangoprofile/definition.go | 44 ++++ .../inspector/arangoprofile/v1beta1/loader.go | 53 +++++ .../inspector/arangoprofile/v1beta1/reader.go | 50 +++++ .../inspector/constants/ap_constants.go | 66 ++++++ pkg/util/k8sutil/inspector/constants/gvk.go | 8 +- .../k8sutil/inspector/constants/gvk_test.go | 7 +- .../inspector/definitions/components.go | 2 + pkg/util/k8sutil/inspector/inspector.go | 2 + pkg/util/k8sutil/inspector/mods/mods.go | 6 + .../k8sutil/inspector/throttle/throttle.go | 14 +- 57 files changed, 1572 insertions(+), 17 deletions(-) create mode 100644 chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb-arm64/templates/scheduler-operator/role-binding.yaml create mode 100644 chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/scheduler-operator/role-binding.yaml create mode 100644 chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml create mode 100644 chart/kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml create mode 100644 chart/kube-arangodb/templates/scheduler-operator/cluster-role.yaml create mode 100644 chart/kube-arangodb/templates/scheduler-operator/role-binding.yaml create mode 100644 chart/kube-arangodb/templates/scheduler-operator/role.yaml create mode 100644 pkg/deployment/resources/inspector/ap.go create mode 100644 pkg/deployment/resources/inspector/ap_anonymous.go create mode 100644 pkg/deployment/resources/inspector/ap_gvk.go create mode 100644 pkg/deployment/resources/inspector/ap_mod.go create mode 100644 pkg/deployment/resources/inspector/ap_v1beta1.go create mode 100644 pkg/handlers/scheduler/profile/handler.go create mode 100644 pkg/handlers/scheduler/profile/handler_test.go create mode 100644 pkg/handlers/scheduler/profile/local.go create mode 100644 pkg/handlers/scheduler/profile/register.go create mode 100644 pkg/handlers/scheduler/profile/suite_test.go create mode 100644 pkg/util/k8sutil/inspector/arangoprofile/definition.go create mode 100644 pkg/util/k8sutil/inspector/arangoprofile/v1beta1/loader.go create mode 100644 pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go create mode 100644 pkg/util/k8sutil/inspector/constants/ap_constants.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c076e232..3064aa46e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - (Feature) (Gateway) SNI and Authz support - (Maintenance) Bump Examples to ArangoDB 3.12 - (Feature) (Gateway) ArangoDB JWT Auth Integration +- (Feature) Scheduler Handler ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/README.md b/README.md index 71e7392a3..55c1af195 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, scheduler-profile-operator, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes @@ -196,6 +196,7 @@ Flags: --operator.networking Enable to run the Networking operator --operator.reconciliation.retry.count int Count of retries during Object Update operations in the Reconciliation loop (default 25) --operator.reconciliation.retry.delay duration Delay between Object Update operations in the Reconciliation loop (default 1s) + --operator.scheduler Enable to run the Scheduler operator --operator.storage Enable to run the ArangoLocalStorage operator --operator.version Enable only version endpoint in Operator --reconciliation.delay duration Delay between reconciliation loops (<= 0 -> Disabled) diff --git a/chart/kube-arangodb-arm64/templates/deployment.yaml b/chart/kube-arangodb-arm64/templates/deployment.yaml index 49958189d..3488df768 100644 --- a/chart/kube-arangodb-arm64/templates/deployment.yaml +++ b/chart/kube-arangodb-arm64/templates/deployment.yaml @@ -120,6 +120,9 @@ spec: {{ if .Values.operator.features.networking }} - --operator.networking {{- end }} +{{ if .Values.operator.features.scheduler }} + - --operator.scheduler +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role-binding.yaml b/chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..aa1dd27d9 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role.yaml b/chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role.yaml new file mode 100644 index 000000000..12e4b2fd3 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/scheduler-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-arm64/templates/scheduler-operator/role-binding.yaml b/chart/kube-arangodb-arm64/templates/scheduler-operator/role-binding.yaml new file mode 100644 index 000000000..02e1eb816 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/scheduler-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml b/chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml new file mode 100644 index 000000000..46a3d92f0 --- /dev/null +++ b/chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml @@ -0,0 +1,32 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml b/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml index 49958189d..3488df768 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml @@ -120,6 +120,9 @@ spec: {{ if .Values.operator.features.networking }} - --operator.networking {{- end }} +{{ if .Values.operator.features.scheduler }} + - --operator.scheduler +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role-binding.yaml b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..aa1dd27d9 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role.yaml new file mode 100644 index 000000000..12e4b2fd3 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role-binding.yaml b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role-binding.yaml new file mode 100644 index 000000000..02e1eb816 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml new file mode 100644 index 000000000..46a3d92f0 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml @@ -0,0 +1,32 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/deployment.yaml b/chart/kube-arangodb-enterprise/templates/deployment.yaml index 49958189d..3488df768 100644 --- a/chart/kube-arangodb-enterprise/templates/deployment.yaml +++ b/chart/kube-arangodb-enterprise/templates/deployment.yaml @@ -120,6 +120,9 @@ spec: {{ if .Values.operator.features.networking }} - --operator.networking {{- end }} +{{ if .Values.operator.features.scheduler }} + - --operator.scheduler +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role-binding.yaml b/chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..aa1dd27d9 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role.yaml b/chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role.yaml new file mode 100644 index 000000000..12e4b2fd3 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/scheduler-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/scheduler-operator/role-binding.yaml b/chart/kube-arangodb-enterprise/templates/scheduler-operator/role-binding.yaml new file mode 100644 index 000000000..02e1eb816 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/scheduler-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml b/chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml new file mode 100644 index 000000000..46a3d92f0 --- /dev/null +++ b/chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml @@ -0,0 +1,32 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/deployment.yaml b/chart/kube-arangodb/templates/deployment.yaml index 49958189d..3488df768 100644 --- a/chart/kube-arangodb/templates/deployment.yaml +++ b/chart/kube-arangodb/templates/deployment.yaml @@ -120,6 +120,9 @@ spec: {{ if .Values.operator.features.networking }} - --operator.networking {{- end }} +{{ if .Values.operator.features.scheduler }} + - --operator.scheduler +{{- end }} {{ if .Values.operator.features.k8sToK8sClusterSync }} - --operator.k2k-cluster-sync {{- end }} diff --git a/chart/kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml b/chart/kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml new file mode 100644 index 000000000..aa1dd27d9 --- /dev/null +++ b/chart/kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml @@ -0,0 +1,26 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/scheduler-operator/cluster-role.yaml b/chart/kube-arangodb/templates/scheduler-operator/cluster-role.yaml new file mode 100644 index 000000000..12e4b2fd3 --- /dev/null +++ b/chart/kube-arangodb/templates/scheduler-operator/cluster-role.yaml @@ -0,0 +1,22 @@ +{{ if .Values.rbac.enabled -}} +{{ if not (eq .Values.operator.scope "namespaced") -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kube-arangodb.rbac-cluster" . }}-scheduler + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/scheduler-operator/role-binding.yaml b/chart/kube-arangodb/templates/scheduler-operator/role-binding.yaml new file mode 100644 index 000000000..02e1eb816 --- /dev/null +++ b/chart/kube-arangodb/templates/scheduler-operator/role-binding.yaml @@ -0,0 +1,25 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "kube-arangodb.rbac" . }}-scheduler +subjects: + - kind: ServiceAccount + name: {{ template "kube-arangodb.operatorName" . }} + namespace: {{ .Release.Namespace }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/scheduler-operator/role.yaml b/chart/kube-arangodb/templates/scheduler-operator/role.yaml new file mode 100644 index 000000000..46a3d92f0 --- /dev/null +++ b/chart/kube-arangodb/templates/scheduler-operator/role.yaml @@ -0,0 +1,32 @@ +{{ if .Values.rbac.enabled -}} +{{ if .Values.operator.features.scheduler -}} + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "kube-arangodb.rbac" . }}-scheduler + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ template "kube-arangodb.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +{{- end }} +{{- end }} \ No newline at end of file diff --git a/chart/kube-arangodb/values.yaml b/chart/kube-arangodb/values.yaml index 98ac2e00f..980cd6866 100644 --- a/chart/kube-arangodb/values.yaml +++ b/chart/kube-arangodb/values.yaml @@ -35,6 +35,7 @@ operator: ml: false analytics: false networking: true + scheduler: true tolerations: [] rbac: enabled: true diff --git a/cmd/cmd.go b/cmd/cmd.go index bafe078fa..023e89a99 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -120,6 +120,7 @@ var ( enableML bool // Run ml operator enableAnalytics bool // Run analytics operator enableNetworking bool // Run networking operator + enableScheduler bool // Run scheduler operator versionOnly bool // Run only version endpoint, explicitly disabled with other enableK2KClusterSync bool // Run k2kClusterSync operator @@ -186,6 +187,7 @@ var ( mlProbe probe.ReadyProbe analyticsProbe probe.ReadyProbe networkingProbe probe.ReadyProbe + schedulerProbe probe.ReadyProbe k2KClusterSyncProbe probe.ReadyProbe ) @@ -213,6 +215,7 @@ func init() { f.BoolVar(&operatorOptions.enableML, "operator.ml", false, "Enable to run the ArangoML operator") f.BoolVar(&operatorOptions.enableAnalytics, "operator.analytics", false, "Enable to run the Analytics operator") f.BoolVar(&operatorOptions.enableNetworking, "operator.networking", false, "Enable to run the Networking operator") + f.BoolVar(&operatorOptions.enableScheduler, "operator.scheduler", false, "Enable to run the Scheduler operator") f.BoolVar(&operatorOptions.enableK2KClusterSync, "operator.k2k-cluster-sync", false, "Enable to run the ListSimple operator") f.MarkDeprecated("operator.k2k-cluster-sync", "Enabled within deployment operator") f.BoolVar(&operatorOptions.versionOnly, "operator.version", false, "Enable only version endpoint in Operator") @@ -349,12 +352,13 @@ func executeMain(cmd *cobra.Command, args []string) { // Check operating mode if !operatorOptions.enableDeployment && !operatorOptions.enableDeploymentReplication && !operatorOptions.enableStorage && !operatorOptions.enableBackup && !operatorOptions.enableApps && !operatorOptions.enableK2KClusterSync && - !operatorOptions.enableML && !operatorOptions.enableAnalytics && !operatorOptions.enableNetworking { + !operatorOptions.enableML && !operatorOptions.enableAnalytics && + !operatorOptions.enableNetworking && !operatorOptions.enableScheduler { if !operatorOptions.versionOnly { if version.GetVersionV1().IsEnterprise() { - logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.ml, --operator.analytics, --operator.networking or any combination of these") + logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.ml, --operator.analytics, --operator.networking, --operator.scheduler or any combination of these") } else { - logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.networking or any combination of these") + logger.Fatal("Turn on --operator.deployment, --operator.deployment-replication, --operator.storage, --operator.backup, --operator.apps, --operator.k2k-cluster-sync, --operator.networking, --operator.scheduler or any combination of these") } } } else if operatorOptions.versionOnly { @@ -498,7 +502,11 @@ func executeMain(cmd *cobra.Command, args []string) { }, Networking: server.OperatorDependency{ Enabled: cfg.EnableNetworking, - Probe: &analyticsProbe, + Probe: &networkingProbe, + }, + Scheduler: server.OperatorDependency{ + Enabled: cfg.EnableScheduler, + Probe: &schedulerProbe, }, ClusterSync: server.OperatorDependency{ Enabled: cfg.EnableK2KClusterSync, @@ -585,6 +593,7 @@ func newOperatorConfigAndDeps(id, namespace, name string) (operator.Config, oper EnableML: operatorOptions.enableML, EnableAnalytics: operatorOptions.enableAnalytics, EnableNetworking: operatorOptions.enableNetworking, + EnableScheduler: operatorOptions.enableScheduler, EnableK2KClusterSync: operatorOptions.enableK2KClusterSync, AllowChaos: chaosOptions.allowed, ScalingIntegrationEnabled: operatorOptions.scalingIntegrationEnabled, @@ -606,6 +615,7 @@ func newOperatorConfigAndDeps(id, namespace, name string) (operator.Config, oper MlProbe: &mlProbe, AnalyticsProbe: &analyticsProbe, NetworkingProbe: &networkingProbe, + SchedulerProbe: &schedulerProbe, K2KClusterSyncProbe: &k2KClusterSyncProbe, } diff --git a/docs/cli/arangodb_operator.md b/docs/cli/arangodb_operator.md index 938126a07..0caa979b0 100644 --- a/docs/cli/arangodb_operator.md +++ b/docs/cli/arangodb_operator.md @@ -80,7 +80,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, scheduler-profile-operator, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes @@ -94,6 +94,7 @@ Flags: --operator.networking Enable to run the Networking operator --operator.reconciliation.retry.count int Count of retries during Object Update operations in the Reconciliation loop (default 25) --operator.reconciliation.retry.delay duration Delay between Object Update operations in the Reconciliation loop (default 1s) + --operator.scheduler Enable to run the Scheduler operator --operator.storage Enable to run the ArangoLocalStorage operator --operator.version Enable only version endpoint in Operator --reconciliation.delay duration Delay between reconciliation loops (<= 0 -> Disabled) diff --git a/pkg/apis/scheduler/v1alpha1/profile.go b/pkg/apis/scheduler/v1alpha1/profile.go index 599f866e3..587fef7db 100644 --- a/pkg/apis/scheduler/v1alpha1/profile.go +++ b/pkg/apis/scheduler/v1alpha1/profile.go @@ -43,3 +43,11 @@ type ArangoProfile struct { Spec ProfileSpec `json:"spec"` Status ProfileStatus `json:"status"` } + +func (a *ArangoProfile) GetStatus() ProfileStatus { + return a.Status +} + +func (a *ArangoProfile) SetStatus(status ProfileStatus) { + a.Status = status +} diff --git a/pkg/apis/scheduler/v1beta1/profile.go b/pkg/apis/scheduler/v1beta1/profile.go index 89888779c..843c4639c 100644 --- a/pkg/apis/scheduler/v1beta1/profile.go +++ b/pkg/apis/scheduler/v1beta1/profile.go @@ -43,3 +43,11 @@ type ArangoProfile struct { Spec ProfileSpec `json:"spec"` Status ProfileStatus `json:"status"` } + +func (a *ArangoProfile) GetStatus() ProfileStatus { + return a.Status +} + +func (a *ArangoProfile) SetStatus(status ProfileStatus) { + a.Status = status +} diff --git a/pkg/apis/scheduler/v1beta1/profile_status.go b/pkg/apis/scheduler/v1beta1/profile_status.go index 7652443ac..7f9d98dfb 100644 --- a/pkg/apis/scheduler/v1beta1/profile_status.go +++ b/pkg/apis/scheduler/v1beta1/profile_status.go @@ -20,5 +20,4 @@ package v1beta1 -type ProfileStatus struct { -} +type ProfileStatus struct{} diff --git a/pkg/deployment/resources/inspector/ap.go b/pkg/deployment/resources/inspector/ap.go new file mode 100644 index 000000000..611c85ec8 --- /dev/null +++ b/pkg/deployment/resources/inspector/ap.go @@ -0,0 +1,192 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "context" + "time" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version" +) + +func init() { + requireRegisterInspectorLoader(arangoProfilesInspectorLoaderObj) +} + +var arangoProfilesInspectorLoaderObj = arangoProfilesInspectorLoader{} + +type arangoProfilesInspectorLoader struct { +} + +func (p arangoProfilesInspectorLoader) Component() definitions.Component { + return definitions.ArangoProfile +} + +func (p arangoProfilesInspectorLoader) Load(ctx context.Context, i *inspectorState) { + var q arangoProfilesInspector + p.loadV1Beta1(ctx, i, &q) + i.arangoProfiles = &q + q.state = i + q.last = time.Now() +} + +func (p arangoProfilesInspectorLoader) loadV1Beta1(ctx context.Context, i *inspectorState, q *arangoProfilesInspector) { + var z arangoProfilesInspectorV1Beta1 + + z.arangoProfileInspector = q + + z.arangoProfiles, z.err = p.getV1ArangoProfiles(ctx, i) + + q.v1beta1 = &z +} + +func (p arangoProfilesInspectorLoader) getV1ArangoProfiles(ctx context.Context, i *inspectorState) (map[string]*schedulerApi.ArangoProfile, error) { + objs, err := p.getV1ArangoProfilesList(ctx, i) + if err != nil { + return nil, err + } + + r := make(map[string]*schedulerApi.ArangoProfile, len(objs)) + + for id := range objs { + r[objs[id].GetName()] = objs[id] + } + + return r, nil +} + +func (p arangoProfilesInspectorLoader) getV1ArangoProfilesList(ctx context.Context, i *inspectorState) ([]*schedulerApi.ArangoProfile, error) { + ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) + defer cancel() + obj, err := i.client.Arango().SchedulerV1beta1().ArangoProfiles(i.namespace).List(ctxChild, meta.ListOptions{ + Limit: globals.GetGlobals().Kubernetes().RequestBatchSize().Get(), + }) + + if err != nil { + return nil, err + } + + items := obj.Items + cont := obj.Continue + var s = int64(len(items)) + + if z := obj.RemainingItemCount; z != nil { + s += *z + } + + ptrs := make([]*schedulerApi.ArangoProfile, 0, s) + + for { + for id := range items { + ptrs = append(ptrs, &items[id]) + } + + if cont == "" { + break + } + + items, cont, err = p.getV1ArangoProfilesListRequest(ctx, i, cont) + + if err != nil { + return nil, err + } + } + + return ptrs, nil +} + +func (p arangoProfilesInspectorLoader) getV1ArangoProfilesListRequest(ctx context.Context, i *inspectorState, cont string) ([]schedulerApi.ArangoProfile, string, error) { + ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) + defer cancel() + obj, err := i.client.Arango().SchedulerV1beta1().ArangoProfiles(i.namespace).List(ctxChild, meta.ListOptions{ + Limit: globals.GetGlobals().Kubernetes().RequestBatchSize().Get(), + Continue: cont, + }) + + if err != nil { + return nil, "", err + } + + return obj.Items, obj.Continue, err +} + +func (p arangoProfilesInspectorLoader) Verify(i *inspectorState) error { + return nil +} + +func (p arangoProfilesInspectorLoader) Copy(from, to *inspectorState, override bool) { + if to.arangoProfiles != nil { + if !override { + return + } + } + + to.arangoProfiles = from.arangoProfiles + to.arangoProfiles.state = to +} + +func (p arangoProfilesInspectorLoader) Name() string { + return "arangoProfiles" +} + +type arangoProfilesInspector struct { + state *inspectorState + + last time.Time + + v1beta1 *arangoProfilesInspectorV1Beta1 +} + +func (p *arangoProfilesInspector) LastRefresh() time.Time { + return p.last +} + +func (p *arangoProfilesInspector) Refresh(ctx context.Context) error { + p.Throttle(p.state.throttles).Invalidate() + return p.state.refresh(ctx, arangoProfilesInspectorLoaderObj) +} + +func (p *arangoProfilesInspector) Version() version.Version { + return version.V1 +} + +func (p *arangoProfilesInspector) Throttle(c throttle.Components) throttle.Throttle { + return c.ArangoProfile() +} + +func (p *arangoProfilesInspector) validate() error { + if p == nil { + return errors.Errorf("ArangoProfileInspector is nil") + } + + if p.state == nil { + return errors.Errorf("Parent is nil") + } + + return p.v1beta1.validate() +} diff --git a/pkg/deployment/resources/inspector/ap_anonymous.go b/pkg/deployment/resources/inspector/ap_anonymous.go new file mode 100644 index 000000000..78bc26245 --- /dev/null +++ b/pkg/deployment/resources/inspector/ap_anonymous.go @@ -0,0 +1,45 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *arangoProfilesInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { + g := constants.ArangoProfileGKv1() + + if g.Kind == gvk.Kind && g.Group == gvk.Group { + switch gvk.Version { + case constants.ArangoProfileVersionV1Beta1, DefaultVersion: + if p.v1beta1 == nil || p.v1beta1.err != nil { + return nil, false + } + return anonymous.NewAnonymous[*schedulerApi.ArangoProfile](g, p.state.arangoProfiles.v1beta1, p.state.ArangoProfileModInterface().V1Beta1()), true + } + } + + return nil, false +} diff --git a/pkg/deployment/resources/inspector/ap_gvk.go b/pkg/deployment/resources/inspector/ap_gvk.go new file mode 100644 index 000000000..f73892fde --- /dev/null +++ b/pkg/deployment/resources/inspector/ap_gvk.go @@ -0,0 +1,43 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *arangoProfilesInspectorV1Beta1) GroupVersionKind() schema.GroupVersionKind { + return constants.ArangoProfileGKv1() +} + +func (p *arangoProfilesInspectorV1Beta1) GroupVersionResource() schema.GroupVersionResource { + return constants.ArangoProfileGRv1() +} + +func (p *arangoProfilesInspector) GroupKind() schema.GroupKind { + return constants.ArangoProfileGK() +} + +func (p *arangoProfilesInspector) GroupResource() schema.GroupResource { + return constants.ArangoProfileGR() +} diff --git a/pkg/deployment/resources/inspector/ap_mod.go b/pkg/deployment/resources/inspector/ap_mod.go new file mode 100644 index 000000000..276bb8935 --- /dev/null +++ b/pkg/deployment/resources/inspector/ap_mod.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + arangoProfilev1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/definitions" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/mods" +) + +func (i *inspectorState) ArangoProfileModInterface() mods.ArangoProfileMods { + return arangoProfileMod{ + i: i, + } +} + +type arangoProfileMod struct { + i *inspectorState +} + +func (p arangoProfileMod) V1Beta1() arangoProfilev1.ModInterface { + return wrapMod[*schedulerApi.ArangoProfile](definitions.ArangoProfile, p.i.GetThrottles, p.clientv1beta1) +} + +func (p arangoProfileMod) clientv1beta1() generic.ModStatusClient[*schedulerApi.ArangoProfile] { + return p.i.Client().Arango().SchedulerV1beta1().ArangoProfiles(p.i.Namespace()) +} diff --git a/pkg/deployment/resources/inspector/ap_v1beta1.go b/pkg/deployment/resources/inspector/ap_v1beta1.go new file mode 100644 index 000000000..add18b85c --- /dev/null +++ b/pkg/deployment/resources/inspector/ap_v1beta1.go @@ -0,0 +1,138 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package inspector + +import ( + "context" + + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/constants" +) + +func (p *arangoProfilesInspector) V1Beta1() (ins.Inspector, error) { + if p.v1beta1.err != nil { + return nil, p.v1beta1.err + } + + return p.v1beta1, nil +} + +type arangoProfilesInspectorV1Beta1 struct { + arangoProfileInspector *arangoProfilesInspector + + arangoProfiles map[string]*schedulerApi.ArangoProfile + err error +} + +func (p *arangoProfilesInspectorV1Beta1) Filter(filters ...ins.Filter) []*schedulerApi.ArangoProfile { + z := p.ListSimple() + + r := make([]*schedulerApi.ArangoProfile, 0, len(z)) + + for _, o := range z { + if !ins.FilterObject(o, filters...) { + continue + } + + r = append(r, o) + } + + return r +} + +func (p *arangoProfilesInspectorV1Beta1) validate() error { + if p == nil { + return errors.Errorf("ArangoProfilesV1AlphaInspector is nil") + } + + if p.arangoProfileInspector == nil { + return errors.Errorf("Parent is nil") + } + + if p.arangoProfiles == nil && p.err == nil { + return errors.Errorf("ArangoProfiles or err should be not nil") + } + + if p.arangoProfiles != nil && p.err != nil { + return errors.Errorf("ArangoProfiles or err cannot be not nil together") + } + + return nil +} + +func (p *arangoProfilesInspectorV1Beta1) ListSimple() []*schedulerApi.ArangoProfile { + var r []*schedulerApi.ArangoProfile + for _, arangoProfile := range p.arangoProfiles { + r = append(r, arangoProfile) + } + + return r +} + +func (p *arangoProfilesInspectorV1Beta1) GetSimple(name string) (*schedulerApi.ArangoProfile, bool) { + arangoProfile, ok := p.arangoProfiles[name] + if !ok { + return nil, false + } + + return arangoProfile, true +} + +func (p *arangoProfilesInspectorV1Beta1) Iterate(action ins.Action, filters ...ins.Filter) error { + for _, arangoProfile := range p.arangoProfiles { + if err := p.iterateArangoProfile(arangoProfile, action, filters...); err != nil { + return err + } + } + + return nil +} + +func (p *arangoProfilesInspectorV1Beta1) iterateArangoProfile(arangoProfile *schedulerApi.ArangoProfile, action ins.Action, filters ...ins.Filter) error { + for _, f := range filters { + if f == nil { + continue + } + + if !f(arangoProfile) { + return nil + } + } + + return action(arangoProfile) +} + +func (p *arangoProfilesInspectorV1Beta1) Read() ins.ReadInterface { + return p +} + +func (p *arangoProfilesInspectorV1Beta1) Get(ctx context.Context, name string, opts meta.GetOptions) (*schedulerApi.ArangoProfile, error) { + if s, ok := p.GetSimple(name); !ok { + return nil, apiErrors.NewNotFound(constants.ArangoProfileGR(), name) + } else { + return s, nil + } +} diff --git a/pkg/deployment/resources/inspector/inspector.go b/pkg/deployment/resources/inspector/inspector.go index 8ed7bd964..1a8d7a434 100644 --- a/pkg/deployment/resources/inspector/inspector.go +++ b/pkg/deployment/resources/inspector/inspector.go @@ -42,6 +42,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap" @@ -137,6 +138,7 @@ type inspectorState struct { serviceMonitors *serviceMonitorsInspector arangoMembers *arangoMembersInspector arangoTasks *arangoTasksInspector + arangoProfiles *arangoProfilesInspector arangoRoutes *arangoRoutesInspector arangoClusterSynchronizations *arangoClusterSynchronizationsInspector endpoints *endpointsInspector @@ -172,6 +174,10 @@ func (i *inspectorState) RegisterInformers(k8s informers.SharedInformerFactory, arango.Database().V1().ArangoTasks().Informer().AddEventHandler(i.eventHandler(definitions.ArangoTask)) } + if _, err := i.ArangoProfiles().V1Beta1(); err == nil { + arango.Scheduler().V1beta1().ArangoProfiles().Informer().AddEventHandler(i.eventHandler(definitions.ArangoProfile)) + } + if _, err := i.ArangoRoute().V1Alpha1(); err == nil { arango.Networking().V1alpha1().ArangoRoutes().Informer().AddEventHandler(i.eventHandler(definitions.ArangoRoute)) } @@ -336,6 +342,14 @@ func (i *inspectorState) ArangoRoute() arangoroute.Definition { return i.arangoRoutes } +func (i *inspectorState) ArangoProfile() arangoprofile.Definition { + return i.arangoProfiles +} + +func (i *inspectorState) ArangoProfiles() arangoprofile.Definition { + return i.arangoProfiles +} + func (i *inspectorState) Refresh(ctx context.Context) error { return i.refresh(ctx, inspectorLoadersList...) } @@ -491,6 +505,10 @@ func (i *inspectorState) validate() error { return err } + if err := i.arangoProfiles.validate(); err != nil { + return err + } + if err := i.arangoTasks.validate(); err != nil { return err } @@ -524,6 +542,7 @@ func (i *inspectorState) copyCore() *inspectorState { arangoMembers: i.arangoMembers, arangoTasks: i.arangoTasks, arangoRoutes: i.arangoRoutes, + arangoProfiles: i.arangoProfiles, arangoClusterSynchronizations: i.arangoClusterSynchronizations, throttles: i.throttles.Copy(), versionInfo: i.versionInfo, diff --git a/pkg/deployment/resources/inspector/inspector_test.go b/pkg/deployment/resources/inspector/inspector_test.go index 262fd519a..40b057b76 100644 --- a/pkg/deployment/resources/inspector/inspector_test.go +++ b/pkg/deployment/resources/inspector/inspector_test.go @@ -142,7 +142,7 @@ func getAllTypes() []string { func Test_Inspector_RefreshMatrix(t *testing.T) { c := kclient.NewFakeClient() - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") @@ -302,7 +302,7 @@ func Test_Inspector_Load(t *testing.T) { func Test_Inspector_Invalidate(t *testing.T) { c := kclient.NewFakeClient() - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") diff --git a/pkg/deployment/resources/inspector/pdbs_version_test.go b/pkg/deployment/resources/inspector/pdbs_version_test.go index d0e96460f..01e03d309 100644 --- a/pkg/deployment/resources/inspector/pdbs_version_test.go +++ b/pkg/deployment/resources/inspector/pdbs_version_test.go @@ -52,7 +52,7 @@ func Test_PDB_Versions(t *testing.T) { GitVersion: v, }) - tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) + tc := throttle.NewThrottleComponents(time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour, time.Hour) i := NewInspector(tc, c, "test", "test") require.NoError(t, i.Refresh(context.Background())) diff --git a/pkg/deployment/resources/inspector/throttles.go b/pkg/deployment/resources/inspector/throttles.go index 26baaa36a..67a245a48 100644 --- a/pkg/deployment/resources/inspector/throttles.go +++ b/pkg/deployment/resources/inspector/throttles.go @@ -32,6 +32,7 @@ func NewDefaultThrottle() throttle.Components { 30*time.Second, // ArangoMember 30*time.Second, // ArangoTask 30*time.Second, // ArangoRoute + 30*time.Second, // ArangoProfile 30*time.Second, // Node 30*time.Second, // PV 15*time.Second, // PVC diff --git a/pkg/handlers/networking/route/suite_test.go b/pkg/handlers/networking/route/suite_test.go index dc222725c..f247ecf8e 100644 --- a/pkg/handlers/networking/route/suite_test.go +++ b/pkg/handlers/networking/route/suite_test.go @@ -23,7 +23,7 @@ package route import ( "k8s.io/client-go/kubernetes/fake" - "github.com/arangodb/kube-arangodb/pkg/apis/analytics" + "github.com/arangodb/kube-arangodb/pkg/apis/networking" networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" @@ -51,7 +51,7 @@ func newItem(o operation.Operation, namespace, name string) operation.Item { return operation.Item{ Group: networkingApi.SchemeGroupVersion.Group, Version: networkingApi.SchemeGroupVersion.Version, - Kind: analytics.GraphAnalyticsEngineResourceKind, + Kind: networking.ArangoRouteResourceKind, Operation: o, diff --git a/pkg/handlers/scheduler/profile/handler.go b/pkg/handlers/scheduler/profile/handler.go new file mode 100644 index 000000000..3961ba872 --- /dev/null +++ b/pkg/handlers/scheduler/profile/handler.go @@ -0,0 +1,104 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package profile + +import ( + "context" + + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/logging" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +var logger = logging.Global().RegisterAndGetLogger("scheduler-profile-operator", logging.Info) + +type handler struct { + client arangoClientSet.Interface + kubeClient kubernetes.Interface + + eventRecorder event.RecorderInstance + + operator operator.Operator +} + +func (h *handler) Name() string { + return Kind() +} + +func (h *handler) Handle(ctx context.Context, item operation.Item) error { + // Get Backup object. It also covers NotFound case + + object, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.client.SchedulerV1beta1().ArangoProfiles(item.Namespace).Get, item.Name, meta.GetOptions{}) + if err != nil { + if apiErrors.IsNotFound(err) { + return nil + } + + return err + } + + status := object.Status.DeepCopy() + + changed, reconcileErr := operator.HandleP3WithStop(ctx, item, object, status, h.handle) + if reconcileErr != nil && !operator.IsReconcile(reconcileErr) { + logger.Err(reconcileErr).Warn("Fail for %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + return reconcileErr + } + + if !changed { + return reconcileErr + } + + logger.Debug("Updating %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + if _, err := operator.WithNetworkingArangoProfileUpdateStatusInterfaceRetry(context.Background(), h.client.SchedulerV1beta1().ArangoProfiles(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { + return err + } + + return reconcileErr +} + +func (h *handler) handle(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoProfile, status *schedulerApi.ProfileStatus) (bool, error) { + return false, nil +} + +func (h *handler) CanBeHandled(item operation.Item) bool { + return item.Group == Group() && + item.Version == Version() && + item.Kind == Kind() +} + +func (h *handler) init() {} diff --git a/pkg/handlers/scheduler/profile/handler_test.go b/pkg/handlers/scheduler/profile/handler_test.go new file mode 100644 index 000000000..7e824bd87 --- /dev/null +++ b/pkg/handlers/scheduler/profile/handler_test.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package profile + +import ( + "testing" + + "github.com/stretchr/testify/require" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_ObjectNotFound(t *testing.T) { + // Arrange + handler := newFakeHandler() + + i := newItem(operation.Add, "test", "test") + + actions := map[operation.Operation]bool{ + operation.Add: false, + operation.Update: false, + operation.Delete: false, + } + + // Act + for op, shouldFail := range actions { + t.Run(string(op), func(t *testing.T) { + err := tests.Handle(handler, i) + + // Assert + if shouldFail { + require.Error(t, err) + require.True(t, apiErrors.IsNotFound(err)) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/pkg/handlers/scheduler/profile/local.go b/pkg/handlers/scheduler/profile/local.go new file mode 100644 index 000000000..3fa7f09bc --- /dev/null +++ b/pkg/handlers/scheduler/profile/local.go @@ -0,0 +1,38 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package profile + +import ( + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +func Kind() string { + return scheduler.ArangoProfileResourceKind +} + +func Group() string { + return schedulerApi.SchemeGroupVersion.Group +} + +func Version() string { + return schedulerApi.SchemeGroupVersion.Version +} diff --git a/pkg/handlers/scheduler/profile/register.go b/pkg/handlers/scheduler/profile/register.go new file mode 100644 index 000000000..81bcfe193 --- /dev/null +++ b/pkg/handlers/scheduler/profile/register.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package profile + +import ( + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" +) + +// RegisterInformer into operator +func RegisterInformer(operator operator.Operator, recorder event.Recorder, client arangoClientSet.Interface, + kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) error { + + if err := operator.RegisterInformer(informer.Scheduler().V1beta1().ArangoProfiles().Informer(), + Group(), + Version(), + Kind()); err != nil { + return err + } + + h := &handler{ + client: client, + kubeClient: kubeClient, + + eventRecorder: recorder.NewInstance(Group(), Version(), Kind()), + + operator: operator, + } + + h.init() + + if err := operator.RegisterHandler(h); err != nil { + return err + } + + return nil +} diff --git a/pkg/handlers/scheduler/profile/suite_test.go b/pkg/handlers/scheduler/profile/suite_test.go new file mode 100644 index 000000000..6e5eeb32b --- /dev/null +++ b/pkg/handlers/scheduler/profile/suite_test.go @@ -0,0 +1,61 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package profile + +import ( + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" +) + +func newFakeHandler() *handler { + f := fakeClientSet.NewSimpleClientset() + k := fake.NewSimpleClientset() + + h := &handler{ + client: f, + kubeClient: k, + eventRecorder: event.NewEventRecorder("mock", k).NewInstance(Group(), Version(), Kind()), + operator: operator.NewOperator("mock", "mock", "mock"), + } + + h.init() + + return h +} + +func newItem(o operation.Operation, namespace, name string) operation.Item { + return operation.Item{ + Group: schedulerApi.SchemeGroupVersion.Group, + Version: schedulerApi.SchemeGroupVersion.Version, + Kind: scheduler.ArangoProfileResourceKind, + + Operation: o, + + Namespace: namespace, + Name: name, + } +} diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 586f3bcd1..3d0768819 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -40,6 +40,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/apis/networking" repldef "github.com/arangodb/kube-arangodb/pkg/apis/replication" replapi "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" lsapi "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/arangodb/kube-arangodb/pkg/deployment" arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" @@ -48,6 +49,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/handlers/job" "github.com/arangodb/kube-arangodb/pkg/handlers/networking/route" "github.com/arangodb/kube-arangodb/pkg/handlers/policy" + "github.com/arangodb/kube-arangodb/pkg/handlers/scheduler/profile" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/operator/scope" operatorV2 "github.com/arangodb/kube-arangodb/pkg/operatorV2" @@ -74,6 +76,7 @@ const ( mlOperator operatorV2type = "ml" analyticsOperator operatorV2type = "analytics" networkingOperator operatorV2type = "networking" + schedulerOperator operatorV2type = "scheduler" appsOperator operatorV2type = "apps" ) @@ -106,6 +109,7 @@ type Config struct { EnableML bool EnableAnalytics bool EnableNetworking bool + EnableScheduler bool EnableBackup bool EnableApps bool EnableK2KClusterSync bool @@ -129,6 +133,7 @@ type Dependencies struct { MlProbe *probe.ReadyProbe AnalyticsProbe *probe.ReadyProbe NetworkingProbe *probe.ReadyProbe + SchedulerProbe *probe.ReadyProbe AppsProbe *probe.ReadyProbe K2KClusterSyncProbe *probe.ReadyProbe } @@ -204,6 +209,13 @@ func (o *Operator) Run() { go o.runWithoutLeaderElection("arango-networking-operator", constants.NetworkingLabelRole, o.onStartNetworking, o.Dependencies.NetworkingProbe) } } + if o.Config.EnableScheduler { + if !o.Config.SingleMode { + go o.runLeaderElection("arango-scheduler-operator", constants.SchedulerLabelRole, o.onStartScheduler, o.Dependencies.SchedulerProbe) + } else { + go o.runWithoutLeaderElection("arango-scheduler-operator", constants.SchedulerLabelRole, o.onStartScheduler, o.Dependencies.SchedulerProbe) + } + } if o.Config.EnableK2KClusterSync { // Nothing to do o.log.Warn("K2K Cluster sync is permanently disabled") @@ -279,6 +291,11 @@ func (o *Operator) onStartNetworking(stop <-chan struct{}) { o.onStartOperatorV2(networkingOperator, stop) } +// onStartNetworking starts the operator and run till given channel is closed. +func (o *Operator) onStartScheduler(stop <-chan struct{}) { + o.onStartOperatorV2(schedulerOperator, stop) +} + // onStartOperatorV2 run the operatorV2 type func (o *Operator) onStartOperatorV2(operatorType operatorV2type, stop <-chan struct{}) { operatorName := fmt.Sprintf("arangodb-%s-operator", operatorType) @@ -310,6 +327,9 @@ func (o *Operator) onStartOperatorV2(operatorType operatorV2type, stop <-chan st case networkingOperator: o.onStartOperatorV2Networking(operator, eventRecorder, o.Client.Arango(), o.Client.Kubernetes(), arangoInformer, kubeInformer) o.Dependencies.NetworkingProbe.SetReady() + case schedulerOperator: + o.onStartOperatorV2Scheduler(operator, eventRecorder, o.Client.Arango(), o.Client.Kubernetes(), arangoInformer, kubeInformer) + o.Dependencies.SchedulerProbe.SetReady() } if err := operator.RegisterStarter(arangoInformer); err != nil { @@ -353,6 +373,18 @@ func (o *Operator) onStartOperatorV2Networking(operator operatorV2.Operator, rec } } +func (o *Operator) onStartOperatorV2Scheduler(operator operatorV2.Operator, recorder event.Recorder, client arangoClientSet.Interface, kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) { + checkFn := func() error { + _, err := o.Client.Arango().SchedulerV1beta1().ArangoProfiles(o.Namespace).List(context.Background(), meta.ListOptions{}) + return err + } + o.waitForCRD(scheduler.ArangoProfileCRDName, checkFn) + + if err := profile.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { + panic(err) + } +} + func (o *Operator) onStartOperatorV2Backup(operator operatorV2.Operator, recorder event.Recorder, client arangoClientSet.Interface, kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory) { checkFn := func() error { _, err := o.Client.Arango().BackupV1().ArangoBackups(o.Namespace).List(context.Background(), meta.ListOptions{}) diff --git a/pkg/operatorV2/update_wraps.go b/pkg/operatorV2/update_wraps.go index acae0b86f..9ec789c27 100644 --- a/pkg/operatorV2/update_wraps.go +++ b/pkg/operatorV2/update_wraps.go @@ -30,6 +30,7 @@ import ( mlApiv1alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1alpha1" mlApi "github.com/arangodb/kube-arangodb/pkg/apis/ml/v1beta1" networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" ) func WithArangoBackupUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[backupApi.ArangoBackupStatus, *backupApi.ArangoBackup], obj *backupApi.ArangoBackup, status backupApi.ArangoBackupStatus, opts meta.UpdateOptions) (*backupApi.ArangoBackup, error) { @@ -56,6 +57,10 @@ func WithNetworkingArangoRouteUpdateStatusInterfaceRetry(ctx context.Context, cl return WithUpdateStatusInterfaceRetry[networkingApi.ArangoRouteStatus, *networkingApi.ArangoRoute](ctx, client, obj, status, opts) } +func WithNetworkingArangoProfileUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[schedulerApi.ProfileStatus, *schedulerApi.ArangoProfile], obj *schedulerApi.ArangoProfile, status schedulerApi.ProfileStatus, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) { + return WithUpdateStatusInterfaceRetry[schedulerApi.ProfileStatus, *schedulerApi.ArangoProfile](ctx, client, obj, status, opts) +} + func WithArangoStorageUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage], obj *mlApi.ArangoMLStorage, status mlApi.ArangoMLStorageStatus, opts meta.UpdateOptions) (*mlApi.ArangoMLStorage, error) { return WithUpdateStatusInterfaceRetry[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage](ctx, client, obj, status, opts) } diff --git a/pkg/server/server.go b/pkg/server/server.go index 940cff618..61f67bd0b 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -71,6 +71,7 @@ type Dependencies struct { ML OperatorDependency Analytics OperatorDependency Networking OperatorDependency + Scheduler OperatorDependency ClusterSync OperatorDependency Operators Operators Secrets typedCore.SecretInterface @@ -199,6 +200,10 @@ func NewServer(cli typedCore.CoreV1Interface, cfg Config, deps Dependencies) (*S r.GET("/ready/networking", gin.WrapF(deps.Networking.Probe.ReadyHandler)) readyProbes = append(readyProbes, deps.Networking.Probe) } + if deps.Scheduler.Enabled { + r.GET("/ready/scheduler", gin.WrapF(deps.Scheduler.Probe.ReadyHandler)) + readyProbes = append(readyProbes, deps.Scheduler.Probe) + } r.GET("/ready", gin.WrapF(ready(readyProbes...))) r.GET("/metrics", gin.WrapF(metrics.Handler())) r.POST("/login", s.auth.handleLogin) diff --git a/pkg/util/constants/constants.go b/pkg/util/constants/constants.go index 9b603a1f8..831bec24d 100644 --- a/pkg/util/constants/constants.go +++ b/pkg/util/constants/constants.go @@ -74,6 +74,7 @@ const ( MLLabelRole = "ml/role" AnalyticsLabelRole = "analytics/role" NetworkingLabelRole = "networking/role" + SchedulerLabelRole = "scheduler/role" AppsLabelRole = "apps/role" ClusterSyncLabelRole = "clustersync/role" LabelRole = "role" diff --git a/pkg/util/k8sutil/inspector/arangoprofile/definition.go b/pkg/util/k8sutil/inspector/arangoprofile/definition.go new file mode 100644 index 000000000..cf6e79851 --- /dev/null +++ b/pkg/util/k8sutil/inspector/arangoprofile/definition.go @@ -0,0 +1,44 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package arangoprofile + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" + v1beta1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/refresh" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/version" +) + +type Inspector interface { + ArangoProfile() Definition +} + +type Definition interface { + refresh.Inspector + + gvk.GK + anonymous.Impl + + Version() version.Version + + V1Beta1() (v1beta1.Inspector, error) +} diff --git a/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/loader.go b/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/loader.go new file mode 100644 index 000000000..64844795f --- /dev/null +++ b/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/loader.go @@ -0,0 +1,53 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import ( + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" +) + +type Inspector interface { + gvk.GVK + + ListSimple() []*schedulerApi.ArangoProfile + GetSimple(name string) (*schedulerApi.ArangoProfile, bool) + Filter(filters ...Filter) []*schedulerApi.ArangoProfile + Iterate(action Action, filters ...Filter) error + Read() ReadInterface +} + +type Filter func(at *schedulerApi.ArangoProfile) bool +type Action func(at *schedulerApi.ArangoProfile) error + +func FilterObject(at *schedulerApi.ArangoProfile, filters ...Filter) bool { + for _, f := range filters { + if f == nil { + continue + } + + if !f(at) { + return false + } + } + + return true +} diff --git a/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go b/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go new file mode 100644 index 000000000..1cc3a44cf --- /dev/null +++ b/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import ( + "context" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +// ModInterface has methods to work with ArangoTask resources only for creation +type ModInterface interface { + Create(ctx context.Context, arangotask *schedulerApi.ArangoProfile, opts meta.CreateOptions) (*schedulerApi.ArangoProfile, error) + Update(ctx context.Context, arangotask *schedulerApi.ArangoProfile, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) + UpdateStatus(ctx context.Context, arangotask *schedulerApi.ArangoProfile, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result *schedulerApi.ArangoProfile, err error) + Delete(ctx context.Context, name string, opts meta.DeleteOptions) error +} + +// Interface has methods to work with ArangoTask resources. +type Interface interface { + ModInterface + ReadInterface +} + +// ReadInterface has methods to work with ArangoTask resources with ReadOnly mode. +type ReadInterface interface { + Get(ctx context.Context, name string, opts meta.GetOptions) (*schedulerApi.ArangoProfile, error) +} diff --git a/pkg/util/k8sutil/inspector/constants/ap_constants.go b/pkg/util/k8sutil/inspector/constants/ap_constants.go new file mode 100644 index 000000000..fdcb4960b --- /dev/null +++ b/pkg/util/k8sutil/inspector/constants/ap_constants.go @@ -0,0 +1,66 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package constants + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +// ArangoProfile +const ( + ArangoProfileGroup = scheduler.ArangoSchedulerGroupName + ArangoProfileResource = scheduler.ArangoProfileResourcePlural + ArangoProfileKind = scheduler.ArangoProfileResourceKind + ArangoProfileVersionV1Beta1 = schedulerApi.ArangoSchedulerVersion +) + +func ArangoProfileGK() schema.GroupKind { + return schema.GroupKind{ + Group: ArangoProfileGroup, + Kind: ArangoProfileKind, + } +} + +func ArangoProfileGKv1() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: ArangoProfileGroup, + Kind: ArangoProfileKind, + Version: ArangoProfileVersionV1Beta1, + } +} + +func ArangoProfileGR() schema.GroupResource { + return schema.GroupResource{ + Group: ArangoProfileGroup, + Resource: ArangoProfileResource, + } +} + +func ArangoProfileGRv1() schema.GroupVersionResource { + return schema.GroupVersionResource{ + Group: ArangoProfileGroup, + Resource: ArangoProfileResource, + Version: ArangoProfileVersionV1Beta1, + } +} diff --git a/pkg/util/k8sutil/inspector/constants/gvk.go b/pkg/util/k8sutil/inspector/constants/gvk.go index 3bce1cc17..e1128171d 100644 --- a/pkg/util/k8sutil/inspector/constants/gvk.go +++ b/pkg/util/k8sutil/inspector/constants/gvk.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" ) func ExtractGVKFromObject(in interface{}) (schema.GroupVersionKind, bool) { @@ -38,6 +40,10 @@ func ExtractGVKFromObject(in interface{}) (schema.GroupVersionKind, bool) { return ArangoMemberGKv1(), true case *api.ArangoTask, api.ArangoTask: return ArangoTaskGKv1(), true + case *schedulerApi.ArangoProfile, schedulerApi.ArangoProfile: + return ArangoProfileGKv1(), true + case *networkingApi.ArangoRoute, networkingApi.ArangoRoute: + return ArangoRouteGKv1(), true case *core.Endpoints, core.Endpoints: return EndpointsGKv1(), true case *core.Node, core.Node: diff --git a/pkg/util/k8sutil/inspector/constants/gvk_test.go b/pkg/util/k8sutil/inspector/constants/gvk_test.go index 0abb7a1f6..de91cb980 100644 --- a/pkg/util/k8sutil/inspector/constants/gvk_test.go +++ b/pkg/util/k8sutil/inspector/constants/gvk_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,12 +31,17 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" ) func Test_GVK(t *testing.T) { testGVK(t, ArangoClusterSynchronizationGKv1(), &api.ArangoClusterSynchronization{}, api.ArangoClusterSynchronization{}) testGVK(t, ArangoMemberGKv1(), &api.ArangoMember{}, api.ArangoMember{}) testGVK(t, ArangoTaskGKv1(), &api.ArangoTask{}, api.ArangoTask{}) + testGVK(t, ArangoRouteGKv1(), &networkingApi.ArangoRoute{}, networkingApi.ArangoRoute{}) + testGVK(t, ArangoProfileGKv1(), &schedulerApi.ArangoProfile{}, schedulerApi.ArangoProfile{}) + testGVK(t, ArangoTaskGKv1(), &api.ArangoTask{}, api.ArangoTask{}) testGVK(t, EndpointsGKv1(), &core.Endpoints{}, core.Endpoints{}) testGVK(t, NodeGKv1(), &core.Node{}, core.Node{}) testGVK(t, PodDisruptionBudgetGKv1(), &policy.PodDisruptionBudget{}, policy.PodDisruptionBudget{}) diff --git a/pkg/util/k8sutil/inspector/definitions/components.go b/pkg/util/k8sutil/inspector/definitions/components.go index e78759c2a..886cddaf3 100644 --- a/pkg/util/k8sutil/inspector/definitions/components.go +++ b/pkg/util/k8sutil/inspector/definitions/components.go @@ -29,6 +29,7 @@ const ( ArangoMember Component = "ArangoMember" ArangoTask Component = "ArangoTask" ArangoRoute Component = "ArangoRoute" + ArangoProfile Component = "ArangoProfile" Node Component = "Node" PersistentVolume Component = "PersistentVolume" PersistentVolumeClaim Component = "PersistentVolumeClaim" @@ -48,6 +49,7 @@ func AllComponents() []Component { ArangoMember, ArangoTask, ArangoRoute, + ArangoProfile, Node, PersistentVolume, PersistentVolumeClaim, diff --git a/pkg/util/k8sutil/inspector/inspector.go b/pkg/util/k8sutil/inspector/inspector.go index 6064b7e0a..41a1631aa 100644 --- a/pkg/util/k8sutil/inspector/inspector.go +++ b/pkg/util/k8sutil/inspector/inspector.go @@ -32,6 +32,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangodeployment" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap" @@ -94,6 +95,7 @@ type Inspector interface { arangoclustersynchronization.Inspector arangotask.Inspector arangoroute.Inspector + arangoprofile.Inspector mods.Mods diff --git a/pkg/util/k8sutil/inspector/mods/mods.go b/pkg/util/k8sutil/inspector/mods/mods.go index 3f1e2761c..62eeb6295 100644 --- a/pkg/util/k8sutil/inspector/mods/mods.go +++ b/pkg/util/k8sutil/inspector/mods/mods.go @@ -23,6 +23,7 @@ package mods import ( arangoclustersynchronizationv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization/v1" arangomemberv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember/v1" + arangoProfilev1beta1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile/v1beta1" arangoroutev1alpha1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoroute/v1alpha1" arangotaskv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask/v1" configMapv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" @@ -88,6 +89,10 @@ type ArangoRouteMods interface { V1Alpha1() arangoroutev1alpha1.ModInterface } +type ArangoProfileMods interface { + V1Beta1() arangoProfilev1beta1.ModInterface +} + type Mods interface { PodsModInterface() PodsMods ServiceAccountsModInterface() ServiceAccountsMods @@ -103,4 +108,5 @@ type Mods interface { ArangoTaskModInterface() ArangoTaskMods ArangoClusterSynchronizationModInterface() ArangoClusterSynchronizationMods ArangoRouteModInterface() ArangoRouteMods + ArangoProfileModInterface() ArangoProfileMods } diff --git a/pkg/util/k8sutil/inspector/throttle/throttle.go b/pkg/util/k8sutil/inspector/throttle/throttle.go index 0fe1afde6..d1a178737 100644 --- a/pkg/util/k8sutil/inspector/throttle/throttle.go +++ b/pkg/util/k8sutil/inspector/throttle/throttle.go @@ -32,15 +32,16 @@ type Inspector interface { } func NewAlwaysThrottleComponents() Components { - return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + return NewThrottleComponents(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) } -func NewThrottleComponents(acs, am, at, ar, node, pvc, pod, pv, pdb, secret, cm, service, serviceAccount, sm, endpoints time.Duration) Components { +func NewThrottleComponents(acs, am, at, ar, ap, node, pvc, pod, pv, pdb, secret, cm, service, serviceAccount, sm, endpoints time.Duration) Components { return &throttleComponents{ arangoClusterSynchronization: NewThrottle(acs), arangoMember: NewThrottle(am), arangoTask: NewThrottle(at), arangoRoute: NewThrottle(ar), + arangoProfile: NewThrottle(ap), node: NewThrottle(node), persistentVolume: NewThrottle(pv), persistentVolumeClaim: NewThrottle(pvc), @@ -60,6 +61,7 @@ type Components interface { ArangoMember() Throttle ArangoTask() Throttle ArangoRoute() Throttle + ArangoProfile() Throttle Node() Throttle PersistentVolume() Throttle PersistentVolumeClaim() Throttle @@ -84,6 +86,7 @@ type throttleComponents struct { arangoMember Throttle arangoTask Throttle arangoRoute Throttle + arangoProfile Throttle node Throttle persistentVolume Throttle persistentVolumeClaim Throttle @@ -138,6 +141,8 @@ func (t *throttleComponents) Get(c definitions.Component) Throttle { return t.arangoTask case definitions.ArangoRoute: return t.arangoRoute + case definitions.ArangoProfile: + return t.arangoProfile case definitions.Node: return t.node case definitions.PersistentVolume: @@ -171,6 +176,7 @@ func (t *throttleComponents) Copy() Components { arangoMember: t.arangoMember.Copy(), arangoTask: t.arangoTask.Copy(), arangoRoute: t.arangoRoute.Copy(), + arangoProfile: t.arangoProfile.Copy(), node: t.node.Copy(), persistentVolume: t.persistentVolume.Copy(), persistentVolumeClaim: t.persistentVolumeClaim.Copy(), @@ -201,6 +207,10 @@ func (t *throttleComponents) ArangoRoute() Throttle { return t.arangoRoute } +func (t *throttleComponents) ArangoProfile() Throttle { + return t.arangoProfile +} + func (t *throttleComponents) Node() Throttle { return t.node } From 3d46436c593428cc4950514aadd92215e7d00237 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:36:51 +0200 Subject: [PATCH 28/50] [Feature] [Gateway] Add Auth Token (#1717) --- CHANGELOG.md | 1 + docs/api/ArangoRoute.V1Alpha1.md | 14 +- go.mod | 4 +- integrations/envoy/auth/v3/adb_helper.go | 120 ++++++++++++++++++ integrations/envoy/auth/v3/check_adb_jwt.go | 12 +- integrations/envoy/auth/v3/consts.go | 1 + integrations/envoy/auth/v3/impl.go | 76 ++++++++--- .../route_spec_authentication_pass_mode.go | 63 +++++++++ ...n.go => route_spec_authentication_type.go} | 0 .../route_spec_destination_authentication.go | 12 +- .../route_status_target_authentication.go | 5 +- .../v1alpha1/zz_generated.deepcopy.go | 5 + .../networking-route.schema.generated.yaml | 2 + .../resources/config_map_gateway.go | 3 +- .../networking/route/handler_destination.go | 1 + 15 files changed, 284 insertions(+), 35 deletions(-) create mode 100644 integrations/envoy/auth/v3/adb_helper.go create mode 100644 pkg/apis/networking/v1alpha1/route_spec_authentication_pass_mode.go rename pkg/apis/networking/v1alpha1/{route_spec_authentication.go => route_spec_authentication_type.go} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3064aa46e..cd801c513 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - (Maintenance) Bump Examples to ArangoDB 3.12 - (Feature) (Gateway) ArangoDB JWT Auth Integration - (Feature) Scheduler Handler +- (Feature) (Gateway) ArangoDB Auth Token ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/docs/api/ArangoRoute.V1Alpha1.md b/docs/api/ArangoRoute.V1Alpha1.md index b083aa436..2dc3b2302 100644 --- a/docs/api/ArangoRoute.V1Alpha1.md +++ b/docs/api/ArangoRoute.V1Alpha1.md @@ -16,12 +16,18 @@ Deployment specifies the ArangoDeployment object name *** -### .spec.destination.authentication.type +### .spec.destination.authentication.passMode Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L28) *** +### .spec.destination.authentication.type + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L29) + +*** + ### .spec.destination.path Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L36) @@ -137,6 +143,12 @@ UID keeps the information about object UID *** +### .status.target.authentication.passMode + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_authentication.go#L27) + +*** + ### .status.target.authentication.type Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_authentication.go#L26) diff --git a/go.mod b/go.mod index abba2e954..beb5040e7 100644 --- a/go.mod +++ b/go.mod @@ -68,6 +68,8 @@ require ( k8s.io/client-go v0.29.6 k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a sigs.k8s.io/yaml v1.4.0 + github.com/golang/protobuf v1.5.4 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 ) require ( @@ -96,7 +98,6 @@ require ( github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect @@ -132,7 +133,6 @@ require ( golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog/v2 v2.110.1 // indirect diff --git a/integrations/envoy/auth/v3/adb_helper.go b/integrations/envoy/auth/v3/adb_helper.go new file mode 100644 index 000000000..f162c9dad --- /dev/null +++ b/integrations/envoy/auth/v3/adb_helper.go @@ -0,0 +1,120 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v3 + +import ( + "context" + "sync" + "time" + + "google.golang.org/protobuf/types/known/durationpb" + + pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +const ( + DefaultLifetime = time.Minute * 5 + DefaultTTL = time.Minute +) + +func NewADBHelper(client pbAuthenticationV1.AuthenticationV1Client) ADBHelper { + return &adbHelper{ + client: client, + cache: map[string]adbHelperToken{}, + } +} + +type ADBHelper interface { + Validate(ctx context.Context, token string) (*AuthResponse, error) + Token(ctx context.Context, resp *AuthResponse) (string, bool, error) +} + +type adbHelperToken struct { + TTL time.Time + Token string +} + +type adbHelper struct { + lock sync.Mutex + cache map[string]adbHelperToken + + client pbAuthenticationV1.AuthenticationV1Client +} + +func (a *adbHelper) Token(ctx context.Context, resp *AuthResponse) (string, bool, error) { + a.lock.Lock() + defer a.lock.Unlock() + + if resp == nil { + // Token cannot be fetch if authentication is not valid + return "", false, nil + } + + v, ok := a.cache[resp.Username] + if ok { + // We received token + if time.Now().Before(v.TTL) { + return v.Token, true, nil + } + // Token has been expired + delete(a.cache, resp.Username) + } + + // We did not receive token, create one + auth, err := a.client.CreateToken(ctx, &pbAuthenticationV1.CreateTokenRequest{ + Lifetime: durationpb.New(DefaultLifetime), + User: util.NewType(resp.Username), + }) + if err != nil { + return "", false, err + } + + a.cache[resp.Username] = adbHelperToken{ + TTL: time.Now().Add(DefaultTTL), + Token: auth.GetToken(), + } + + return auth.GetToken(), true, nil +} + +func (a *adbHelper) Validate(ctx context.Context, token string) (*AuthResponse, error) { + a.lock.Lock() + defer a.lock.Unlock() + + resp, err := a.client.Validate(ctx, &pbAuthenticationV1.ValidateRequest{ + Token: token, + }) + + if err != nil { + return nil, err + } + + if resp.GetIsValid() { + if det := resp.GetDetails(); det != nil { + return &AuthResponse{ + Username: det.GetUser(), + }, nil + } + } + + return nil, nil +} diff --git a/integrations/envoy/auth/v3/check_adb_jwt.go b/integrations/envoy/auth/v3/check_adb_jwt.go index fc96d9ba4..c05eda154 100644 --- a/integrations/envoy/auth/v3/check_adb_jwt.go +++ b/integrations/envoy/auth/v3/check_adb_jwt.go @@ -25,7 +25,6 @@ import ( pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" - pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition" "github.com/arangodb/kube-arangodb/pkg/util/strings" ) @@ -38,20 +37,13 @@ func (i *impl) checkADBJWT(ctx context.Context, request *pbEnvoyAuthV3.CheckRequ parts := strings.SplitN(auth, " ", 2) if len(parts) == 2 { if strings.ToLower(parts[0]) == "bearer" { - resp, err := i.authClient.Validate(ctx, &pbAuthenticationV1.ValidateRequest{ - Token: parts[1], - }) + resp, err := i.helper.Validate(ctx, parts[1]) if err != nil { logger.Err(err).Warn("Auth failure") return nil, nil } - if err == nil && resp.GetIsValid() { - // All went fine! - return &AuthResponse{ - Username: resp.GetDetails().GetUser(), - }, nil - } + return resp, nil } } } diff --git a/integrations/envoy/auth/v3/consts.go b/integrations/envoy/auth/v3/consts.go index ae414cd3e..2746fd2da 100644 --- a/integrations/envoy/auth/v3/consts.go +++ b/integrations/envoy/auth/v3/consts.go @@ -33,6 +33,7 @@ const ( AuthConfigTypeValue = "ArangoDBPlatform" AuthConfigAuthRequiredKey = AuthConfigAuthNamespace + "/required" + AuthConfigAuthPassModeKey = AuthConfigAuthNamespace + "/pass_mode" AuthUsernameHeader = "arangodb-platform-user" AuthAuthenticatedHeader = "arangodb-platform-authenticated" diff --git a/integrations/envoy/auth/v3/impl.go b/integrations/envoy/auth/v3/impl.go index 7c6a96bf7..a0e9f347f 100644 --- a/integrations/envoy/auth/v3/impl.go +++ b/integrations/envoy/auth/v3/impl.go @@ -22,13 +22,16 @@ package v3 import ( "context" + "fmt" "net/http" + "strings" corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" pbEnvoyAuthV3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" "google.golang.org/grpc" pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/errors/panics" @@ -37,7 +40,7 @@ import ( func New(authClient pbAuthenticationV1.AuthenticationV1Client) svc.Handler { return &impl{ - authClient: authClient, + helper: NewADBHelper(authClient), } } @@ -47,7 +50,7 @@ var _ svc.Handler = &impl{} type impl struct { pbEnvoyAuthV3.UnimplementedAuthorizationServer - authClient pbAuthenticationV1.AuthenticationV1Client + helper ADBHelper } func (i *impl) Name() string { @@ -104,25 +107,62 @@ func (i *impl) check(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest) ( } if authenticated != nil { + var headers = []*corev3.HeaderValueOption{ + { + Header: &corev3.HeaderValue{ + Key: AuthUsernameHeader, + Value: authenticated.Username, + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }, + { + Header: &corev3.HeaderValue{ + Key: AuthAuthenticatedHeader, + Value: "true", + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }, + } + + switch networkingApi.ArangoRouteSpecAuthenticationPassMode(strings.ToLower(util.Optional(ext, AuthConfigAuthPassModeKey, ""))) { + case networkingApi.ArangoRouteSpecAuthenticationPassModeOverride: + token, ok, err := i.helper.Token(ctx, authenticated) + if err != nil { + return nil, err + } + + if !ok { + return nil, DeniedResponse{ + Code: http.StatusUnauthorized, + Message: &DeniedMessage{ + Message: "Unable to render token", + }, + } + } + + headers = append(headers, &corev3.HeaderValueOption{ + Header: &corev3.HeaderValue{ + Key: "authorization", + Value: fmt.Sprintf("bearer %s", token), + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + }, + ) + case networkingApi.ArangoRouteSpecAuthenticationPassModeRemove: + headers = append(headers, &corev3.HeaderValueOption{ + Header: &corev3.HeaderValue{ + Key: "authorization", + }, + AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, + KeepEmptyValue: false, + }, + ) + } + return &pbEnvoyAuthV3.CheckResponse{ HttpResponse: &pbEnvoyAuthV3.CheckResponse_OkResponse{ OkResponse: &pbEnvoyAuthV3.OkHttpResponse{ - Headers: []*corev3.HeaderValueOption{ - { - Header: &corev3.HeaderValue{ - Key: AuthUsernameHeader, - Value: authenticated.Username, - }, - AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, - }, - { - Header: &corev3.HeaderValue{ - Key: AuthAuthenticatedHeader, - Value: "true", - }, - AppendAction: corev3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, - }, - }, + Headers: headers, }, }, }, nil diff --git a/pkg/apis/networking/v1alpha1/route_spec_authentication_pass_mode.go b/pkg/apis/networking/v1alpha1/route_spec_authentication_pass_mode.go new file mode 100644 index 000000000..0089c01ae --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_authentication_pass_mode.go @@ -0,0 +1,63 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type ArangoRouteSpecAuthenticationPassMode string + +const ( + ArangoRouteSpecAuthenticationPassModePass ArangoRouteSpecAuthenticationPassMode = "pass" + ArangoRouteSpecAuthenticationPassModeOverride ArangoRouteSpecAuthenticationPassMode = "override" + ArangoRouteSpecAuthenticationPassModeRemove ArangoRouteSpecAuthenticationPassMode = "remove" +) + +func (a *ArangoRouteSpecAuthenticationPassMode) Get() ArangoRouteSpecAuthenticationPassMode { + if a == nil { + return ArangoRouteSpecAuthenticationPassModeOverride + } + switch v := *a; v { + case ArangoRouteSpecAuthenticationPassModePass, ArangoRouteSpecAuthenticationPassModeOverride, ArangoRouteSpecAuthenticationPassModeRemove: + return v + } + + return "" +} + +func (a *ArangoRouteSpecAuthenticationPassMode) Validate() error { + switch v := a.Get(); v { + case ArangoRouteSpecAuthenticationPassModePass, ArangoRouteSpecAuthenticationPassModeOverride, ArangoRouteSpecAuthenticationPassModeRemove: + return nil + default: + return errors.Errorf("Invalid AuthPassMode: %s", v) + } +} + +func (a *ArangoRouteSpecAuthenticationPassMode) Hash() string { + if a == nil { + return "" + } + + return util.SHA256FromString(string(*a)) +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_authentication.go b/pkg/apis/networking/v1alpha1/route_spec_authentication_type.go similarity index 100% rename from pkg/apis/networking/v1alpha1/route_spec_authentication.go rename to pkg/apis/networking/v1alpha1/route_spec_authentication_type.go diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go b/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go index 47225cab4..9ef89aba8 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go @@ -25,7 +25,8 @@ import ( ) type ArangoRouteSpecDestinationAuthentication struct { - Type *ArangoRouteSpecAuthenticationType `json:"type,omitempty"` + PassMode *ArangoRouteSpecAuthenticationPassMode `json:"passMode,omitempty"` + Type *ArangoRouteSpecAuthenticationType `json:"type,omitempty"` } func (a *ArangoRouteSpecDestinationAuthentication) GetType() ArangoRouteSpecAuthenticationType { @@ -36,6 +37,14 @@ func (a *ArangoRouteSpecDestinationAuthentication) GetType() ArangoRouteSpecAuth return a.Type.Get() } +func (a *ArangoRouteSpecDestinationAuthentication) GetPassMode() ArangoRouteSpecAuthenticationPassMode { + if a == nil { + return ArangoRouteSpecAuthenticationPassModeOverride + } + + return a.PassMode.Get() +} + func (a *ArangoRouteSpecDestinationAuthentication) Validate() error { if a == nil { return nil @@ -43,5 +52,6 @@ func (a *ArangoRouteSpecDestinationAuthentication) Validate() error { return shared.WithErrors( shared.ValidateOptionalInterfacePath("type", a.Type), + shared.ValidateOptionalInterfacePath("passMode", a.PassMode), ) } diff --git a/pkg/apis/networking/v1alpha1/route_status_target_authentication.go b/pkg/apis/networking/v1alpha1/route_status_target_authentication.go index e24014189..f6e1f17b8 100644 --- a/pkg/apis/networking/v1alpha1/route_status_target_authentication.go +++ b/pkg/apis/networking/v1alpha1/route_status_target_authentication.go @@ -23,12 +23,13 @@ package v1alpha1 import "github.com/arangodb/kube-arangodb/pkg/util" type ArangoRouteStatusTargetAuthentication struct { - Type ArangoRouteSpecAuthenticationType `json:"type,omitempty"` + Type ArangoRouteSpecAuthenticationType `json:"type,omitempty"` + PassMode ArangoRouteSpecAuthenticationPassMode `json:"passMode,omitempty"` } func (a *ArangoRouteStatusTargetAuthentication) Hash() string { if a == nil { return "" } - return util.SHA256FromStringArray(a.Type.Hash()) + return util.SHA256FromStringArray(a.Type.Hash(), a.PassMode.Hash()) } diff --git a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go index b1cf33eed..31e9cff51 100644 --- a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go @@ -168,6 +168,11 @@ func (in *ArangoRouteSpecDestination) DeepCopy() *ArangoRouteSpecDestination { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArangoRouteSpecDestinationAuthentication) DeepCopyInto(out *ArangoRouteSpecDestinationAuthentication) { *out = *in + if in.PassMode != nil { + in, out := &in.PassMode, &out.PassMode + *out = new(ArangoRouteSpecAuthenticationPassMode) + **out = **in + } if in.Type != nil { in, out := &in.Type, &out.Type *out = new(ArangoRouteSpecAuthenticationType) diff --git a/pkg/crd/crds/networking-route.schema.generated.yaml b/pkg/crd/crds/networking-route.schema.generated.yaml index 5751f46b1..d973e59fb 100644 --- a/pkg/crd/crds/networking-route.schema.generated.yaml +++ b/pkg/crd/crds/networking-route.schema.generated.yaml @@ -12,6 +12,8 @@ v1alpha1: authentication: description: Authentication defines auth methods properties: + passMode: + type: string type: type: string type: object diff --git a/pkg/deployment/resources/config_map_gateway.go b/pkg/deployment/resources/config_map_gateway.go index 9285e38f8..57c54fc98 100644 --- a/pkg/deployment/resources/config_map_gateway.go +++ b/pkg/deployment/resources/config_map_gateway.go @@ -197,7 +197,8 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto dest.Path = util.NewType(target.Path) dest.AuthExtension = &gateway.ConfigAuthZExtension{ AuthZExtension: map[string]string{ - pbImplEnvoyAuthV3.AuthConfigAuthRequiredKey: util.BoolSwitch(target.Authentication.Type.Get() == networkingApi.ArangoRouteSpecAuthenticationTypeRequired, pbImplEnvoyAuthV3.AuthConfigKeywordTrue, pbImplEnvoyAuthV3.AuthConfigKeywordFalse), + pbImplEnvoyAuthV3.AuthConfigAuthRequiredKey: util.BoolSwitch[string](target.Authentication.Type.Get() == networkingApi.ArangoRouteSpecAuthenticationTypeRequired, pbImplEnvoyAuthV3.AuthConfigKeywordTrue, pbImplEnvoyAuthV3.AuthConfigKeywordFalse), + pbImplEnvoyAuthV3.AuthConfigAuthPassModeKey: string(target.Authentication.PassMode), }, } cfg.Destinations[at.Spec.GetRoute().GetPath()] = dest diff --git a/pkg/handlers/networking/route/handler_destination.go b/pkg/handlers/networking/route/handler_destination.go index 7a618ffed..dfa1e65fd 100644 --- a/pkg/handlers/networking/route/handler_destination.go +++ b/pkg/handlers/networking/route/handler_destination.go @@ -124,6 +124,7 @@ func (h *handler) HandleArangoDestination(ctx context.Context, item operation.It // Render Auth Settings target.Authentication.Type = dest.GetAuthentication().GetType() + target.Authentication.PassMode = dest.GetAuthentication().GetPassMode() if dest.Schema.Get() == networkingApi.ArangoRouteSpecDestinationSchemaHTTPS { target.TLS = &networkingApi.ArangoRouteStatusTargetTLS{ From fe97fc3cc08712a6aca47b45d02f57c333c48d09 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 9 Sep 2024 20:00:31 +0200 Subject: [PATCH 29/50] [Feature] [Gateway] Dynamic Configuration (#1718) --- CHANGELOG.md | 1 + docs/api/ArangoDeployment.V1.md | 13 +- .../deployment/v1/deployment_spec_gateway.go | 14 ++ .../deployment/v1/zz_generated.deepcopy.go | 5 + .../v2alpha1/deployment_spec_gateway.go | 14 ++ .../v2alpha1/zz_generated.deepcopy.go | 5 + .../database-deployment.schema.generated.yaml | 10 + .../resources/config_map_gateway.go | 35 ++-- .../resources/config_map_gateway_member.go | 50 +++++ pkg/deployment/resources/config_maps.go | 3 + .../resources/config_maps_member.go | 172 ++++++++++++++++++ pkg/deployment/resources/gateway/dynamic.go | 93 ++++++++++ .../resources/gateway/gateway_config.go | 53 +++++- pkg/deployment/resources/gateway/marshal.go | 41 +++++ pkg/deployment/resources/pod_creator.go | 7 +- .../resources/pod_creator_gateway.go | 35 ++-- .../pod_creator_gateway_container.go | 26 ++- pkg/generated/timezones/timezones_test.go | 8 +- pkg/util/checksum.go | 8 + pkg/util/dict.go | 6 + 20 files changed, 552 insertions(+), 47 deletions(-) create mode 100644 pkg/deployment/resources/config_map_gateway_member.go create mode 100644 pkg/deployment/resources/config_maps_member.go create mode 100644 pkg/deployment/resources/gateway/dynamic.go create mode 100644 pkg/deployment/resources/gateway/marshal.go diff --git a/CHANGELOG.md b/CHANGELOG.md index cd801c513..9338e16d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - (Feature) (Gateway) ArangoDB JWT Auth Integration - (Feature) Scheduler Handler - (Feature) (Gateway) ArangoDB Auth Token +- (Feature) (Gateway) Dynamic Configuration ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 7c3763641..8ca8d7f04 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3043,6 +3043,17 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. *** +### .spec.gateway.dynamic + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L38) + +Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. +When enabled, gateway config will be reloaded by ConfigMap live updates. + +Default Value: `false` + +*** + ### .spec.gateway.enabled Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L33) @@ -3056,7 +3067,7 @@ Default Value: `false` ### .spec.gateway.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L37) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L42) Image is the image to use for the gateway. By default, the image is determined by the operator. diff --git a/pkg/apis/deployment/v1/deployment_spec_gateway.go b/pkg/apis/deployment/v1/deployment_spec_gateway.go index c194f1880..7cc263783 100644 --- a/pkg/apis/deployment/v1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v1/deployment_spec_gateway.go @@ -32,6 +32,11 @@ type DeploymentSpecGateway struct { // +doc/default: false Enabled *bool `json:"enabled,omitempty"` + // Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. + // When enabled, gateway config will be reloaded by ConfigMap live updates. + // +doc/default: false + Dynamic *bool `json:"dynamic,omitempty"` + // Image is the image to use for the gateway. // By default, the image is determined by the operator. Image *string `json:"image"` @@ -49,6 +54,15 @@ func (d *DeploymentSpecGateway) IsEnabled() bool { return *d.Enabled } +// IsDynamic returns whether the gateway dynamic config is enabled. +func (d *DeploymentSpecGateway) IsDynamic() bool { + if d == nil || d.Dynamic == nil { + return false + } + + return *d.Dynamic +} + func (d *DeploymentSpecGateway) GetSidecar() *schedulerApi.IntegrationSidecar { if d == nil || d.Sidecar == nil { return nil diff --git a/pkg/apis/deployment/v1/zz_generated.deepcopy.go b/pkg/apis/deployment/v1/zz_generated.deepcopy.go index 5993516d7..5c7fe4b2d 100644 --- a/pkg/apis/deployment/v1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1/zz_generated.deepcopy.go @@ -1180,6 +1180,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(bool) **out = **in } + if in.Dynamic != nil { + in, out := &in.Dynamic, &out.Dynamic + *out = new(bool) + **out = **in + } if in.Image != nil { in, out := &in.Image, &out.Image *out = new(string) diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go index 166916462..fe897b2b4 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go @@ -32,6 +32,11 @@ type DeploymentSpecGateway struct { // +doc/default: false Enabled *bool `json:"enabled,omitempty"` + // Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. + // When enabled, gateway config will be reloaded by ConfigMap live updates. + // +doc/default: false + Dynamic *bool `json:"dynamic,omitempty"` + // Image is the image to use for the gateway. // By default, the image is determined by the operator. Image *string `json:"image"` @@ -49,6 +54,15 @@ func (d *DeploymentSpecGateway) IsEnabled() bool { return *d.Enabled } +// IsDynamic returns whether the gateway dynamic config is enabled. +func (d *DeploymentSpecGateway) IsDynamic() bool { + if d == nil || d.Dynamic == nil { + return false + } + + return *d.Dynamic +} + func (d *DeploymentSpecGateway) GetSidecar() *schedulerApi.IntegrationSidecar { if d == nil || d.Sidecar == nil { return nil diff --git a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go index f0ed3e2e3..12de5471e 100644 --- a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go @@ -1180,6 +1180,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(bool) **out = **in } + if in.Dynamic != nil { + in, out := &in.Dynamic, &out.Dynamic + *out = new(bool) + **out = **in + } if in.Image != nil { in, out := &in.Image, &out.Image *out = new(string) diff --git a/pkg/crd/crds/database-deployment.schema.generated.yaml b/pkg/crd/crds/database-deployment.schema.generated.yaml index af86e39dc..2ee177b8e 100644 --- a/pkg/crd/crds/database-deployment.schema.generated.yaml +++ b/pkg/crd/crds/database-deployment.schema.generated.yaml @@ -6567,6 +6567,11 @@ v1: gateway: description: Gateway defined main Gateway configuration. properties: + dynamic: + description: |- + Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. + When enabled, gateway config will be reloaded by ConfigMap live updates. + type: boolean enabled: description: |- Enabled setting enables/disables support for gateway in the cluster. @@ -23084,6 +23089,11 @@ v1alpha: gateway: description: Gateway defined main Gateway configuration. properties: + dynamic: + description: |- + Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. + When enabled, gateway config will be reloaded by ConfigMap live updates. + type: boolean enabled: description: |- Enabled setting enables/disables support for gateway in the cluster. diff --git a/pkg/deployment/resources/config_map_gateway.go b/pkg/deployment/resources/config_map_gateway.go index 57c54fc98..f539e40a4 100644 --- a/pkg/deployment/resources/config_map_gateway.go +++ b/pkg/deployment/resources/config_map_gateway.go @@ -55,7 +55,26 @@ func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspec return errors.WithStack(errors.Wrapf(err, "Failed to generate gateway config")) } - gatewayCfgYaml, gatewayCfgChecksum, _, err := cfg.RenderYAML() + gatewayCfgYaml, _, _, err := cfg.RenderYAML() + if err != nil { + return errors.WithStack(errors.Wrapf(err, "Failed to render gateway config")) + } + + gatewayCfgCDSYaml, _, _, err := cfg.RenderCDSYAML() + if err != nil { + return errors.WithStack(errors.Wrapf(err, "Failed to render gateway cds config")) + } + + gatewayCfgLDSYaml, _, _, err := cfg.RenderLDSYAML() + if err != nil { + return errors.WithStack(errors.Wrapf(err, "Failed to render gateway lds config")) + } + + elements, err := r.renderConfigMap(map[string]string{ + GatewayConfigFileName: string(gatewayCfgYaml), + GatewayCDSConfigFileName: string(gatewayCfgCDSYaml), + GatewayLDSConfigFileName: string(gatewayCfgLDSYaml), + }) if err != nil { return errors.WithStack(errors.Wrapf(err, "Failed to render gateway config")) } @@ -66,10 +85,7 @@ func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspec ObjectMeta: meta.ObjectMeta{ Name: configMapName, }, - Data: map[string]string{ - GatewayConfigFileName: string(gatewayCfgYaml), - GatewayConfigChecksumFileName: gatewayCfgChecksum, - }, + Data: elements, } owner := r.context.GetAPIObject().AsOwner() @@ -88,17 +104,14 @@ func (r *Resources) ensureGatewayConfig(ctx context.Context, cachedStatus inspec return errors.Reconcile() } else { // CM Exists, checks checksum - if key is not in the map we return empty string - if existingSha, existingChecksumSha := util.SHA256FromString(cm.Data[GatewayConfigFileName]), cm.Data[GatewayConfigChecksumFileName]; existingSha != gatewayCfgChecksum || existingChecksumSha != gatewayCfgChecksum { + if currentSha, expectedSha := util.Optional(cm.Data, ConfigMapChecksumKey, ""), util.Optional(elements, ConfigMapChecksumKey, ""); currentSha != expectedSha || currentSha == "" { // We need to do the update if _, changed, err := patcher.Patcher[*core.ConfigMap](ctx, cachedStatus.ConfigMapsModInterface().V1(), cm, meta.PatchOptions{}, - patcher.PatchConfigMapData(map[string]string{ - GatewayConfigFileName: string(gatewayCfgYaml), - GatewayConfigChecksumFileName: gatewayCfgChecksum, - })); err != nil { + patcher.PatchConfigMapData(elements)); err != nil { log.Err(err).Debug("Failed to patch GatewayConfig ConfigMap") return errors.WithStack(err) } else if changed { - log.Str("service", cm.GetName()).Str("before", existingSha).Str("after", gatewayCfgChecksum).Info("Updated GatewayConfig") + log.Str("configmap", cm.GetName()).Str("before", currentSha).Str("after", expectedSha).Info("Updated GatewayConfig") } } } diff --git a/pkg/deployment/resources/config_map_gateway_member.go b/pkg/deployment/resources/config_map_gateway_member.go new file mode 100644 index 000000000..2ca0c509e --- /dev/null +++ b/pkg/deployment/resources/config_map_gateway_member.go @@ -0,0 +1,50 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "context" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources/gateway" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" +) + +func (r *Resources) ensureMemberConfigGatewayConfig(ctx context.Context, cachedStatus inspectorInterface.Inspector, member api.DeploymentStatusMemberElement) (map[string]string, error) { + if member.Group != api.ServerGroupGateways { + return nil, nil + } + + data, _, _, err := gateway.NodeDynamicConfig("arangodb", member.Member.ID, &gateway.DynamicConfig{ + Path: GatewayVolumeMountDir, + File: GatewayCDSConfigFileName, + }, &gateway.DynamicConfig{ + Path: GatewayVolumeMountDir, + File: GatewayLDSConfigFileName, + }) + if err != nil { + return nil, err + } + + return map[string]string{ + GatewayDynamicConfigFileName: string(data), + }, nil +} diff --git a/pkg/deployment/resources/config_maps.go b/pkg/deployment/resources/config_maps.go index e6fec0239..495ce477c 100644 --- a/pkg/deployment/resources/config_maps.go +++ b/pkg/deployment/resources/config_maps.go @@ -54,6 +54,9 @@ func (r *Resources) EnsureConfigMaps(ctx context.Context, cachedStatus inspector if err := reconcileRequired.WithError(r.ensureGatewayConfig(ctx, cachedStatus, configMaps)); err != nil { return errors.Section(err, "Gateway ConfigMap") } + if err := reconcileRequired.WithError(r.ensureMemberConfig(ctx, cachedStatus, configMaps)); err != nil { + return errors.Section(err, "Member ConfigMap") + } } return reconcileRequired.Reconcile(ctx) } diff --git a/pkg/deployment/resources/config_maps_member.go b/pkg/deployment/resources/config_maps_member.go new file mode 100644 index 000000000..f65dc2bec --- /dev/null +++ b/pkg/deployment/resources/config_maps_member.go @@ -0,0 +1,172 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "context" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/assertion" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" + configMapsV1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" +) + +const ( + ConfigMapChecksumKey = "CHECKSUM" + + MemberConfigVolumeMountDir = "/etc/member/" + MemberConfigVolumeName = "member-config" + + MemberConfigChecksumENV = "MEMBER_CONFIG_CHECKSUM" +) + +type memberConfigMapRenderer func(ctx context.Context, cachedStatus inspectorInterface.Inspector, member api.DeploymentStatusMemberElement) (map[string]string, error) + +func (r *Resources) ensureMemberConfig(ctx context.Context, cachedStatus inspectorInterface.Inspector, configMaps configMapsV1.ModInterface) error { + status := r.context.GetStatus() + + log := r.log.Str("section", "member-config-render") + + reconcileRequired := k8sutil.NewReconcile(cachedStatus) + + members := status.Members.AsList() + + if err := reconcileRequired.ParallelAll(len(members), func(id int) error { + memberName := members[id].Member.ArangoMemberName(r.context.GetAPIObject().GetName(), members[id].Group) + + am, ok := cachedStatus.ArangoMember().V1().GetSimple(memberName) + if !ok { + return errors.Errorf("ArangoMember %s not found", memberName) + } + + switch members[id].Group.Type() { + case api.ServerGroupTypeGateway, api.ServerGroupTypeArangoSync, api.ServerGroupTypeArangoD: + elements, err := r.renderMemberConfigElements(ctx, cachedStatus, members[id], r.ensureMemberConfigGatewayConfig) + if err != nil { + return err + } + + if len(elements) == 0 { + // CM should be gone + if obj, ok := cachedStatus.ConfigMap().V1().GetSimple(memberName); !ok { + return nil + } else { + if err := cachedStatus.ConfigMapsModInterface().V1().Delete(ctx, memberName, meta.DeleteOptions{ + Preconditions: meta.NewUIDPreconditions(string(obj.GetUID())), + }); err != nil { + if !kerrors.IsNotFound(err) { + return err + } + } + } + } else { + // We expect CM + if obj, ok := cachedStatus.ConfigMap().V1().GetSimple(memberName); !ok { + // Let's Create ConfigMap + obj = &core.ConfigMap{ + ObjectMeta: meta.ObjectMeta{ + Name: memberName, + }, + Data: elements, + } + + err = globals.GetGlobalTimeouts().Kubernetes().RunWithTimeout(ctx, func(ctxChild context.Context) error { + return k8sutil.CreateConfigMap(ctxChild, configMaps, obj, util.NewType(am.AsOwner())) + }) + if kerrors.IsAlreadyExists(err) { + // CM added while we tried it also + return nil + } else if err != nil { + // Failed to create + return errors.WithStack(err) + } + + return errors.Reconcile() + } else { + // CM Exists, checks checksum - if key is not in the map we return empty string + if currentSha, expectedSha := util.Optional(obj.Data, ConfigMapChecksumKey, ""), util.Optional(elements, ConfigMapChecksumKey, ""); currentSha != expectedSha || currentSha == "" { + // We need to do the update + if _, changed, err := patcher.Patcher[*core.ConfigMap](ctx, cachedStatus.ConfigMapsModInterface().V1(), obj, meta.PatchOptions{}, + patcher.PatchConfigMapData(elements)); err != nil { + log.Err(err).Debug("Failed to patch GatewayConfig ConfigMap") + return errors.WithStack(err) + } else if changed { + log.Str("service", obj.GetName()).Str("before", currentSha).Str("after", expectedSha).Info("Updated Member Config") + } + } + } + } + return nil + default: + assertion.InvalidGroupKey.Assert(true, "Unable to create Member ConfigMap an unknown group: %s", members[id].Group.AsRole()) + return nil + } + }); err != nil { + return errors.Section(err, "Member ConfigMap") + } + + return nil +} + +func (r *Resources) renderConfigMap(elements ...map[string]string) (map[string]string, error) { + result := map[string]string{} + + for _, r := range elements { + for k, v := range r { + if _, ok := result[k]; ok { + return nil, errors.Errorf("Key %s already defined", k) + } + + result[k] = v + } + } + + if len(result) == 0 { + return nil, nil + } + + result[ConfigMapChecksumKey] = util.SHA256FromStringMap(result) + + return result, nil +} + +func (r *Resources) renderMemberConfigElements(ctx context.Context, cachedStatus inspectorInterface.Inspector, member api.DeploymentStatusMemberElement, renders ...memberConfigMapRenderer) (map[string]string, error) { + var elements = make([]map[string]string, len(renders)) + + for _, r := range renders { + if els, err := r(ctx, cachedStatus, member); err != nil { + return nil, errors.Wrapf(err, "Unable to render CM for %s", member.Member.ID) + } else { + elements = append(elements, els) + } + } + + return r.renderConfigMap(elements...) +} diff --git a/pkg/deployment/resources/gateway/dynamic.go b/pkg/deployment/resources/gateway/dynamic.go new file mode 100644 index 000000000..6fb8ea7db --- /dev/null +++ b/pkg/deployment/resources/gateway/dynamic.go @@ -0,0 +1,93 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + "path" + + bootstrapAPI "github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v3" + coreAPI "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + discoveryApi "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" + proto "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" +) + +type DynamicConfig struct { + Path, File string +} + +func (d *DynamicConfig) AsConfigSource() *coreAPI.ConfigSource { + if d == nil { + return nil + } + + return &coreAPI.ConfigSource{ + ConfigSourceSpecifier: &coreAPI.ConfigSource_PathConfigSource{ + PathConfigSource: &coreAPI.PathConfigSource{ + Path: path.Join(d.Path, d.File), + WatchedDirectory: &coreAPI.WatchedDirectory{ + Path: d.Path, + }, + }, + }, + } +} + +func NodeDynamicConfig(cluster, id string, cds, lds *DynamicConfig) ([]byte, string, *bootstrapAPI.Bootstrap, error) { + var b = bootstrapAPI.Bootstrap{ + Node: &coreAPI.Node{ + Id: id, + Cluster: cluster, + }, + } + + if v := cds; v != nil { + if b.DynamicResources == nil { + b.DynamicResources = &bootstrapAPI.Bootstrap_DynamicResources{} + } + + b.DynamicResources.CdsConfig = v.AsConfigSource() + } + + if v := lds; v != nil { + if b.DynamicResources == nil { + b.DynamicResources = &bootstrapAPI.Bootstrap_DynamicResources{} + } + + b.DynamicResources.LdsConfig = v.AsConfigSource() + } + + return Marshal(&b) +} + +func DynamicConfigResponse[T proto.Message](in ...T) (*discoveryApi.DiscoveryResponse, error) { + resources := make([]*anypb.Any, len(in)) + for id := range in { + if a, err := anypb.New(in[id]); err != nil { + return nil, err + } else { + resources[id] = a + } + } + return &discoveryApi.DiscoveryResponse{ + Resources: resources, + }, nil +} diff --git a/pkg/deployment/resources/gateway/gateway_config.go b/pkg/deployment/resources/gateway/gateway_config.go index 5206aaafd..e7c360e61 100644 --- a/pkg/deployment/resources/gateway/gateway_config.go +++ b/pkg/deployment/resources/gateway/gateway_config.go @@ -36,11 +36,11 @@ import ( tlsInspectorApi "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/listener/tls_inspector/v3" httpConnectionManagerAPI "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" upstreamHttpApi "github.com/envoyproxy/go-control-plane/envoy/extensions/upstreams/http/v3" + discoveryApi "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" "github.com/golang/protobuf/ptypes/any" - "google.golang.org/protobuf/encoding/protojson" + "github.com/golang/protobuf/ptypes/wrappers" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/durationpb" - "sigs.k8s.io/yaml" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" @@ -74,15 +74,51 @@ func (c Config) RenderYAML() ([]byte, string, *bootstrapAPI.Bootstrap, error) { return nil, "", nil, err } - data, err := protojson.MarshalOptions{ - UseProtoNames: true, - }.Marshal(cfg) + return Marshal(cfg) +} + +func (c Config) RenderCDSYAML() ([]byte, string, *discoveryApi.DiscoveryResponse, error) { + cfg, err := c.RenderCDS() + if err != nil { + return nil, "", nil, err + } + + return Marshal(cfg) +} + +func (c Config) RenderLDSYAML() ([]byte, string, *discoveryApi.DiscoveryResponse, error) { + cfg, err := c.RenderLDS() if err != nil { return nil, "", nil, err } - data, err = yaml.JSONToYAML(data) - return data, util.SHA256(data), cfg, err + return Marshal(cfg) +} + +func (c Config) RenderCDS() (*discoveryApi.DiscoveryResponse, error) { + if err := c.Validate(); err != nil { + return nil, errors.Wrapf(err, "Validation failed") + } + + clusters, err := c.RenderClusters() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render clusters") + } + + return DynamicConfigResponse(clusters...) +} + +func (c Config) RenderLDS() (*discoveryApi.DiscoveryResponse, error) { + if err := c.Validate(); err != nil { + return nil, errors.Wrapf(err, "Validation failed") + } + + listener, err := c.RenderListener() + if err != nil { + return nil, errors.Wrapf(err, "Unable to render listener") + } + + return DynamicConfigResponse(listener) } func (c Config) Render() (*bootstrapAPI.Bootstrap, error) { @@ -268,6 +304,9 @@ func (c Config) RenderFilters() ([]*listenerAPI.Filter, error) { Routes: routes, }, }, + ValidateClusters: &wrappers.BoolValue{ + Value: false, + }, }, }, HttpFilters: append(httpFilters, &httpConnectionManagerAPI.HttpFilter{ diff --git a/pkg/deployment/resources/gateway/marshal.go b/pkg/deployment/resources/gateway/marshal.go new file mode 100644 index 000000000..69bb5b95a --- /dev/null +++ b/pkg/deployment/resources/gateway/marshal.go @@ -0,0 +1,41 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package gateway + +import ( + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" + "sigs.k8s.io/yaml" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func Marshal[T proto.Message](in T) ([]byte, string, T, error) { + data, err := protojson.MarshalOptions{ + UseProtoNames: true, + }.Marshal(in) + if err != nil { + return nil, "", util.Default[T](), err + } + + data, err = yaml.JSONToYAML(data) + return data, util.SHA256(data), in, err +} diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index 2b1782f2c..518f43b6a 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -26,6 +26,7 @@ import ( "encoding/json" "fmt" "net" + "path" "path/filepath" "strconv" "sync" @@ -288,7 +289,11 @@ func createArangoSyncArgs(apiObject meta.Object, spec api.DeploymentSpec, group func createArangoGatewayArgs(input pod.Input, additionalOptions ...k8sutil.OptionPair) []string { options := k8sutil.CreateOptionPairs(64) - options.Add("--config-path", GatewayConfigFilePath) + if input.Deployment.Gateway.IsDynamic() { + options.Add("--config-path", path.Join(MemberConfigVolumeMountDir, GatewayDynamicConfigFileName)) + } else { + options.Add("--config-path", path.Join(GatewayVolumeMountDir, GatewayConfigFileName)) + } options.Append(additionalOptions...) diff --git a/pkg/deployment/resources/pod_creator_gateway.go b/pkg/deployment/resources/pod_creator_gateway.go index 55df1a4b3..0450b007e 100644 --- a/pkg/deployment/resources/pod_creator_gateway.go +++ b/pkg/deployment/resources/pod_creator_gateway.go @@ -30,13 +30,14 @@ import ( ) const ( - ArangoGatewayExecutor string = "/usr/local/bin/envoy" - GatewayVolumeMountDir = "/etc/gateway/" - GatewayVolumeName = "gateway" - GatewayConfigFileName = "gateway.yaml" - GatewayConfigChecksumFileName = "gateway.checksum" - GatewayConfigChecksumENV = "GATEWAY_CONFIG_CHECKSUM" - GatewayConfigFilePath = GatewayVolumeMountDir + GatewayConfigFileName + ArangoGatewayExecutor = "/usr/local/bin/envoy" + GatewayVolumeMountDir = "/etc/gateway/" + GatewayVolumeName = "gateway" + GatewayConfigFileName = "gateway.yaml" + GatewayDynamicConfigFileName = "gateway.dynamic.yaml" + GatewayCDSConfigFileName = "gateway.dynamic.cds.yaml" + GatewayLDSConfigFileName = "gateway.dynamic.lds.yaml" + GatewayConfigChecksumENV = "GATEWAY_CONFIG_CHECKSUM" ) func GetGatewayConfigMapName(name string) string { @@ -47,7 +48,17 @@ func createGatewayVolumes(input pod.Input) pod.Volumes { volumes := pod.NewVolumes() volumes.AddVolume(k8sutil.CreateVolumeWithConfigMap(GatewayVolumeName, GetGatewayConfigMapName(input.ApiObject.GetName()))) - volumes.AddVolumeMount(GatewayVolumeMount()) + volumes.AddVolume(k8sutil.CreateVolumeWithConfigMap(MemberConfigVolumeName, input.ArangoMember.GetName())) + volumes.AddVolumeMount(core.VolumeMount{ + Name: GatewayVolumeName, + MountPath: GatewayVolumeMountDir, + ReadOnly: true, + }) + volumes.AddVolumeMount(core.VolumeMount{ + Name: MemberConfigVolumeName, + MountPath: MemberConfigVolumeMountDir, + ReadOnly: true, + }) // TLS volumes.Append(pod.TLS(), input) @@ -57,11 +68,3 @@ func createGatewayVolumes(input pod.Input) pod.Volumes { return volumes } - -func GatewayVolumeMount() core.VolumeMount { - return core.VolumeMount{ - Name: GatewayVolumeName, - MountPath: GatewayVolumeMountDir, - ReadOnly: true, - } -} diff --git a/pkg/deployment/resources/pod_creator_gateway_container.go b/pkg/deployment/resources/pod_creator_gateway_container.go index cc4a3767c..2a9989427 100644 --- a/pkg/deployment/resources/pod_creator_gateway_container.go +++ b/pkg/deployment/resources/pod_creator_gateway_container.go @@ -131,18 +131,26 @@ func (a *ArangoGatewayContainer) GetEnvs() ([]core.EnvVar, []core.EnvFromSource) envs.Add(true, k8sutil.GetLifecycleEnv()...) - var cmChecksum = "" - - if cm, ok := a.cachedStatus.ConfigMap().V1().GetSimple(GetGatewayConfigMapName(a.input.ApiObject.GetName())); ok { - if v, ok := cm.Data[GatewayConfigChecksumFileName]; ok { - cmChecksum = v + if cm, ok := a.cachedStatus.ConfigMap().V1().GetSimple(GetGatewayConfigMapName(a.input.ArangoMember.GetName())); ok { + if v, ok := cm.Data[ConfigMapChecksumKey]; ok { + envs.Add(true, core.EnvVar{ + Name: MemberConfigChecksumENV, + Value: v, + }) } } - envs.Add(true, core.EnvVar{ - Name: GatewayConfigChecksumENV, - Value: cmChecksum, - }) + if !a.spec.Gateway.IsDynamic() { + if cm, ok := a.cachedStatus.ConfigMap().V1().GetSimple(GetGatewayConfigMapName(a.input.ApiObject.GetName())); ok { + if v, ok := cm.Data[ConfigMapChecksumKey]; ok { + envs.Add(true, core.EnvVar{ + Name: GatewayConfigChecksumENV, + Value: v, + }) + } + } + + } if len(a.groupSpec.Envs) > 0 { for _, env := range a.groupSpec.Envs { diff --git a/pkg/generated/timezones/timezones_test.go b/pkg/generated/timezones/timezones_test.go index 983e415b2..f809c8fe7 100644 --- a/pkg/generated/timezones/timezones_test.go +++ b/pkg/generated/timezones/timezones_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,10 @@ import ( ) func Test_Timezone(t *testing.T) { + // Ensure we use static time for comparison + testTime, err := time.Parse(time.RFC3339, "2024-09-01T00:00:00Z") + require.NoError(t, err) + for tz, tq := range timezones { t.Run(tz, func(t *testing.T) { t.Run("Check fields", func(t *testing.T) { @@ -49,7 +53,7 @@ func Test_Timezone(t *testing.T) { l, err := time.LoadLocationFromTZData("", tz) require.NoError(t, err) - z, offset := time.Now().In(l).Zone() + z, offset := testTime.In(l).Zone() require.Equal(t, tq.Zone, z) require.Equal(t, int(tq.Offset/time.Second), offset) diff --git a/pkg/util/checksum.go b/pkg/util/checksum.go index 144bbe291..17a7ab9f5 100644 --- a/pkg/util/checksum.go +++ b/pkg/util/checksum.go @@ -50,6 +50,14 @@ func SHA256FromStringArray(data ...string) string { return SHA256FromString(strings.Join(data, "|")) } +func SHA256FromStringMap(data map[string]string) string { + return SHA256FromExtract(func(t KV[string, string]) string { + return fmt.Sprintf("%s:%s", t.K, SHA256FromString(t.V)) + }, ExtractWithSort(data, func(i, j string) bool { + return i < j + })...) +} + func SHA256FromString(data string) string { return SHA256([]byte(data)) } diff --git a/pkg/util/dict.go b/pkg/util/dict.go index 38af1a980..dcf083da5 100644 --- a/pkg/util/dict.go +++ b/pkg/util/dict.go @@ -43,6 +43,12 @@ func Extract[K comparable, V any](in map[K]V) []KV[K, V] { return r } +func ExtractWithSort[K comparable, V any](in map[K]V, cmp func(i, j K) bool) []KV[K, V] { + return Sort(Extract(in), func(i, j KV[K, V]) bool { + return cmp(i.K, j.K) + }) +} + func Sort[IN any](in []IN, cmp func(i, j IN) bool) []IN { r := make([]IN, len(in)) copy(r, in) From 6404de3ce41c251c2ee4e4ac5daa8712b5c422c7 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:01:52 +0200 Subject: [PATCH 30/50] [Feature] DebugPackage ArangoRoutes (#1719) --- CHANGELOG.md | 1 + .../database-deployment.schema.generated.yaml | 5 ++ pkg/debug_package/generator.go | 1 + .../kubernetes/arango_networking.go | 47 ++++++++++++ .../kubernetes/arango_networking_ar.go | 73 +++++++++++++++++++ 5 files changed, 127 insertions(+) create mode 100644 pkg/debug_package/generators/kubernetes/arango_networking.go create mode 100644 pkg/debug_package/generators/kubernetes/arango_networking_ar.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 9338e16d8..9b7e733cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - (Feature) Scheduler Handler - (Feature) (Gateway) ArangoDB Auth Token - (Feature) (Gateway) Dynamic Configuration +- (Feature) DebugPackage ArangoRoutes ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/crd/crds/database-deployment.schema.generated.yaml b/pkg/crd/crds/database-deployment.schema.generated.yaml index 2ee177b8e..578c15216 100644 --- a/pkg/crd/crds/database-deployment.schema.generated.yaml +++ b/pkg/crd/crds/database-deployment.schema.generated.yaml @@ -39611,6 +39611,11 @@ v2alpha1: gateway: description: Gateway defined main Gateway configuration. properties: + dynamic: + description: |- + Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. + When enabled, gateway config will be reloaded by ConfigMap live updates. + type: boolean enabled: description: |- Enabled setting enables/disables support for gateway in the cluster. diff --git a/pkg/debug_package/generator.go b/pkg/debug_package/generator.go index d8c24a0eb..098d34390 100644 --- a/pkg/debug_package/generator.go +++ b/pkg/debug_package/generator.go @@ -46,6 +46,7 @@ var rootFactories = []shared.Factory{ kubernetes.Analytics(), kubernetes.Backup(), kubernetes.Scheduler(), + kubernetes.Networking(), } func InitCommand(cmd *cobra.Command) { diff --git a/pkg/debug_package/generators/kubernetes/arango_networking.go b/pkg/debug_package/generators/kubernetes/arango_networking.go new file mode 100644 index 000000000..8837b089b --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_networking.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "github.com/rs/zerolog" + + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func Networking() shared.Factory { + return shared.NewFactory("networking", true, networking) +} + +func networking(logger zerolog.Logger, files chan<- shared.File) error { + k, ok := kclient.GetDefaultFactory().Client() + if !ok { + return errors.Errorf("Client is not initialised") + } + + if err := networkingArangoRoutes(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting networking arango routes") + return err + } + + return nil +} diff --git a/pkg/debug_package/generators/kubernetes/arango_networking_ar.go b/pkg/debug_package/generators/kubernetes/arango_networking_ar.go new file mode 100644 index 000000000..8d26b0e2f --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_networking_ar.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func networkingArangoRoutes(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + arangoRoutes, err := listNetowkingArangoRoutes(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(networkingArangoRoute, client, files, arangoRoutes...); err != nil { + logger.Err(err).Msgf("Error while collecting networking arango routes") + return err + } + + return nil +} + +func networkingArangoRoute(client kclient.Client, files chan<- shared.File, ext *networkingApi.ArangoRoute) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/networking/arangoroutes/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listNetowkingArangoRoutes(client kclient.Client) ([]*networkingApi.ArangoRoute, error) { + return ListObjects[*networkingApi.ArangoRouteList, *networkingApi.ArangoRoute](context.Background(), client.Arango().NetworkingV1alpha1().ArangoRoutes(cli.GetInput().Namespace), func(result *networkingApi.ArangoRouteList) []*networkingApi.ArangoRoute { + q := make([]*networkingApi.ArangoRoute, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} From 9e7ed8dbad2e0b7535db76015f40c5fbfb048e23 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:34:45 +0200 Subject: [PATCH 31/50] [Feature] [Scheduler] Add Status Conditions (#1720) --- .golangci.yaml | 2 + CHANGELOG.md | 1 + Makefile | 2 +- docs/api/ArangoDeployment.V1.md | 4 +- docs/api/ArangoMLExtension.V1Beta1.md | 4 +- docs/api/ArangoProfile.V1Beta1.md | 2 +- docs/api/GraphAnalyticsEngine.V1Alpha1.md | 4 +- internal/docs_test.go | 4 + pkg/apis/analytics/v1alpha1/gae_spec.go | 6 +- .../v1alpha1/zz_generated.deepcopy.go | 4 +- .../deployment/v1/deployment_spec_gateway.go | 6 +- .../deployment/v1/zz_generated.deepcopy.go | 4 +- .../v2alpha1/deployment_spec_gateway.go | 6 +- .../v2alpha1/zz_generated.deepcopy.go | 4 +- pkg/apis/ml/v1beta1/extension_spec.go | 6 +- pkg/apis/ml/v1beta1/zz_generated.deepcopy.go | 4 +- pkg/apis/scheduler/v1beta1/conditions.go | 28 +++ .../scheduler/v1beta1/container/definition.go | 13 +- pkg/apis/scheduler/v1beta1/integration/doc.go | 23 ++ .../v1beta1/{ => integration}/integration.go | 14 +- .../integration/zz_generated.deepcopy.go | 61 +++++ .../v1beta1/profile_accepted_template.go | 29 +++ pkg/apis/scheduler/v1beta1/profile_status.go | 11 +- .../scheduler/v1beta1/profile_template.go | 15 ++ .../v1beta1/zz_generated.deepcopy.go | 39 ++-- pkg/handlers/scheduler/profile/handler.go | 20 ++ .../scheduler/profile/handler_template.go | 57 +++++ .../profile/handler_template_test.go | 213 ++++++++++++++++++ pkg/integrations/sidecar/integration.go | 3 +- 29 files changed, 529 insertions(+), 60 deletions(-) create mode 100644 pkg/apis/scheduler/v1beta1/conditions.go create mode 100644 pkg/apis/scheduler/v1beta1/integration/doc.go rename pkg/apis/scheduler/v1beta1/{ => integration}/integration.go (86%) create mode 100644 pkg/apis/scheduler/v1beta1/integration/zz_generated.deepcopy.go create mode 100644 pkg/apis/scheduler/v1beta1/profile_accepted_template.go create mode 100644 pkg/handlers/scheduler/profile/handler_template.go create mode 100644 pkg/handlers/scheduler/profile/handler_template_test.go diff --git a/.golangci.yaml b/.golangci.yaml index 5db6d1630..75382a541 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -79,6 +79,8 @@ linters-settings: pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container - alias: schedulerContainerResourcesApi pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources + - alias: schedulerIntegrationApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration - alias: schedulerPodApi pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod - alias: schedulerPodResourcesApi diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b7e733cd..cdd1d4d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - (Feature) (Gateway) ArangoDB Auth Token - (Feature) (Gateway) Dynamic Configuration - (Feature) DebugPackage ArangoRoutes +- (Feature) (Scheduler) Add Status Conditions ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index 7760ebab0..6be7f0a72 100644 --- a/Makefile +++ b/Makefile @@ -452,7 +452,7 @@ update-generated: "github.com/arangodb/kube-arangodb/pkg/apis" \ "shared:v1 \ scheduler:v1alpha1/container scheduler:v1alpha1/container/resources scheduler:v1alpha1/pod scheduler:v1alpha1/pod/resources \ - scheduler:v1beta1/container scheduler:v1beta1/container/resources scheduler:v1beta1/pod scheduler:v1beta1/pod/resources" \ + scheduler:v1beta1/integration scheduler:v1beta1/container scheduler:v1beta1/container/resources scheduler:v1beta1/pod scheduler:v1beta1/pod/resources" \ --go-header-file "./tools/codegen/boilerplate.go.txt" \ $(VERIFYARGS) diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 8ca8d7f04..04e56360b 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3110,7 +3110,7 @@ Links: ### .spec.gateway.sidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L16) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -3168,7 +3168,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.gateway.sidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L12) ListenPort defines on which port the sidecar container will be listening for connections diff --git a/docs/api/ArangoMLExtension.V1Beta1.md b/docs/api/ArangoMLExtension.V1Beta1.md index 711fe44df..88f954fcd 100644 --- a/docs/api/ArangoMLExtension.V1Beta1.md +++ b/docs/api/ArangoMLExtension.V1Beta1.md @@ -798,7 +798,7 @@ Links: ### .spec.integrationSidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L16) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -856,7 +856,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.integrationSidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L12) ListenPort defines on which port the sidecar container will be listening for connections diff --git a/docs/api/ArangoProfile.V1Beta1.md b/docs/api/ArangoProfile.V1Beta1.md index 64bec621f..fd6c2d6f7 100644 --- a/docs/api/ArangoProfile.V1Beta1.md +++ b/docs/api/ArangoProfile.V1Beta1.md @@ -394,5 +394,5 @@ Links: ### .spec.template.priority -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/profile_template.go#L30) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/profile_template.go#L31) diff --git a/docs/api/GraphAnalyticsEngine.V1Alpha1.md b/docs/api/GraphAnalyticsEngine.V1Alpha1.md index 2627176b9..45ba05dd3 100644 --- a/docs/api/GraphAnalyticsEngine.V1Alpha1.md +++ b/docs/api/GraphAnalyticsEngine.V1Alpha1.md @@ -440,7 +440,7 @@ Links: ### .spec.integrationSidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L16) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -498,7 +498,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.integrationSidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L12) ListenPort defines on which port the sidecar container will be listening for connections diff --git a/internal/docs_test.go b/internal/docs_test.go index e6b86319d..d2b4b7541 100644 --- a/internal/docs_test.go +++ b/internal/docs_test.go @@ -180,6 +180,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "scheduler/v1beta1", "scheduler/v1beta1/container", "scheduler/v1beta1/container/resources", + "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", }, @@ -253,6 +254,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "scheduler/v1beta1", "scheduler/v1beta1/container", "scheduler/v1beta1/container/resources", + "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", }, @@ -284,6 +286,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "scheduler/v1beta1", "scheduler/v1beta1/container", "scheduler/v1beta1/container/resources", + "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", }, @@ -323,6 +326,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "shared/v1", "scheduler/v1beta1/container", "scheduler/v1beta1/container/resources", + "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", }, diff --git a/pkg/apis/analytics/v1alpha1/gae_spec.go b/pkg/apis/analytics/v1alpha1/gae_spec.go index 976fbdf9f..891cf545b 100644 --- a/pkg/apis/analytics/v1alpha1/gae_spec.go +++ b/pkg/apis/analytics/v1alpha1/gae_spec.go @@ -21,7 +21,7 @@ package v1alpha1 import ( - schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util/errors" ) @@ -34,7 +34,7 @@ type GraphAnalyticsEngineSpec struct { Deployment *GraphAnalyticsEngineSpecDeployment `json:"deployment,omitempty"` // IntegrationSidecar define the integration sidecar spec - IntegrationSidecar *schedulerApi.IntegrationSidecar `json:"integrationSidecar,omitempty"` + IntegrationSidecar *schedulerIntegrationApi.Sidecar `json:"integrationSidecar,omitempty"` } func (a *GraphAnalyticsEngineSpec) GetDeployment() *GraphAnalyticsEngineSpecDeployment { @@ -44,7 +44,7 @@ func (a *GraphAnalyticsEngineSpec) GetDeployment() *GraphAnalyticsEngineSpecDepl return a.Deployment } -func (a *GraphAnalyticsEngineSpec) GetIntegrationSidecar() *schedulerApi.IntegrationSidecar { +func (a *GraphAnalyticsEngineSpec) GetIntegrationSidecar() *schedulerIntegrationApi.Sidecar { if a == nil || a.IntegrationSidecar == nil { return nil } diff --git a/pkg/apis/analytics/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/analytics/v1alpha1/zz_generated.deepcopy.go index 7cb1d0cee..80affc286 100644 --- a/pkg/apis/analytics/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/analytics/v1alpha1/zz_generated.deepcopy.go @@ -27,8 +27,8 @@ package v1alpha1 import ( deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" container "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" + integration "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" pod "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" corev1 "k8s.io/api/core/v1" @@ -111,7 +111,7 @@ func (in *GraphAnalyticsEngineSpec) DeepCopyInto(out *GraphAnalyticsEngineSpec) } if in.IntegrationSidecar != nil { in, out := &in.IntegrationSidecar, &out.IntegrationSidecar - *out = new(v1beta1.IntegrationSidecar) + *out = new(integration.Sidecar) (*in).DeepCopyInto(*out) } return diff --git a/pkg/apis/deployment/v1/deployment_spec_gateway.go b/pkg/apis/deployment/v1/deployment_spec_gateway.go index 7cc263783..b362c517b 100644 --- a/pkg/apis/deployment/v1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v1/deployment_spec_gateway.go @@ -21,7 +21,7 @@ package v1 import ( - schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" ) @@ -42,7 +42,7 @@ type DeploymentSpecGateway struct { Image *string `json:"image"` // Sidecar define the integration sidecar spec - Sidecar *schedulerApi.IntegrationSidecar `json:"sidecar,omitempty"` + Sidecar *schedulerIntegrationApi.Sidecar `json:"sidecar,omitempty"` } // IsEnabled returns whether the gateway is enabled. @@ -63,7 +63,7 @@ func (d *DeploymentSpecGateway) IsDynamic() bool { return *d.Dynamic } -func (d *DeploymentSpecGateway) GetSidecar() *schedulerApi.IntegrationSidecar { +func (d *DeploymentSpecGateway) GetSidecar() *schedulerIntegrationApi.Sidecar { if d == nil || d.Sidecar == nil { return nil } diff --git a/pkg/apis/deployment/v1/zz_generated.deepcopy.go b/pkg/apis/deployment/v1/zz_generated.deepcopy.go index 5c7fe4b2d..066b99d80 100644 --- a/pkg/apis/deployment/v1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1/zz_generated.deepcopy.go @@ -28,7 +28,7 @@ package v1 import ( time "time" - v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + integration "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -1192,7 +1192,7 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { } if in.Sidecar != nil { in, out := &in.Sidecar, &out.Sidecar - *out = new(v1beta1.IntegrationSidecar) + *out = new(integration.Sidecar) (*in).DeepCopyInto(*out) } return diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go index fe897b2b4..41ecb45ce 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go @@ -21,7 +21,7 @@ package v2alpha1 import ( - schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" ) @@ -42,7 +42,7 @@ type DeploymentSpecGateway struct { Image *string `json:"image"` // Sidecar define the integration sidecar spec - Sidecar *schedulerApi.IntegrationSidecar `json:"sidecar,omitempty"` + Sidecar *schedulerIntegrationApi.Sidecar `json:"sidecar,omitempty"` } // IsEnabled returns whether the gateway is enabled. @@ -63,7 +63,7 @@ func (d *DeploymentSpecGateway) IsDynamic() bool { return *d.Dynamic } -func (d *DeploymentSpecGateway) GetSidecar() *schedulerApi.IntegrationSidecar { +func (d *DeploymentSpecGateway) GetSidecar() *schedulerIntegrationApi.Sidecar { if d == nil || d.Sidecar == nil { return nil } diff --git a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go index 12de5471e..7a13882bf 100644 --- a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go @@ -28,7 +28,7 @@ package v2alpha1 import ( time "time" - v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + integration "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -1192,7 +1192,7 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { } if in.Sidecar != nil { in, out := &in.Sidecar, &out.Sidecar - *out = new(v1beta1.IntegrationSidecar) + *out = new(integration.Sidecar) (*in).DeepCopyInto(*out) } return diff --git a/pkg/apis/ml/v1beta1/extension_spec.go b/pkg/apis/ml/v1beta1/extension_spec.go index 55604fd5a..0dccbea43 100644 --- a/pkg/apis/ml/v1beta1/extension_spec.go +++ b/pkg/apis/ml/v1beta1/extension_spec.go @@ -21,7 +21,7 @@ package v1beta1 import ( - schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" ) @@ -44,7 +44,7 @@ type ArangoMLExtensionSpec struct { JobsTemplates *ArangoMLJobsTemplates `json:"jobsTemplates,omitempty"` // IntegrationSidecar define the integration sidecar spec - IntegrationSidecar *schedulerApi.IntegrationSidecar `json:"integrationSidecar,omitempty"` + IntegrationSidecar *schedulerIntegrationApi.Sidecar `json:"integrationSidecar,omitempty"` } func (a *ArangoMLExtensionSpec) GetMetadataService() *ArangoMLExtensionSpecMetadataService { @@ -85,7 +85,7 @@ func (a *ArangoMLExtensionSpec) GetJobsTemplates() *ArangoMLJobsTemplates { return a.JobsTemplates } -func (a *ArangoMLExtensionSpec) GetIntegrationSidecar() *schedulerApi.IntegrationSidecar { +func (a *ArangoMLExtensionSpec) GetIntegrationSidecar() *schedulerIntegrationApi.Sidecar { if a == nil || a.IntegrationSidecar == nil { return nil } diff --git a/pkg/apis/ml/v1beta1/zz_generated.deepcopy.go b/pkg/apis/ml/v1beta1/zz_generated.deepcopy.go index 76e3df3a7..ee09100a2 100644 --- a/pkg/apis/ml/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/ml/v1beta1/zz_generated.deepcopy.go @@ -27,8 +27,8 @@ package v1beta1 import ( deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - schedulerv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" container "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" + integration "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" pod "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" corev1 "k8s.io/api/core/v1" @@ -126,7 +126,7 @@ func (in *ArangoMLExtensionSpec) DeepCopyInto(out *ArangoMLExtensionSpec) { } if in.IntegrationSidecar != nil { in, out := &in.IntegrationSidecar, &out.IntegrationSidecar - *out = new(schedulerv1beta1.IntegrationSidecar) + *out = new(integration.Sidecar) (*in).DeepCopyInto(*out) } return diff --git a/pkg/apis/scheduler/v1beta1/conditions.go b/pkg/apis/scheduler/v1beta1/conditions.go new file mode 100644 index 000000000..b2506d6a6 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/conditions.go @@ -0,0 +1,28 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + +const ( + ReadyCondition api.ConditionType = "Ready" + SpecValidCondition api.ConditionType = "SpecValid" +) diff --git a/pkg/apis/scheduler/v1beta1/container/definition.go b/pkg/apis/scheduler/v1beta1/container/definition.go index 0ac44c28d..a2898a92d 100644 --- a/pkg/apis/scheduler/v1beta1/container/definition.go +++ b/pkg/apis/scheduler/v1beta1/container/definition.go @@ -27,7 +27,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/interfaces" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/errors" kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" ) @@ -114,13 +113,17 @@ func (c Containers) With(other Containers) Containers { } func (c Containers) Validate() error { - for name, container := range c { + return shared.ValidateMap(c, func(s string, container Container) error { + if err := shared.ValidateResourceName(s); err != nil { + return err + } + if err := container.Validate(); err != nil { - return errors.Wrapf(err, "Container %s failed", name) + return err } - } - return nil + return nil + }) } var _ interfaces.Container[Container] = &Container{} diff --git a/pkg/apis/scheduler/v1beta1/integration/doc.go b/pkg/apis/scheduler/v1beta1/integration/doc.go new file mode 100644 index 000000000..5daf22e35 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/integration/doc.go @@ -0,0 +1,23 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// +k8s:deepcopy-gen=package +// +groupName=scheduler.arangodb.com +package integration diff --git a/pkg/apis/scheduler/v1beta1/integration.go b/pkg/apis/scheduler/v1beta1/integration/integration.go similarity index 86% rename from pkg/apis/scheduler/v1beta1/integration.go rename to pkg/apis/scheduler/v1beta1/integration/integration.go index 88787d667..f793d35ff 100644 --- a/pkg/apis/scheduler/v1beta1/integration.go +++ b/pkg/apis/scheduler/v1beta1/integration/integration.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -package v1beta1 +package integration import ( schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" @@ -26,7 +26,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/errors" ) -type IntegrationSidecar struct { +type Sidecar struct { // ListenPort defines on which port the sidecar container will be listening for connections // +doc/default: 9201 ListenPort *uint16 `json:"listenPort,omitempty"` @@ -39,7 +39,7 @@ type IntegrationSidecar struct { *schedulerContainerApi.Container `json:",inline"` } -func (s *IntegrationSidecar) GetContainer() *schedulerContainerApi.Container { +func (s *Sidecar) GetContainer() *schedulerContainerApi.Container { if s == nil || s.Container == nil { return nil } @@ -47,9 +47,9 @@ func (s *IntegrationSidecar) GetContainer() *schedulerContainerApi.Container { return s.Container } -func (s *IntegrationSidecar) Validate() error { +func (s *Sidecar) Validate() error { if s == nil { - s = &IntegrationSidecar{} + s = &Sidecar{} } var err []error @@ -67,14 +67,14 @@ func (s *IntegrationSidecar) Validate() error { return shared.WithErrors(err...) } -func (s *IntegrationSidecar) GetListenPort() uint16 { +func (s *Sidecar) GetListenPort() uint16 { if s == nil || s.ListenPort == nil { return 9201 } return *s.ListenPort } -func (s *IntegrationSidecar) GetControllerListenPort() uint16 { +func (s *Sidecar) GetControllerListenPort() uint16 { if s == nil || s.ControllerListenPort == nil { return 9202 } diff --git a/pkg/apis/scheduler/v1beta1/integration/zz_generated.deepcopy.go b/pkg/apis/scheduler/v1beta1/integration/zz_generated.deepcopy.go new file mode 100644 index 000000000..43fad9d96 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/integration/zz_generated.deepcopy.go @@ -0,0 +1,61 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package integration + +import ( + container "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sidecar) DeepCopyInto(out *Sidecar) { + *out = *in + if in.ListenPort != nil { + in, out := &in.ListenPort, &out.ListenPort + *out = new(uint16) + **out = **in + } + if in.ControllerListenPort != nil { + in, out := &in.ControllerListenPort, &out.ControllerListenPort + *out = new(uint16) + **out = **in + } + if in.Container != nil { + in, out := &in.Container, &out.Container + *out = new(container.Container) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sidecar. +func (in *Sidecar) DeepCopy() *Sidecar { + if in == nil { + return nil + } + out := new(Sidecar) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apis/scheduler/v1beta1/profile_accepted_template.go b/pkg/apis/scheduler/v1beta1/profile_accepted_template.go new file mode 100644 index 000000000..169b785e1 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/profile_accepted_template.go @@ -0,0 +1,29 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +type ProfileAcceptedTemplate struct { + // Checksum keeps accepted template checksum + Checksum string `json:"checksum,omitempty"` + + // Template keeps the Profile Template + Template *ProfileTemplate `json:"template,omitempty"` +} diff --git a/pkg/apis/scheduler/v1beta1/profile_status.go b/pkg/apis/scheduler/v1beta1/profile_status.go index 7f9d98dfb..f10b13738 100644 --- a/pkg/apis/scheduler/v1beta1/profile_status.go +++ b/pkg/apis/scheduler/v1beta1/profile_status.go @@ -20,4 +20,13 @@ package v1beta1 -type ProfileStatus struct{} +import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + +type ProfileStatus struct { + // Conditions specific to the entire extension + // +doc/type: api.Conditions + Conditions api.ConditionList `json:"conditions,omitempty"` + + // Accepted keeps accepted template + Accepted *ProfileAcceptedTemplate `json:"accepted,omitempty"` +} diff --git a/pkg/apis/scheduler/v1beta1/profile_template.go b/pkg/apis/scheduler/v1beta1/profile_template.go index 176a13baa..7efd7cc1f 100644 --- a/pkg/apis/scheduler/v1beta1/profile_template.go +++ b/pkg/apis/scheduler/v1beta1/profile_template.go @@ -21,6 +21,8 @@ package v1beta1 import ( + "encoding/json" + schedulerPodApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" @@ -78,6 +80,19 @@ func (p *ProfileTemplate) With(other *ProfileTemplate) *ProfileTemplate { } } +func (p *ProfileTemplate) Checksum() (string, error) { + if p == nil { + return "", nil + } + + data, err := json.Marshal(p) + if err != nil { + return "", err + } + + return util.SHA256(data), nil +} + func (p *ProfileTemplate) Validate() error { if p == nil { return nil diff --git a/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go b/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go index 7e86213f0..3b1d48536 100644 --- a/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go @@ -26,6 +26,7 @@ package v1beta1 import ( + deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" container "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" pod "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -38,7 +39,7 @@ func (in *ArangoProfile) DeepCopyInto(out *ArangoProfile) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) return } @@ -94,32 +95,22 @@ func (in *ArangoProfileList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IntegrationSidecar) DeepCopyInto(out *IntegrationSidecar) { +func (in *ProfileAcceptedTemplate) DeepCopyInto(out *ProfileAcceptedTemplate) { *out = *in - if in.ListenPort != nil { - in, out := &in.ListenPort, &out.ListenPort - *out = new(uint16) - **out = **in - } - if in.ControllerListenPort != nil { - in, out := &in.ControllerListenPort, &out.ControllerListenPort - *out = new(uint16) - **out = **in - } - if in.Container != nil { - in, out := &in.Container, &out.Container - *out = new(container.Container) + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(ProfileTemplate) (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationSidecar. -func (in *IntegrationSidecar) DeepCopy() *IntegrationSidecar { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProfileAcceptedTemplate. +func (in *ProfileAcceptedTemplate) DeepCopy() *ProfileAcceptedTemplate { if in == nil { return nil } - out := new(IntegrationSidecar) + out := new(ProfileAcceptedTemplate) in.DeepCopyInto(out) return out } @@ -202,6 +193,18 @@ func (in *ProfileSpec) DeepCopy() *ProfileSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProfileStatus) DeepCopyInto(out *ProfileStatus) { *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(deploymentv1.ConditionList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Accepted != nil { + in, out := &in.Accepted, &out.Accepted + *out = new(ProfileAcceptedTemplate) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/handlers/scheduler/profile/handler.go b/pkg/handlers/scheduler/profile/handler.go index 3961ba872..7f1b2eb0d 100644 --- a/pkg/handlers/scheduler/profile/handler.go +++ b/pkg/handlers/scheduler/profile/handler.go @@ -92,6 +92,26 @@ func (h *handler) Handle(ctx context.Context, item operation.Item) error { } func (h *handler) handle(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoProfile, status *schedulerApi.ProfileStatus) (bool, error) { + return operator.HandleP3WithCondition(ctx, &status.Conditions, schedulerApi.ReadyCondition, item, extension, status, h.HandleSpecValidity, h.HandleTemplate) +} + +func (h *handler) HandleSpecValidity(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoProfile, status *schedulerApi.ProfileStatus) (bool, error) { + if err := extension.Spec.Validate(); err != nil { + // We have received an error in the spec! + + logger.Err(err).Warn("Invalid Spec on %s", item.String()) + + if status.Conditions.Update(schedulerApi.SpecValidCondition, false, "Spec is invalid", "Spec is invalid") || status.Accepted != nil { + status.Accepted = nil + return true, operator.Stop("Invalid spec") + } + return false, operator.Stop("Invalid spec") + } + + if status.Conditions.Update(schedulerApi.SpecValidCondition, true, "Spec is valid", "Spec is valid") { + return true, operator.Reconcile("Conditions updated") + } + return false, nil } diff --git a/pkg/handlers/scheduler/profile/handler_template.go b/pkg/handlers/scheduler/profile/handler_template.go new file mode 100644 index 000000000..61cb0ed40 --- /dev/null +++ b/pkg/handlers/scheduler/profile/handler_template.go @@ -0,0 +1,57 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package profile + +import ( + "context" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" +) + +func (h *handler) HandleTemplate(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoProfile, status *schedulerApi.ProfileStatus) (bool, error) { + templ := extension.Spec.Template + c, err := templ.Checksum() + if err != nil { + return false, err + } + + if t := status.Accepted; t != nil { + if c == "" || t.Checksum != c { + status.Accepted = nil + return true, operator.Reconcile("Template changed") + } + + return false, nil + } else { + if c != "" { + status.Accepted = &schedulerApi.ProfileAcceptedTemplate{ + Checksum: c, + Template: templ.DeepCopy(), + } + + return true, operator.Reconcile("Template changed") + } + + return false, nil + } +} diff --git a/pkg/handlers/scheduler/profile/handler_template_test.go b/pkg/handlers/scheduler/profile/handler_template_test.go new file mode 100644 index 000000000..5a2e6c719 --- /dev/null +++ b/pkg/handlers/scheduler/profile/handler_template_test.go @@ -0,0 +1,213 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package profile + +import ( + "testing" + + "github.com/stretchr/testify/require" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" + schedulerPodApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" + schedulerPodResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod/resources" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Template(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoProfile) { + obj.Spec.Template = &schedulerApi.ProfileTemplate{} + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.ReadyCondition)) + + require.NotNil(t, extension.Status.Accepted) + require.Equal(t, extension.Spec.Template, extension.Status.Accepted.Template) + require.Equal(t, "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", extension.Status.Accepted.Checksum) +} + +func Test_Handler_InvalidTemplate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoProfile) { + obj.Spec.Template = &schedulerApi.ProfileTemplate{ + Container: &schedulerApi.ProfileContainerTemplate{ + Containers: schedulerContainerApi.Containers{ + "^%$@#": {}, + }, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.False(t, extension.Status.Conditions.IsTrue(schedulerApi.SpecValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(schedulerApi.ReadyCondition)) + + require.Nil(t, extension.Status.Accepted) +} + +func Test_Handler_Template_Update(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoProfile) { + obj.Spec.Template = &schedulerApi.ProfileTemplate{} + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + t.Run("First", func(t *testing.T) { + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.ReadyCondition)) + + require.NotNil(t, extension.Status.Accepted) + require.Equal(t, extension.Spec.Template, extension.Status.Accepted.Template) + require.Equal(t, "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", extension.Status.Accepted.Checksum) + + require.Nil(t, extension.Status.Accepted.Template.Pod) + }) + + t.Run("Second", func(t *testing.T) { + // Arrange + extension.Spec.Template = &schedulerApi.ProfileTemplate{ + Pod: &schedulerPodApi.Pod{ + Image: &schedulerPodResourcesApi.Image{ + ImagePullSecrets: schedulerPodResourcesApi.ImagePullSecrets{ + "test", + }, + }, + }, + } + + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.ReadyCondition)) + + require.NotNil(t, extension.Status.Accepted) + require.Equal(t, extension.Spec.Template, extension.Status.Accepted.Template) + require.Equal(t, "f48e2e30be82828a43873befdf9eb877ee4d34d45b2eb45a2f253020955e022a", extension.Status.Accepted.Checksum) + + require.NotNil(t, extension.Status.Accepted.Template.Pod) + require.Equal(t, &schedulerPodApi.Pod{ + Image: &schedulerPodResourcesApi.Image{ + ImagePullSecrets: schedulerPodResourcesApi.ImagePullSecrets{ + "test", + }, + }, + }, extension.Status.Accepted.Template.Pod) + }) +} + +func Test_Handler_Template_UpdateInvalid(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoProfile) { + obj.Spec.Template = &schedulerApi.ProfileTemplate{} + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + t.Run("First", func(t *testing.T) { + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(schedulerApi.ReadyCondition)) + + require.NotNil(t, extension.Status.Accepted) + require.Equal(t, extension.Spec.Template, extension.Status.Accepted.Template) + require.Equal(t, "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", extension.Status.Accepted.Checksum) + + require.Nil(t, extension.Status.Accepted.Template.Pod) + }) + + t.Run("Second", func(t *testing.T) { + // Arrange + extension.Spec.Template = &schedulerApi.ProfileTemplate{ + Container: &schedulerApi.ProfileContainerTemplate{ + Containers: schedulerContainerApi.Containers{ + "^%$@#": {}, + }, + }, + } + + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.False(t, extension.Status.Conditions.IsTrue(schedulerApi.SpecValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(schedulerApi.ReadyCondition)) + + require.Nil(t, extension.Status.Accepted) + }) +} diff --git a/pkg/integrations/sidecar/integration.go b/pkg/integrations/sidecar/integration.go index 0512fc8cb..87fab7558 100644 --- a/pkg/integrations/sidecar/integration.go +++ b/pkg/integrations/sidecar/integration.go @@ -14,6 +14,7 @@ import ( schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources" + schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" schedulerPodApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" schedulerPodResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod/resources" "github.com/arangodb/kube-arangodb/pkg/util" @@ -60,7 +61,7 @@ type Integration interface { Validate() error } -func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *schedulerApi.IntegrationSidecar, coreContainers []string, integrations ...Integration) (*schedulerApi.ProfileTemplate, error) { +func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *schedulerIntegrationApi.Sidecar, coreContainers []string, integrations ...Integration) (*schedulerApi.ProfileTemplate, error) { for _, integration := range integrations { if err := integration.Validate(); err != nil { name := strings.Join(integration.Name(), "/") From 750d63213fec6184c28722608bfdc2516fc5cadc Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:12:52 +0200 Subject: [PATCH 32/50] [Bugfix] Versioning Alignment (#1722) --- CHANGELOG.md | 1 + Makefile | 5 ++++- README.md | 8 ++++---- chart/kube-arangodb-enterprise-arm64/values.yaml | 4 ++-- chart/kube-arangodb-enterprise/values.yaml | 4 ++-- scripts/patch_chart.sh | 4 ++-- scripts/patch_examples.sh | 2 +- scripts/patch_readme.sh | 1 + 8 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd1d4d21..83fadf30e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - (Feature) (Gateway) Dynamic Configuration - (Feature) DebugPackage ArangoRoutes - (Feature) (Scheduler) Add Status Conditions +- (Bugfix) Versioning Alignment ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index 6be7f0a72..44c42ed84 100644 --- a/Makefile +++ b/Makefile @@ -747,7 +747,10 @@ patch-release: patch-readme patch-examples patch-chart .PHONY: patch-chart patch-chart: - $(ROOTDIR)/scripts/patch_chart.sh "$(VERSION_MAJOR_MINOR_PATCH)" "$(OPERATORIMAGE)" + $(ROOTDIR)/scripts/patch_chart.sh $(VERSION_MAJOR_MINOR_PATCH) + +.PHONY: patch +patch: patch-chart patch-release patch-examples patch-readme .PHONY: tidy tidy: diff --git a/README.md b/README.md index 55c1af195..f6b852ac8 100644 --- a/README.md +++ b/README.md @@ -325,9 +325,9 @@ helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/ ##### Enterprise Edition ```bash # The following will install the operator and basic CRDs resources. -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.41/kube-arangodb-enterprise-1.2.41.tgz +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz # To use `ArangoLocalStorage`, set field `operator.features.storage` to true -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.41/kube-arangodb-enterprise-1.2.41.tgz --set "operator.features.storage=true" +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz --set "operator.features.storage=true" ``` ### Upgrading the operator using Helm @@ -364,9 +364,9 @@ helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/ ##### Enterprise Edition ```bash # The following will install the operator and basic CRDs resources. -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.41/kube-arangodb-enterprise-1.2.41.tgz +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz # To use `ArangoLocalStorage`, set field `operator.features.storage` to true -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.41/kube-arangodb-enterprise-1.2.41.tgz --set "operator.features.storage=true" +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz --set "operator.features.storage=true" ``` ## Building diff --git a/chart/kube-arangodb-enterprise-arm64/values.yaml b/chart/kube-arangodb-enterprise-arm64/values.yaml index 0ec2b19b7..96f6e6b16 100644 --- a/chart/kube-arangodb-enterprise-arm64/values.yaml +++ b/chart/kube-arangodb-enterprise-arm64/values.yaml @@ -1,10 +1,10 @@ operator: - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.42 imagePullPolicy: IfNotPresent imagePullSecrets: [] scope: legacy architectures: - - amd64 + - arm64 debug: false args: [] service: diff --git a/chart/kube-arangodb-enterprise/values.yaml b/chart/kube-arangodb-enterprise/values.yaml index f509a510f..92ae2b0a1 100644 --- a/chart/kube-arangodb-enterprise/values.yaml +++ b/chart/kube-arangodb-enterprise/values.yaml @@ -1,10 +1,10 @@ operator: - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.42 imagePullPolicy: IfNotPresent imagePullSecrets: [] scope: legacy architectures: - - arm64 + - amd64 debug: false args: [] service: diff --git a/scripts/patch_chart.sh b/scripts/patch_chart.sh index 47371a970..edf8686a4 100755 --- a/scripts/patch_chart.sh +++ b/scripts/patch_chart.sh @@ -4,7 +4,6 @@ # version. VERSION=$1 -IMAGE=$2 if [ -z $VERSION ]; then echo "Specify a version argument" @@ -20,6 +19,7 @@ function replaceInFile { for f in kube-arangodb kube-arangodb-enterprise kube-arangodb-arm64 kube-arangodb-enterprise-arm64 kube-arangodb-crd; do replaceInFile "s@^version: .*\$@version: ${VERSION}@g" "chart/${f}/Chart.yaml" if [[ -f "chart/${f}/values.yaml" ]]; then - replaceInFile "s@^ image: .*\$@ image: ${IMAGE}@g" "chart/${f}/values.yaml" + replaceInFile "s@^ image: arangodb/kube-arangodb:[[:digit:]].*\$@ image: arangodb/kube-arangodb:${VERSION}@g" "chart/${f}/values.yaml" + replaceInFile "s@^ image: arangodb/kube-arangodb-enterprise:[[:digit:]].*\$@ image: arangodb/kube-arangodb-enterprise:${VERSION}@g" "chart/${f}/values.yaml" fi done \ No newline at end of file diff --git a/scripts/patch_examples.sh b/scripts/patch_examples.sh index 58f6cc82a..117ab3fea 100755 --- a/scripts/patch_examples.sh +++ b/scripts/patch_examples.sh @@ -9,7 +9,7 @@ if [ -z $VERSION ]; then exit 1 fi -ARANGODB_VERSION=3.10.8 +ARANGODB_VERSION=3.12.2 function replaceInFile { local EXPR=$1 diff --git a/scripts/patch_readme.sh b/scripts/patch_readme.sh index ca77aee70..1c6af7e59 100755 --- a/scripts/patch_readme.sh +++ b/scripts/patch_readme.sh @@ -35,3 +35,4 @@ replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/ku replaceInFile "s@https://github\.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-crd-[[:digit:]].*\.tgz@https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-crd-${VERSION}.tgz@g" ${f} replaceInFile "s@https://github\.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-enterprise-[[:digit:]].*\.tgz@https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-enterprise-${VERSION}.tgz@g" ${f} replaceInFile "s@https://github\.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-[[:digit:]].*\.tgz@https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-${VERSION}.tgz@g" ${f} +replaceInFile "s@https://github\.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-enterprise-[[:digit:]].*\.tgz@https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-enterprise-${VERSION}.tgz@g" ${f} From e1e9d3f29118d048abaa0f031d9c07e7897284b5 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:25:10 +0200 Subject: [PATCH 33/50] [Feature] [Scheduler] Merge Strategy (#1721) --- .golangci.yaml | 2 + CHANGELOG.md | 1 + Makefile | 6 +- docs/api/ArangoDeployment.V1.md | 22 ++- docs/api/ArangoMLExtension.V1Beta1.md | 166 +++++++++++++++--- docs/api/ArangoProfile.V1Beta1.md | 20 ++- docs/api/GraphAnalyticsEngine.V1Alpha1.md | 40 ++++- internal/docs_test.go | 4 + .../v1beta1/container/resources/core.go | 24 ++- .../v1beta1/container/resources/core_test.go | 25 +++ .../resources/zz_generated.deepcopy.go | 6 + pkg/apis/scheduler/v1beta1/policy/doc.go | 23 +++ pkg/apis/scheduler/v1beta1/policy/merge.go | 71 ++++++++ .../v1beta1/policy/zz_generated.deepcopy.go | 47 +++++ ...graphanalyticsengine.schema.generated.yaml | 4 + .../database-deployment.schema.generated.yaml | 6 + .../crds/ml-extension.schema.generated.yaml | 18 ++ .../scheduler-profile.schema.generated.yaml | 2 + 18 files changed, 438 insertions(+), 49 deletions(-) create mode 100644 pkg/apis/scheduler/v1beta1/policy/doc.go create mode 100644 pkg/apis/scheduler/v1beta1/policy/merge.go create mode 100644 pkg/apis/scheduler/v1beta1/policy/zz_generated.deepcopy.go diff --git a/.golangci.yaml b/.golangci.yaml index 75382a541..506e35a75 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -81,6 +81,8 @@ linters-settings: pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources - alias: schedulerIntegrationApi pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration + - alias: schedulerPolicyApi + pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/policy - alias: schedulerPodApi pkg: github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod - alias: schedulerPodResourcesApi diff --git a/CHANGELOG.md b/CHANGELOG.md index 83fadf30e..ae68b18c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - (Feature) DebugPackage ArangoRoutes - (Feature) (Scheduler) Add Status Conditions - (Bugfix) Versioning Alignment +- (Feature) (Scheduler) Merge Strategy ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index 44c42ed84..c59780eb2 100644 --- a/Makefile +++ b/Makefile @@ -452,7 +452,7 @@ update-generated: "github.com/arangodb/kube-arangodb/pkg/apis" \ "shared:v1 \ scheduler:v1alpha1/container scheduler:v1alpha1/container/resources scheduler:v1alpha1/pod scheduler:v1alpha1/pod/resources \ - scheduler:v1beta1/integration scheduler:v1beta1/container scheduler:v1beta1/container/resources scheduler:v1beta1/pod scheduler:v1beta1/pod/resources" \ + scheduler:v1beta1/integration scheduler:v1beta1/policy scheduler:v1beta1/container scheduler:v1beta1/container/resources scheduler:v1beta1/pod scheduler:v1beta1/pod/resources" \ --go-header-file "./tools/codegen/boilerplate.go.txt" \ $(VERIFYARGS) @@ -815,6 +815,7 @@ set-typed-api-version/%: "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ "$(ROOT)/pkg/apis/networking/" \ + "$(ROOT)/pkg/apis/scheduler/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/$*/v[A-Za-z0-9]\+#github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/$*/v$(API_VERSION)#g" @@ -832,6 +833,7 @@ set-api-version/%: "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ "$(ROOT)/pkg/apis/networking/" \ + "$(ROOT)/pkg/apis/scheduler/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#github.com/arangodb/kube-arangodb/pkg/apis/$*/v[A-Za-z0-9]\+#github.com/arangodb/kube-arangodb/pkg/apis/$*/v$(API_VERSION)#g" @@ -846,6 +848,7 @@ set-api-version/%: "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ "$(ROOT)/pkg/apis/networking/" \ + "$(ROOT)/pkg/apis/scheduler/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#DatabaseV[A-Za-z0-9]\+()\.#DatabaseV$(API_VERSION)().#g" @@ -860,6 +863,7 @@ set-api-version/%: "$(ROOT)/pkg/handlers" \ "$(ROOT)/pkg/apis/backup/" \ "$(ROOT)/pkg/apis/networking/" \ + "$(ROOT)/pkg/apis/scheduler/" \ "$(ROOT)/pkg/upgrade/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 $(SED) -i "s#ReplicationV[A-Za-z0-9]\+()\.#ReplicationV$(API_VERSION)().#g" diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 04e56360b..046dbba1d 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3076,7 +3076,7 @@ By default, the image is determined by the operator. ### .spec.gateway.sidecar.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -3093,7 +3093,7 @@ Links: ### .spec.gateway.sidecar.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -3110,7 +3110,7 @@ Links: ### .spec.gateway.sidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L16) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -3168,7 +3168,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.gateway.sidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L12) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) ListenPort defines on which port the sidecar container will be listening for connections @@ -3188,6 +3188,18 @@ Links: *** +### .spec.gateway.sidecar.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.gateway.sidecar.ports Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) @@ -3258,7 +3270,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.gateway.sidecar.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which diff --git a/docs/api/ArangoMLExtension.V1Beta1.md b/docs/api/ArangoMLExtension.V1Beta1.md index 88f954fcd..729fafd28 100644 --- a/docs/api/ArangoMLExtension.V1Beta1.md +++ b/docs/api/ArangoMLExtension.V1Beta1.md @@ -34,7 +34,7 @@ Links: ### .spec.deployment.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -59,7 +59,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.deployment.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -196,6 +196,18 @@ Links: *** +### .spec.deployment.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.deployment.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -408,7 +420,7 @@ Links: ### .spec.deployment.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -442,7 +454,7 @@ Links: ### .spec.init.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -467,7 +479,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.init.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -594,6 +606,18 @@ Links: *** +### .spec.init.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.init.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -754,7 +778,7 @@ Links: ### .spec.init.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -764,7 +788,7 @@ might be configured in the container image. ### .spec.integrationSidecar.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -781,7 +805,7 @@ Links: ### .spec.integrationSidecar.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -798,7 +822,7 @@ Links: ### .spec.integrationSidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L16) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -856,7 +880,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.integrationSidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L12) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) ListenPort defines on which port the sidecar container will be listening for connections @@ -876,6 +900,18 @@ Links: *** +### .spec.integrationSidecar.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.integrationSidecar.ports Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) @@ -946,7 +982,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.integrationSidecar.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -980,7 +1016,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1005,7 +1041,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.featurization.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1132,6 +1168,18 @@ Links: *** +### .spec.jobsTemplates.featurization.cpu.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.jobsTemplates.featurization.cpu.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -1292,7 +1340,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -1326,7 +1374,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1351,7 +1399,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.featurization.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1478,6 +1526,18 @@ Links: *** +### .spec.jobsTemplates.featurization.gpu.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.jobsTemplates.featurization.gpu.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -1638,7 +1698,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -1672,7 +1732,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1697,7 +1757,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.prediction.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1824,6 +1884,18 @@ Links: *** +### .spec.jobsTemplates.prediction.cpu.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.jobsTemplates.prediction.cpu.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -1984,7 +2056,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2018,7 +2090,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2043,7 +2115,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.prediction.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2170,6 +2242,18 @@ Links: *** +### .spec.jobsTemplates.prediction.gpu.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.jobsTemplates.prediction.gpu.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -2330,7 +2414,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2364,7 +2448,7 @@ Links: ### .spec.jobsTemplates.training.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2389,7 +2473,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.training.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2516,6 +2600,18 @@ Links: *** +### .spec.jobsTemplates.training.cpu.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.jobsTemplates.training.cpu.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -2676,7 +2772,7 @@ Links: ### .spec.jobsTemplates.training.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2710,7 +2806,7 @@ Links: ### .spec.jobsTemplates.training.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2735,7 +2831,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.training.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2862,6 +2958,18 @@ Links: *** +### .spec.jobsTemplates.training.gpu.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.jobsTemplates.training.gpu.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -3022,7 +3130,7 @@ Links: ### .spec.jobsTemplates.training.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which diff --git a/docs/api/ArangoProfile.V1Beta1.md b/docs/api/ArangoProfile.V1Beta1.md index fd6c2d6f7..df8c51628 100644 --- a/docs/api/ArangoProfile.V1Beta1.md +++ b/docs/api/ArangoProfile.V1Beta1.md @@ -48,7 +48,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.template.container.containers.\.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -65,7 +65,7 @@ Links: ### .spec.template.container.containers.\.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -140,6 +140,18 @@ Links: *** +### .spec.template.container.containers.\.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.template.container.containers.\.ports Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) @@ -210,7 +222,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.template.container.containers.\.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -394,5 +406,5 @@ Links: ### .spec.template.priority -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/profile_template.go#L31) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/profile_template.go#L32) diff --git a/docs/api/GraphAnalyticsEngine.V1Alpha1.md b/docs/api/GraphAnalyticsEngine.V1Alpha1.md index 45ba05dd3..382e51bb1 100644 --- a/docs/api/GraphAnalyticsEngine.V1Alpha1.md +++ b/docs/api/GraphAnalyticsEngine.V1Alpha1.md @@ -34,7 +34,7 @@ Links: ### .spec.deployment.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -59,7 +59,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.deployment.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -186,6 +186,18 @@ Links: *** +### .spec.deployment.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.deployment.nodeSelector Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) @@ -388,7 +400,7 @@ Links: ### .spec.deployment.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -406,7 +418,7 @@ DeploymentName define deployment name used in the object. Immutable ### .spec.integrationSidecar.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -423,7 +435,7 @@ Links: ### .spec.integrationSidecar.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -440,7 +452,7 @@ Links: ### .spec.integrationSidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L16) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -498,7 +510,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.integrationSidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L12) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) ListenPort defines on which port the sidecar container will be listening for connections @@ -518,6 +530,18 @@ Links: *** +### .spec.integrationSidecar.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + ### .spec.integrationSidecar.ports Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) @@ -588,7 +612,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.integrationSidecar.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which diff --git a/internal/docs_test.go b/internal/docs_test.go index d2b4b7541..765c969c9 100644 --- a/internal/docs_test.go +++ b/internal/docs_test.go @@ -183,6 +183,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", + "scheduler/v1beta1/policy", }, }, }, @@ -257,6 +258,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", + "scheduler/v1beta1/policy", }, }, }, @@ -289,6 +291,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", + "scheduler/v1beta1/policy", }, }, }, @@ -329,6 +332,7 @@ func Test_GenerateAPIDocs(t *testing.T) { "scheduler/v1beta1/integration", "scheduler/v1beta1/pod", "scheduler/v1beta1/pod/resources", + "scheduler/v1beta1/policy", }, }, }, diff --git a/pkg/apis/scheduler/v1beta1/container/resources/core.go b/pkg/apis/scheduler/v1beta1/container/resources/core.go index a36e72049..af14419c9 100644 --- a/pkg/apis/scheduler/v1beta1/container/resources/core.go +++ b/pkg/apis/scheduler/v1beta1/container/resources/core.go @@ -24,11 +24,15 @@ import ( core "k8s.io/api/core/v1" "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/interfaces" + schedulerPolicyApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/policy" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) var _ interfaces.Container[Core] = &Core{} type Core struct { + *schedulerPolicyApi.Policy `json:",inline"` + // Entrypoint array. Not executed within a shell. // The container image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable @@ -78,9 +82,25 @@ func (c *Core) With(other *Core) *Core { return c.DeepCopy() } - return other.DeepCopy() + if c == nil { + return other.DeepCopy() + } + + o := other.DeepCopy() + + if o.GetMethod(schedulerPolicyApi.Override) == schedulerPolicyApi.Append { + o.Args = append(c.Args, o.Args...) + } + + return o } func (c *Core) Validate() error { - return nil + if c == nil { + return nil + } + + return shared.WithErrors( + shared.ValidateOptionalInterface(c.Policy), + ) } diff --git a/pkg/apis/scheduler/v1beta1/container/resources/core_test.go b/pkg/apis/scheduler/v1beta1/container/resources/core_test.go index f26fcd863..98d8e9aa2 100644 --- a/pkg/apis/scheduler/v1beta1/container/resources/core_test.go +++ b/pkg/apis/scheduler/v1beta1/container/resources/core_test.go @@ -25,6 +25,9 @@ import ( "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" + + schedulerPolicyApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/policy" + "github.com/arangodb/kube-arangodb/pkg/util" ) func applyCore(t *testing.T, template *core.PodTemplateSpec, container *core.Container, ns ...*Core) func(in func(t *testing.T, pod *core.PodTemplateSpec, container *core.Container)) { @@ -101,6 +104,28 @@ func Test_Core(t *testing.T) { require.Len(t, container.Command, 1) require.Contains(t, container.Command, "B") + require.EqualValues(t, "", container.WorkingDir) + }) + }) + t.Run("With Append", func(t *testing.T) { + applyCore(t, &core.PodTemplateSpec{}, &core.Container{}, &Core{ + Command: []string{"B"}, + Args: []string{"A"}, + }, &Core{ + Policy: &schedulerPolicyApi.Policy{ + Method: util.NewType(schedulerPolicyApi.Append), + }, + Command: []string{"C"}, + Args: []string{"D"}, + })(func(t *testing.T, _ *core.PodTemplateSpec, container *core.Container) { + require.Len(t, container.Args, 2) + require.Contains(t, container.Args, "A") + require.Contains(t, container.Args, "D") + require.Equal(t, []string{"A", "D"}, container.Args) + + require.Len(t, container.Command, 1) + require.Contains(t, container.Command, "C") + require.EqualValues(t, "", container.WorkingDir) }) }) diff --git a/pkg/apis/scheduler/v1beta1/container/resources/zz_generated.deepcopy.go b/pkg/apis/scheduler/v1beta1/container/resources/zz_generated.deepcopy.go index 1a201856b..a73ccbc03 100644 --- a/pkg/apis/scheduler/v1beta1/container/resources/zz_generated.deepcopy.go +++ b/pkg/apis/scheduler/v1beta1/container/resources/zz_generated.deepcopy.go @@ -26,12 +26,18 @@ package resources import ( + policy "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/policy" v1 "k8s.io/api/core/v1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Core) DeepCopyInto(out *Core) { *out = *in + if in.Policy != nil { + in, out := &in.Policy, &out.Policy + *out = new(policy.Policy) + (*in).DeepCopyInto(*out) + } if in.Command != nil { in, out := &in.Command, &out.Command *out = make([]string, len(*in)) diff --git a/pkg/apis/scheduler/v1beta1/policy/doc.go b/pkg/apis/scheduler/v1beta1/policy/doc.go new file mode 100644 index 000000000..264e0d855 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/policy/doc.go @@ -0,0 +1,23 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// +k8s:deepcopy-gen=package +// +groupName=scheduler.arangodb.com +package policy diff --git a/pkg/apis/scheduler/v1beta1/policy/merge.go b/pkg/apis/scheduler/v1beta1/policy/merge.go new file mode 100644 index 000000000..b38889521 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/policy/merge.go @@ -0,0 +1,71 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package policy + +import ( + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +type Policy struct { + // Method defines the merge method + // +doc/enum: override|Overrides values during configuration merge + // +doc/enum: append|Appends, if possible, values during configuration merge + Method *Method `json:"method,omitempty"` +} + +func (m *Policy) Validate() error { + if m == nil { + return nil + } + + return shared.WithErrors( + shared.PrefixResourceErrors("method", shared.ValidateOptionalInterface(m.Method)), + ) +} + +func (m *Policy) GetMethod(d Method) Method { + if m == nil || m.Method == nil { + return d + } + + return *m.Method +} + +type Method string + +func (m *Method) Validate() error { + if m == nil { + return nil + } + + switch v := *m; v { + case Override, Append: + return nil + default: + return errors.Errorf("Invalid method: %s", v) + } +} + +const ( + Override Method = "override" + Append Method = "append" +) diff --git a/pkg/apis/scheduler/v1beta1/policy/zz_generated.deepcopy.go b/pkg/apis/scheduler/v1beta1/policy/zz_generated.deepcopy.go new file mode 100644 index 000000000..f6e8848b3 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/policy/zz_generated.deepcopy.go @@ -0,0 +1,47 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package policy + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Policy) DeepCopyInto(out *Policy) { + *out = *in + if in.Method != nil { + in, out := &in.Method, &out.Method + *out = new(Method) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. +func (in *Policy) DeepCopy() *Policy { + if in == nil { + return nil + } + out := new(Policy) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/crd/crds/analytics-graphanalyticsengine.schema.generated.yaml b/pkg/crd/crds/analytics-graphanalyticsengine.schema.generated.yaml index dd1a76015..2c3f7244f 100644 --- a/pkg/crd/crds/analytics-graphanalyticsengine.schema.generated.yaml +++ b/pkg/crd/crds/analytics-graphanalyticsengine.schema.generated.yaml @@ -594,6 +594,8 @@ v1alpha1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -1898,6 +1900,8 @@ v1alpha1: format: int32 type: integer type: object + method: + type: string ports: items: properties: diff --git a/pkg/crd/crds/database-deployment.schema.generated.yaml b/pkg/crd/crds/database-deployment.schema.generated.yaml index 578c15216..3d73b0b64 100644 --- a/pkg/crd/crds/database-deployment.schema.generated.yaml +++ b/pkg/crd/crds/database-deployment.schema.generated.yaml @@ -6828,6 +6828,8 @@ v1: format: int32 type: integer type: object + method: + type: string ports: items: properties: @@ -23350,6 +23352,8 @@ v1alpha: format: int32 type: integer type: object + method: + type: string ports: items: properties: @@ -39872,6 +39876,8 @@ v2alpha1: format: int32 type: integer type: object + method: + type: string ports: items: properties: diff --git a/pkg/crd/crds/ml-extension.schema.generated.yaml b/pkg/crd/crds/ml-extension.schema.generated.yaml index 8e5288fcf..17e450dfe 100644 --- a/pkg/crd/crds/ml-extension.schema.generated.yaml +++ b/pkg/crd/crds/ml-extension.schema.generated.yaml @@ -13624,6 +13624,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -15262,6 +15264,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -16533,6 +16537,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string ports: items: properties: @@ -17371,6 +17377,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -18987,6 +18995,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -20606,6 +20616,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -22222,6 +22234,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -23841,6 +23855,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string @@ -25457,6 +25473,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string nodeSelector: additionalProperties: type: string diff --git a/pkg/crd/crds/scheduler-profile.schema.generated.yaml b/pkg/crd/crds/scheduler-profile.schema.generated.yaml index 567504299..04ddea193 100644 --- a/pkg/crd/crds/scheduler-profile.schema.generated.yaml +++ b/pkg/crd/crds/scheduler-profile.schema.generated.yaml @@ -2111,6 +2111,8 @@ v1beta1: format: int32 type: integer type: object + method: + type: string ports: items: properties: From 59dd65b6b673ee6f579cbd7326da2a164e0467d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:30:53 +0200 Subject: [PATCH 34/50] Bump path-to-regexp and express in /dashboard (#1724) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dashboard/package-lock.json | 505 ++++++++++++++++++++++++++---------- 1 file changed, 370 insertions(+), 135 deletions(-) diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index d7b940453..18110348c 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -4757,6 +4757,114 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, + "body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true + }, + "qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "requires": { + "side-channel": "^1.0.6" + } + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + } + } + }, "bonjour-service": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.0.14.tgz", @@ -5248,6 +5356,12 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true + }, "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", @@ -5694,6 +5808,17 @@ "execa": "^5.0.0" } }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -6070,6 +6195,42 @@ "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + }, + "dependencies": { + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + } + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, "es-module-lexer": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", @@ -6763,37 +6924,37 @@ } }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", + "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", "dev": true, "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -6807,46 +6968,6 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "dev": true }, - "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "dependencies": { - "content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true - } - } - }, - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true - }, - "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "dev": true - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -6856,6 +6977,18 @@ "ms": "2.0.0" } }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true + }, + "merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -6863,37 +6996,98 @@ "dev": true }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "requires": { - "side-channel": "^1.0.4" + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } } }, - "raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "serve-static": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", + "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", "dev": true, "requires": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + } + } } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true } } }, @@ -7531,6 +7725,15 @@ } } }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", @@ -7612,6 +7815,12 @@ "get-intrinsic": "^1.1.1" } }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -7627,6 +7836,23 @@ "has-symbols": "^1.0.2" } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + }, + "dependencies": { + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + } + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -10415,12 +10641,6 @@ "fs-monkey": "^1.0.3" } }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "dev": true - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -10977,9 +11197,9 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.9.0.tgz", + "integrity": "sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==", "requires": { "isarray": "0.0.1" }, @@ -10987,7 +11207,7 @@ "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" } } }, @@ -12062,6 +12282,15 @@ "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", "dev": true }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, "querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -12104,6 +12333,26 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true + } + } + }, "react": { "version": "16.10.1", "resolved": "https://registry.npmjs.org/react/-/react-16.10.1.tgz", @@ -13495,52 +13744,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, - "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } - } - }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -13618,16 +13821,48 @@ } } }, - "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "dependencies": { + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + } } }, "setprototypeof": { From 0d6108158f03c7e75f4cfc15c49e97e95953fca6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:58:51 +0200 Subject: [PATCH 35/50] Bump webpack from 5.76.3 to 5.94.0 in /dashboard (#1712) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dashboard/package-lock.json | 551 ++++++++++++++++++++++-------------- 1 file changed, 343 insertions(+), 208 deletions(-) diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index 18110348c..a43d75a70 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -3439,16 +3439,6 @@ "@types/json-schema": "*" } }, - "@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "@types/estree": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", @@ -3859,152 +3849,6 @@ } } }, - "@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", - "dev": true, - "requires": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", - "dev": true - }, - "@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", - "dev": true, - "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.1", - "@xtuc/long": "4.2.2" - } - }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -4053,10 +3897,10 @@ "acorn-walk": "^7.1.1" } }, - "acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true }, "acorn-jsx": { @@ -6125,16 +5969,6 @@ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true }, - "enhanced-resolve": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz", - "integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - } - }, "entities": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", @@ -6231,12 +6065,6 @@ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true }, - "es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", - "dev": true - }, "es-shim-unscopables": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", @@ -14955,16 +14783,6 @@ "loose-envify": "^1.0.0" } }, - "watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "dev": true, - "requires": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - } - }, "wbuf": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", @@ -14981,47 +14799,281 @@ "dev": true }, "webpack": { - "version": "5.76.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz", - "integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "requires": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "dependencies": { + "@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "@types/estree": { - "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", + "dev": true, + "requires": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "dev": true + }, + "@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "dev": true, + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", "dev": true }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.12.1", + "@xtuc/long": "4.2.2" + } + }, "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true + }, + "browserslist": { + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" + } + }, + "caniuse-lite": { + "version": "1.0.30001660", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001660.tgz", + "integrity": "sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.5.20", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.20.tgz", + "integrity": "sha512-74mdl6Fs1HHzK9SUX4CKFxAtAe3nUns48y79TskHNAG6fGOlLfyKA4j855x+0b5u8rWJIrlaG9tcTPstMlwjIw==", + "dev": true + }, + "enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, + "es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true + }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true }, "eslint-scope": { @@ -15051,11 +15103,94 @@ } } }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true + }, + "node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true + }, + "picocolors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "dev": true + }, + "schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "terser": { + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.32.0.tgz", + "integrity": "sha512-v3Gtw3IzpBJ0ugkxEX8U0W6+TnPKRRCWGh1jC/iM/e3Ki5+qvO1L1EAZ56bZasc64aXHwRHNIQEzm6//i5cemQ==", + "dev": true, + "requires": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + } + }, + "terser-webpack-plugin": { + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.20", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.26.0" + } + }, + "update-browserslist-db": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "dev": true, + "requires": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + } + }, + "watchpack": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } } } }, From c5ffe866a0877de29c017342e6f17299e517369b Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:45:36 +0200 Subject: [PATCH 36/50] [Feature] [Scheduler] Extract Integration (#1723) --- docs/api/ArangoDeployment.V1.md | 414 +-- docs/cli/arangodb_operator_integration.md | 116 +- pkg/apis/deployment/v1/deployment_spec.go | 8 +- .../deployment/v1/deployment_spec_gateway.go | 20 +- .../v1/deployment_spec_integration.go | 49 + .../deployment/v1/zz_generated.deepcopy.go | 27 +- .../deployment/v2alpha1/deployment_spec.go | 8 +- .../v2alpha1/deployment_spec_gateway.go | 20 +- .../v2alpha1/deployment_spec_integration.go | 49 + .../v2alpha1/zz_generated.deepcopy.go | 27 +- .../database-deployment.schema.generated.yaml | 2964 +++++++++-------- .../resources/config_map_gateway.go | 2 +- .../resources/pod_creator_gateway_pod.go | 12 +- pkg/integrations/authentication_v1.go | 27 +- pkg/integrations/authorization_v0.go | 2 +- pkg/integrations/config_v1.go | 10 +- pkg/integrations/envoy_auth_v3.go | 2 +- pkg/integrations/flags.go | 243 ++ pkg/integrations/integration.go | 4 +- pkg/integrations/register.go | 59 +- pkg/integrations/scheduler_v1.go | 12 +- pkg/integrations/shutdown_v1.go | 2 +- pkg/integrations/sidecar/core.go | 25 +- .../sidecar/integration.authentication.v1.go | 31 +- ....v1.go => integration.authorization.v0.go} | 21 +- .../sidecar/integration.envoy.v3.go | 22 +- pkg/integrations/sidecar/integration.go | 160 +- .../sidecar/integration.shutdown.v1.go | 21 +- pkg/integrations/storage_v1.go | 29 +- 29 files changed, 2405 insertions(+), 1981 deletions(-) create mode 100644 pkg/apis/deployment/v1/deployment_spec_integration.go create mode 100644 pkg/apis/deployment/v2alpha1/deployment_spec_integration.go create mode 100644 pkg/integrations/flags.go rename pkg/integrations/sidecar/{integration.authorization.v1.go => integration.authorization.v0.go} (68%) diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 046dbba1d..2e63316dd 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3045,7 +3045,7 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. ### .spec.gateway.dynamic -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L36) Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. When enabled, gateway config will be reloaded by ConfigMap live updates. @@ -3056,7 +3056,7 @@ Default Value: `false` ### .spec.gateway.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L33) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L31) Enabled setting enables/disables support for gateway in the cluster. When enabled, the cluster will contain a number of `gateway` servers. @@ -3067,217 +3067,13 @@ Default Value: `false` ### .spec.gateway.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L42) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L40) Image is the image to use for the gateway. By default, the image is determined by the operator. *** -### .spec.gateway.sidecar.args - -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) - -Arguments to the entrypoint. -The container image's CMD is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container's environment. If a variable -cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced -to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will -produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless -of whether the variable exists or not. Cannot be updated. - -Links: -* [Kubernetes Docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) - -*** - -### .spec.gateway.sidecar.command - -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) - -Entrypoint array. Not executed within a shell. -The container image's ENTRYPOINT is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container's environment. If a variable -cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced -to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will -produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless -of whether the variable exists or not. Cannot be updated. - -Links: -* [Kubernetes Docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) - -*** - -### .spec.gateway.sidecar.controllerListenPort - -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) - -ControllerListenPort defines on which port the sidecar container will be listening for controller requests - -Default Value: `9202` - -*** - -### .spec.gateway.sidecar.env - -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) - -Env keeps the information about environment variables provided to the container - -Links: -* [Kubernetes Docs](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envvar-v1-core) - -*** - -### .spec.gateway.sidecar.envFrom - -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) - -EnvFrom keeps the information about environment variable sources provided to the container - -Links: -* [Kubernetes Docs](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envfromsource-v1-core) - -*** - -### .spec.gateway.sidecar.image - -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) - -Image define image details - -*** - -### .spec.gateway.sidecar.imagePullPolicy - -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) - -ImagePullPolicy define Image pull policy - -Default Value: `IfNotPresent` - -*** - -### .spec.gateway.sidecar.lifecycle - -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) - -Lifecycle keeps actions that the management system should take in response to container lifecycle events. - -*** - -### .spec.gateway.sidecar.listenPort - -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) - -ListenPort defines on which port the sidecar container will be listening for connections - -Default Value: `9201` - -*** - -### .spec.gateway.sidecar.livenessProbe - -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) - -LivenessProbe keeps configuration of periodic probe of container liveness. -Container will be restarted if the probe fails. - -Links: -* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) - -*** - -### .spec.gateway.sidecar.method - -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) - -Method defines the merge method - -Possible Values: -* `"override"` (default) - Overrides values during configuration merge -* `"append"` - Appends, if possible, values during configuration merge - -*** - -### .spec.gateway.sidecar.ports - -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) - -Ports contains list of ports to expose from the container. Not specifying a port here -DOES NOT prevent that port from being exposed. Any port which is -listening on the default "0.0.0.0" address inside a container will be -accessible from the network. - -*** - -### .spec.gateway.sidecar.readinessProbe - -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) - -ReadinessProbe keeps configuration of periodic probe of container service readiness. -Container will be removed from service endpoints if the probe fails. - -Links: -* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) - -*** - -### .spec.gateway.sidecar.resources - -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) - -Resources holds resource requests & limits for container - -Links: -* [Documentation of core.ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#resourcerequirements-v1-core) - -*** - -### .spec.gateway.sidecar.securityContext - -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) - -SecurityContext holds container-level security attributes and common container settings. - -Links: -* [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) - -*** - -### .spec.gateway.sidecar.startupProbe - -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) - -StartupProbe indicates that the Pod has successfully initialized. -If specified, no other probes are executed until this completes successfully. -If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. -This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, -when it might take a long time to load data or warm a cache, than during steady-state operation. - -Links: -* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) - -*** - -### .spec.gateway.sidecar.volumeMounts - -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) - -VolumeMounts keeps list of pod volumes to mount into the container's filesystem. - -*** - -### .spec.gateway.sidecar.workingDir - -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) - -Container's working directory. -If not specified, the container runtime's default will be used, which -might be configured in the container image. - -*** - ### .spec.gateways.affinity Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) @@ -4478,6 +4274,210 @@ ImagePullSecrets specifies the list of image pull secrets for the docker image t *** +### .spec.integration.sidecar.args + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) + +Arguments to the entrypoint. +The container image's CMD is used if this is not provided. +Variable references $(VAR_NAME) are expanded using the container's environment. If a variable +cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced +to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will +produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless +of whether the variable exists or not. Cannot be updated. + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) + +*** + +### .spec.integration.sidecar.command + +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) + +Entrypoint array. Not executed within a shell. +The container image's ENTRYPOINT is used if this is not provided. +Variable references $(VAR_NAME) are expanded using the container's environment. If a variable +cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced +to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will +produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless +of whether the variable exists or not. Cannot be updated. + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) + +*** + +### .spec.integration.sidecar.controllerListenPort + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) + +ControllerListenPort defines on which port the sidecar container will be listening for controller requests + +Default Value: `9202` + +*** + +### .spec.integration.sidecar.env + +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) + +Env keeps the information about environment variables provided to the container + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envvar-v1-core) + +*** + +### .spec.integration.sidecar.envFrom + +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) + +EnvFrom keeps the information about environment variable sources provided to the container + +Links: +* [Kubernetes Docs](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envfromsource-v1-core) + +*** + +### .spec.integration.sidecar.image + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) + +Image define image details + +*** + +### .spec.integration.sidecar.imagePullPolicy + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) + +ImagePullPolicy define Image pull policy + +Default Value: `IfNotPresent` + +*** + +### .spec.integration.sidecar.lifecycle + +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) + +Lifecycle keeps actions that the management system should take in response to container lifecycle events. + +*** + +### .spec.integration.sidecar.listenPort + +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) + +ListenPort defines on which port the sidecar container will be listening for connections + +Default Value: `9201` + +*** + +### .spec.integration.sidecar.livenessProbe + +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) + +LivenessProbe keeps configuration of periodic probe of container liveness. +Container will be restarted if the probe fails. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) + +*** + +### .spec.integration.sidecar.method + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) + +Method defines the merge method + +Possible Values: +* `"override"` (default) - Overrides values during configuration merge +* `"append"` - Appends, if possible, values during configuration merge + +*** + +### .spec.integration.sidecar.ports + +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) + +Ports contains list of ports to expose from the container. Not specifying a port here +DOES NOT prevent that port from being exposed. Any port which is +listening on the default "0.0.0.0" address inside a container will be +accessible from the network. + +*** + +### .spec.integration.sidecar.readinessProbe + +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) + +ReadinessProbe keeps configuration of periodic probe of container service readiness. +Container will be removed from service endpoints if the probe fails. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) + +*** + +### .spec.integration.sidecar.resources + +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) + +Resources holds resource requests & limits for container + +Links: +* [Documentation of core.ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#resourcerequirements-v1-core) + +*** + +### .spec.integration.sidecar.securityContext + +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) + +SecurityContext holds container-level security attributes and common container settings. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) + +*** + +### .spec.integration.sidecar.startupProbe + +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) + +StartupProbe indicates that the Pod has successfully initialized. +If specified, no other probes are executed until this completes successfully. +If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. +This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, +when it might take a long time to load data or warm a cache, than during steady-state operation. + +Links: +* [Kubernetes docs](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes) + +*** + +### .spec.integration.sidecar.volumeMounts + +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) + +VolumeMounts keeps list of pod volumes to mount into the container's filesystem. + +*** + +### .spec.integration.sidecar.workingDir + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) + +Container's working directory. +If not specified, the container runtime's default will be used, which +might be configured in the container image. + +*** + ### .spec.labels Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L127) diff --git a/docs/cli/arangodb_operator_integration.md b/docs/cli/arangodb_operator_integration.md index 3ed59a24b..f0bbe9a5c 100644 --- a/docs/cli/arangodb_operator_integration.md +++ b/docs/cli/arangodb_operator_integration.md @@ -18,65 +18,65 @@ Available Commands: help Help about any command Flags: - --health.address string Address to expose health service (default "0.0.0.0:9091") - --health.auth.token string Token for health service (when auth service is token) - --health.auth.type string Auth type for health service (default "None") - --health.shutdown.enabled Determines if shutdown service should be enabled and exposed (default true) - --health.tls.keyfile string Path to the keyfile + --health.address string Address to expose health service (Env: HEALTH_ADDRESS) (default "0.0.0.0:9091") + --health.auth.token string Token for health service (when auth service is token) (Env: HEALTH_AUTH_TOKEN) + --health.auth.type string Auth type for health service (Env: HEALTH_AUTH_TYPE) (default "None") + --health.shutdown.enabled Determines if shutdown service should be enabled and exposed (Env: HEALTH_SHUTDOWN_ENABLED) (default true) + --health.tls.keyfile string Path to the keyfile (Env: HEALTH_TLS_KEYFILE) -h, --help help for arangodb_operator_integration - --integration.authentication.v1 Enable AuthenticationV1 Integration Service - --integration.authentication.v1.enabled Defines if Authentication is enabled (default true) - --integration.authentication.v1.external Defones if External access to service authentication.v1 is enabled - --integration.authentication.v1.internal Defones if Internal access to service authentication.v1 is enabled (default true) - --integration.authentication.v1.path string Path to the JWT Folder - --integration.authentication.v1.token.allowed strings Allowed users for the Token - --integration.authentication.v1.token.max-size uint16 Max Token max size in bytes (default 64) - --integration.authentication.v1.token.ttl.default duration Default Token TTL (default 1h0m0s) - --integration.authentication.v1.token.ttl.max duration Max Token TTL (default 1h0m0s) - --integration.authentication.v1.token.ttl.min duration Min Token TTL (default 1m0s) - --integration.authentication.v1.token.user string Default user of the Token (default "root") - --integration.authentication.v1.ttl duration TTL of the JWT cache (default 15s) - --integration.authorization.v0 Enable AuthorizationV0 Integration Service - --integration.authorization.v0.external Defones if External access to service authorization.v0 is enabled - --integration.authorization.v0.internal Defones if Internal access to service authorization.v0 is enabled (default true) - --integration.config.v1 Enable ConfigV1 Integration Service - --integration.config.v1.external Defones if External access to service config.v1 is enabled - --integration.config.v1.internal Defones if Internal access to service config.v1 is enabled (default true) - --integration.config.v1.module strings Module in the reference = - --integration.envoy.auth.v3 Enable EnvoyAuthV3 Integration Service - --integration.envoy.auth.v3.external Defones if External access to service envoy.auth.v3 is enabled - --integration.envoy.auth.v3.internal Defones if Internal access to service envoy.auth.v3 is enabled (default true) - --integration.scheduler.v1 SchedulerV1 Integration - --integration.scheduler.v1.external Defones if External access to service scheduler.v1 is enabled - --integration.scheduler.v1.internal Defones if Internal access to service scheduler.v1 is enabled (default true) - --integration.scheduler.v1.namespace string Kubernetes Namespace (default "default") - --integration.scheduler.v1.verify-access Verify the CRD Access (default true) - --integration.shutdown.v1 ShutdownV1 Handler - --integration.shutdown.v1.external Defones if External access to service shutdown.v1 is enabled - --integration.shutdown.v1.internal Defones if Internal access to service shutdown.v1 is enabled (default true) - --integration.storage.v1 StorageBucket Integration - --integration.storage.v1.external Defones if External access to service storage.v1 is enabled - --integration.storage.v1.internal Defones if Internal access to service storage.v1 is enabled (default true) - --integration.storage.v1.s3.access-key string Path to file containing S3 AccessKey - --integration.storage.v1.s3.allow-insecure If set to true, the Endpoint certificates won't be checked - --integration.storage.v1.s3.bucket string Bucket name - --integration.storage.v1.s3.ca-crt string Path to file containing CA certificate to validate endpoint connection - --integration.storage.v1.s3.ca-key string Path to file containing keyfile to validate endpoint connection - --integration.storage.v1.s3.disable-ssl If set to true, the SSL won't be used when connecting to Endpoint - --integration.storage.v1.s3.endpoint string Endpoint of S3 API implementation - --integration.storage.v1.s3.region string Region - --integration.storage.v1.s3.secret-key string Path to file containing S3 SecretKey - --integration.storage.v1.type string Type of the Storage Integration (default "s3") - --services.address string Address to expose internal services (default "127.0.0.1:9092") - --services.auth.token string Token for internal service (when auth service is token) - --services.auth.type string Auth type for internal service (default "None") - --services.enabled Defines if internal access is enabled (default true) - --services.external.address string Address to expose external services (default "0.0.0.0:9093") - --services.external.auth.token string Token for external service (when auth service is token) - --services.external.auth.type string Auth type for external service (default "None") - --services.external.enabled Defines if external access is enabled - --services.external.tls.keyfile string Path to the keyfile - --services.tls.keyfile string Path to the keyfile + --integration.authentication.v1 Enable AuthenticationV1 Integration Service (Env: INTEGRATION_AUTHENTICATION_V1) + --integration.authentication.v1.enabled Defines if Authentication is enabled (Env: INTEGRATION_AUTHENTICATION_V1_ENABLED) (default true) + --integration.authentication.v1.external Defones if External access to service authentication.v1 is enabled (Env: INTEGRATION_AUTHENTICATION_V1_EXTERNAL) + --integration.authentication.v1.internal Defones if Internal access to service authentication.v1 is enabled (Env: INTEGRATION_AUTHENTICATION_V1_INTERNAL) (default true) + --integration.authentication.v1.path string Path to the JWT Folder (Env: INTEGRATION_AUTHENTICATION_V1_PATH) + --integration.authentication.v1.token.allowed strings Allowed users for the Token (Env: INTEGRATION_AUTHENTICATION_V1_TOKEN_ALLOWED) + --integration.authentication.v1.token.max-size uint16 Max Token max size in bytes (Env: INTEGRATION_AUTHENTICATION_V1_TOKEN_MAX_SIZE) (default 64) + --integration.authentication.v1.token.ttl.default duration Default Token TTL (Env: INTEGRATION_AUTHENTICATION_V1_TOKEN_TTL_DEFAULT) (default 1h0m0s) + --integration.authentication.v1.token.ttl.max duration Max Token TTL (Env: INTEGRATION_AUTHENTICATION_V1_TOKEN_TTL_MAX) (default 1h0m0s) + --integration.authentication.v1.token.ttl.min duration Min Token TTL (Env: INTEGRATION_AUTHENTICATION_V1_TOKEN_TTL_MIN) (default 1m0s) + --integration.authentication.v1.token.user string Default user of the Token (Env: INTEGRATION_AUTHENTICATION_V1_TOKEN_USER) (default "root") + --integration.authentication.v1.ttl duration TTL of the JWT cache (Env: INTEGRATION_AUTHENTICATION_V1_TTL) (default 15s) + --integration.authorization.v0 Enable AuthorizationV0 Integration Service (Env: INTEGRATION_AUTHORIZATION_V0) + --integration.authorization.v0.external Defones if External access to service authorization.v0 is enabled (Env: INTEGRATION_AUTHORIZATION_V0_EXTERNAL) + --integration.authorization.v0.internal Defones if Internal access to service authorization.v0 is enabled (Env: INTEGRATION_AUTHORIZATION_V0_INTERNAL) (default true) + --integration.config.v1 Enable ConfigV1 Integration Service (Env: INTEGRATION_CONFIG_V1) + --integration.config.v1.external Defones if External access to service config.v1 is enabled (Env: INTEGRATION_CONFIG_V1_EXTERNAL) + --integration.config.v1.internal Defones if Internal access to service config.v1 is enabled (Env: INTEGRATION_CONFIG_V1_INTERNAL) (default true) + --integration.config.v1.module strings Module in the reference = (Env: INTEGRATION_CONFIG_V1_MODULE) + --integration.envoy.auth.v3 Enable EnvoyAuthV3 Integration Service (Env: INTEGRATION_ENVOY_AUTH_V3) + --integration.envoy.auth.v3.external Defones if External access to service envoy.auth.v3 is enabled (Env: INTEGRATION_ENVOY_AUTH_V3_EXTERNAL) + --integration.envoy.auth.v3.internal Defones if Internal access to service envoy.auth.v3 is enabled (Env: INTEGRATION_ENVOY_AUTH_V3_INTERNAL) (default true) + --integration.scheduler.v1 SchedulerV1 Integration (Env: INTEGRATION_SCHEDULER_V1) + --integration.scheduler.v1.external Defones if External access to service scheduler.v1 is enabled (Env: INTEGRATION_SCHEDULER_V1_EXTERNAL) + --integration.scheduler.v1.internal Defones if Internal access to service scheduler.v1 is enabled (Env: INTEGRATION_SCHEDULER_V1_INTERNAL) (default true) + --integration.scheduler.v1.namespace string Kubernetes Namespace (Env: INTEGRATION_SCHEDULER_V1_NAMESPACE) (default "default") + --integration.scheduler.v1.verify-access Verify the CRD Access (Env: INTEGRATION_SCHEDULER_V1_VERIFY_ACCESS) (default true) + --integration.shutdown.v1 ShutdownV1 Handler (Env: INTEGRATION_SHUTDOWN_V1) + --integration.shutdown.v1.external Defones if External access to service shutdown.v1 is enabled (Env: INTEGRATION_SHUTDOWN_V1_EXTERNAL) + --integration.shutdown.v1.internal Defones if Internal access to service shutdown.v1 is enabled (Env: INTEGRATION_SHUTDOWN_V1_INTERNAL) (default true) + --integration.storage.v1 StorageBucket Integration (Env: INTEGRATION_STORAGE_V1) + --integration.storage.v1.external Defones if External access to service storage.v1 is enabled (Env: INTEGRATION_STORAGE_V1_EXTERNAL) + --integration.storage.v1.internal Defones if Internal access to service storage.v1 is enabled (Env: INTEGRATION_STORAGE_V1_INTERNAL) (default true) + --integration.storage.v1.s3.access-key string Path to file containing S3 AccessKey (Env: INTEGRATION_STORAGE_V1_S3_ACCESS_KEY) + --integration.storage.v1.s3.allow-insecure If set to true, the Endpoint certificates won't be checked (Env: INTEGRATION_STORAGE_V1_S3_ALLOW_INSECURE) + --integration.storage.v1.s3.bucket string Bucket name (Env: INTEGRATION_STORAGE_V1_S3_BUCKET) + --integration.storage.v1.s3.ca-crt string Path to file containing CA certificate to validate endpoint connection (Env: INTEGRATION_STORAGE_V1_S3_CA_CRT) + --integration.storage.v1.s3.ca-key string Path to file containing keyfile to validate endpoint connection (Env: INTEGRATION_STORAGE_V1_S3_CA_KEY) + --integration.storage.v1.s3.disable-ssl If set to true, the SSL won't be used when connecting to Endpoint (Env: INTEGRATION_STORAGE_V1_S3_DISABLE_SSL) + --integration.storage.v1.s3.endpoint string Endpoint of S3 API implementation (Env: INTEGRATION_STORAGE_V1_S3_ENDPOINT) + --integration.storage.v1.s3.region string Region (Env: INTEGRATION_STORAGE_V1_S3_REGION) + --integration.storage.v1.s3.secret-key string Path to file containing S3 SecretKey (Env: INTEGRATION_STORAGE_V1_S3_SECRET_KEY) + --integration.storage.v1.type string Type of the Storage Integration (Env: INTEGRATION_STORAGE_V1_TYPE) (default "s3") + --services.address string Address to expose internal services (Env: SERVICES_ADDRESS) (default "127.0.0.1:9092") + --services.auth.token string Token for internal service (when auth service is token) (Env: SERVICES_AUTH_TOKEN) + --services.auth.type string Auth type for internal service (Env: SERVICES_AUTH_TYPE) (default "None") + --services.enabled Defines if internal access is enabled (Env: SERVICES_ENABLED) (default true) + --services.external.address string Address to expose external services (Env: SERVICES_EXTERNAL_ADDRESS) (default "0.0.0.0:9093") + --services.external.auth.token string Token for external service (when auth service is token) (Env: SERVICES_EXTERNAL_AUTH_TOKEN) + --services.external.auth.type string Auth type for external service (Env: SERVICES_EXTERNAL_AUTH_TYPE) (default "None") + --services.external.enabled Defines if external access is enabled (Env: SERVICES_EXTERNAL_ENABLED) + --services.external.tls.keyfile string Path to the keyfile (Env: SERVICES_EXTERNAL_TLS_KEYFILE) + --services.tls.keyfile string Path to the keyfile (Env: SERVICES_TLS_KEYFILE) Use "arangodb_operator_integration [command] --help" for more information about a command. ``` diff --git a/pkg/apis/deployment/v1/deployment_spec.go b/pkg/apis/deployment/v1/deployment_spec.go index d25070f04..004583df5 100644 --- a/pkg/apis/deployment/v1/deployment_spec.go +++ b/pkg/apis/deployment/v1/deployment_spec.go @@ -262,6 +262,9 @@ type DeploymentSpec struct { // Gateway defined main Gateway configuration. Gateway *DeploymentSpecGateway `json:"gateway,omitempty"` + + // Integration defined main Integration configuration. + Integration *DeploymentSpecIntegration `json:"integration,omitempty"` } // GetAllowMemberRecreation returns member recreation policy based on group and settings @@ -582,7 +585,10 @@ func (s *DeploymentSpec) Validate() error { return errors.WithStack(errors.Wrap(err, "spec.architecture")) } if err := s.Gateway.Validate(); err != nil { - return errors.WithStack(errors.Wrap(err, "spec.architecture")) + return errors.WithStack(errors.Wrap(err, "spec.gateway")) + } + if err := s.Integration.Validate(); err != nil { + return errors.WithStack(errors.Wrap(err, "spec.integration")) } return nil } diff --git a/pkg/apis/deployment/v1/deployment_spec_gateway.go b/pkg/apis/deployment/v1/deployment_spec_gateway.go index b362c517b..8449e0e04 100644 --- a/pkg/apis/deployment/v1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v1/deployment_spec_gateway.go @@ -21,8 +21,6 @@ package v1 import ( - schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" - shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" ) @@ -40,9 +38,6 @@ type DeploymentSpecGateway struct { // Image is the image to use for the gateway. // By default, the image is determined by the operator. Image *string `json:"image"` - - // Sidecar define the integration sidecar spec - Sidecar *schedulerIntegrationApi.Sidecar `json:"sidecar,omitempty"` } // IsEnabled returns whether the gateway is enabled. @@ -63,22 +58,9 @@ func (d *DeploymentSpecGateway) IsDynamic() bool { return *d.Dynamic } -func (d *DeploymentSpecGateway) GetSidecar() *schedulerIntegrationApi.Sidecar { - if d == nil || d.Sidecar == nil { - return nil - } - return d.Sidecar -} - // Validate the given spec func (d *DeploymentSpecGateway) Validate() error { - if d == nil { - d = &DeploymentSpecGateway{} - } - - return shared.WithErrors( - shared.PrefixResourceErrors("integrationSidecar", d.GetSidecar().Validate()), - ) + return nil } // GetImage returns the image to use for the gateway. diff --git a/pkg/apis/deployment/v1/deployment_spec_integration.go b/pkg/apis/deployment/v1/deployment_spec_integration.go new file mode 100644 index 000000000..32ee69612 --- /dev/null +++ b/pkg/apis/deployment/v1/deployment_spec_integration.go @@ -0,0 +1,49 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" +) + +type DeploymentSpecIntegration struct { + // Sidecar define the integration sidecar spec + Sidecar *schedulerIntegrationApi.Sidecar `json:"sidecar,omitempty"` +} + +func (d *DeploymentSpecIntegration) GetSidecar() *schedulerIntegrationApi.Sidecar { + if d == nil || d.Sidecar == nil { + return nil + } + return d.Sidecar +} + +// Validate the given spec +func (d *DeploymentSpecIntegration) Validate() error { + if d == nil { + d = &DeploymentSpecIntegration{} + } + + return shared.WithErrors( + shared.PrefixResourceErrors("sidecar", d.GetSidecar().Validate()), + ) +} diff --git a/pkg/apis/deployment/v1/zz_generated.deepcopy.go b/pkg/apis/deployment/v1/zz_generated.deepcopy.go index 066b99d80..86f9e84bf 100644 --- a/pkg/apis/deployment/v1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1/zz_generated.deepcopy.go @@ -1159,6 +1159,11 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { *out = new(DeploymentSpecGateway) (*in).DeepCopyInto(*out) } + if in.Integration != nil { + in, out := &in.Integration, &out.Integration + *out = new(DeploymentSpecIntegration) + (*in).DeepCopyInto(*out) + } return } @@ -1190,6 +1195,22 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(string) **out = **in } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecGateway. +func (in *DeploymentSpecGateway) DeepCopy() *DeploymentSpecGateway { + if in == nil { + return nil + } + out := new(DeploymentSpecGateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentSpecIntegration) DeepCopyInto(out *DeploymentSpecIntegration) { + *out = *in if in.Sidecar != nil { in, out := &in.Sidecar, &out.Sidecar *out = new(integration.Sidecar) @@ -1198,12 +1219,12 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecGateway. -func (in *DeploymentSpecGateway) DeepCopy() *DeploymentSpecGateway { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecIntegration. +func (in *DeploymentSpecIntegration) DeepCopy() *DeploymentSpecIntegration { if in == nil { return nil } - out := new(DeploymentSpecGateway) + out := new(DeploymentSpecIntegration) in.DeepCopyInto(out) return out } diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec.go b/pkg/apis/deployment/v2alpha1/deployment_spec.go index 4e979fa22..56b28b9bd 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec.go @@ -262,6 +262,9 @@ type DeploymentSpec struct { // Gateway defined main Gateway configuration. Gateway *DeploymentSpecGateway `json:"gateway,omitempty"` + + // Integration defined main Integration configuration. + Integration *DeploymentSpecIntegration `json:"integration,omitempty"` } // GetAllowMemberRecreation returns member recreation policy based on group and settings @@ -582,7 +585,10 @@ func (s *DeploymentSpec) Validate() error { return errors.WithStack(errors.Wrap(err, "spec.architecture")) } if err := s.Gateway.Validate(); err != nil { - return errors.WithStack(errors.Wrap(err, "spec.architecture")) + return errors.WithStack(errors.Wrap(err, "spec.gateway")) + } + if err := s.Integration.Validate(); err != nil { + return errors.WithStack(errors.Wrap(err, "spec.integration")) } return nil } diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go index 41ecb45ce..a31d78150 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go @@ -21,8 +21,6 @@ package v2alpha1 import ( - schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" - shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" ) @@ -40,9 +38,6 @@ type DeploymentSpecGateway struct { // Image is the image to use for the gateway. // By default, the image is determined by the operator. Image *string `json:"image"` - - // Sidecar define the integration sidecar spec - Sidecar *schedulerIntegrationApi.Sidecar `json:"sidecar,omitempty"` } // IsEnabled returns whether the gateway is enabled. @@ -63,22 +58,9 @@ func (d *DeploymentSpecGateway) IsDynamic() bool { return *d.Dynamic } -func (d *DeploymentSpecGateway) GetSidecar() *schedulerIntegrationApi.Sidecar { - if d == nil || d.Sidecar == nil { - return nil - } - return d.Sidecar -} - // Validate the given spec func (d *DeploymentSpecGateway) Validate() error { - if d == nil { - d = &DeploymentSpecGateway{} - } - - return shared.WithErrors( - shared.PrefixResourceErrors("integrationSidecar", d.GetSidecar().Validate()), - ) + return nil } // GetImage returns the image to use for the gateway. diff --git a/pkg/apis/deployment/v2alpha1/deployment_spec_integration.go b/pkg/apis/deployment/v2alpha1/deployment_spec_integration.go new file mode 100644 index 000000000..c5670a2e0 --- /dev/null +++ b/pkg/apis/deployment/v2alpha1/deployment_spec_integration.go @@ -0,0 +1,49 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v2alpha1 + +import ( + schedulerIntegrationApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/integration" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" +) + +type DeploymentSpecIntegration struct { + // Sidecar define the integration sidecar spec + Sidecar *schedulerIntegrationApi.Sidecar `json:"sidecar,omitempty"` +} + +func (d *DeploymentSpecIntegration) GetSidecar() *schedulerIntegrationApi.Sidecar { + if d == nil || d.Sidecar == nil { + return nil + } + return d.Sidecar +} + +// Validate the given spec +func (d *DeploymentSpecIntegration) Validate() error { + if d == nil { + d = &DeploymentSpecIntegration{} + } + + return shared.WithErrors( + shared.PrefixResourceErrors("sidecar", d.GetSidecar().Validate()), + ) +} diff --git a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go index 7a13882bf..c57528ba7 100644 --- a/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go @@ -1159,6 +1159,11 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { *out = new(DeploymentSpecGateway) (*in).DeepCopyInto(*out) } + if in.Integration != nil { + in, out := &in.Integration, &out.Integration + *out = new(DeploymentSpecIntegration) + (*in).DeepCopyInto(*out) + } return } @@ -1190,6 +1195,22 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { *out = new(string) **out = **in } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecGateway. +func (in *DeploymentSpecGateway) DeepCopy() *DeploymentSpecGateway { + if in == nil { + return nil + } + out := new(DeploymentSpecGateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentSpecIntegration) DeepCopyInto(out *DeploymentSpecIntegration) { + *out = *in if in.Sidecar != nil { in, out := &in.Sidecar, &out.Sidecar *out = new(integration.Sidecar) @@ -1198,12 +1219,12 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecGateway. -func (in *DeploymentSpecGateway) DeepCopy() *DeploymentSpecGateway { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpecIntegration. +func (in *DeploymentSpecIntegration) DeepCopy() *DeploymentSpecIntegration { if in == nil { return nil } - out := new(DeploymentSpecGateway) + out := new(DeploymentSpecIntegration) in.DeepCopyInto(out) return out } diff --git a/pkg/crd/crds/database-deployment.schema.generated.yaml b/pkg/crd/crds/database-deployment.schema.generated.yaml index 3d73b0b64..76649f8de 100644 --- a/pkg/crd/crds/database-deployment.schema.generated.yaml +++ b/pkg/crd/crds/database-deployment.schema.generated.yaml @@ -6582,498 +6582,6 @@ v1: Image is the image to use for the gateway. By default, the image is determined by the operator. type: string - sidecar: - description: Sidecar define the integration sidecar spec - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - controllerListenPort: - format: int32 - type: integer - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - type: object - listenPort: - format: int32 - type: integer - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - method: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: - type: string - type: object type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. @@ -9695,6 +9203,502 @@ v1: items: type: string type: array + integration: + description: Integration defined main Integration configuration. + properties: + sidecar: + description: Sidecar define the integration sidecar spec + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + controllerListenPort: + format: int32 + type: integer + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + listenPort: + format: int32 + type: integer + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + method: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: object labels: additionalProperties: type: string @@ -23106,498 +23110,6 @@ v1alpha: Image is the image to use for the gateway. By default, the image is determined by the operator. type: string - sidecar: - description: Sidecar define the integration sidecar spec - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - controllerListenPort: - format: int32 - type: integer - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - type: object - listenPort: - format: int32 - type: integer - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - method: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: - type: string - type: object type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. @@ -26219,6 +25731,502 @@ v1alpha: items: type: string type: array + integration: + description: Integration defined main Integration configuration. + properties: + sidecar: + description: Sidecar define the integration sidecar spec + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + controllerListenPort: + format: int32 + type: integer + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + listenPort: + format: int32 + type: integer + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + method: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: object labels: additionalProperties: type: string @@ -39630,498 +39638,6 @@ v2alpha1: Image is the image to use for the gateway. By default, the image is determined by the operator. type: string - sidecar: - description: Sidecar define the integration sidecar spec - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - controllerListenPort: - format: int32 - type: integer - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - type: string - resource: - type: string - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - type: object - type: object - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - sleep: - properties: - seconds: - format: int64 - type: integer - type: object - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - type: object - type: object - listenPort: - format: int32 - type: integer - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - method: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - type: string - type: object - type: array - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - claims: - items: - properties: - name: - type: string - type: object - type: array - limits: - additionalProperties: - type: string - type: object - requests: - additionalProperties: - type: string - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - type: object - type: array - path: - type: string - port: - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - type: string - x-kubernetes-int-or-string: true - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - type: object - type: array - workingDir: - type: string - type: object type: object gateways: description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`. @@ -42743,6 +42259,502 @@ v2alpha1: items: type: string type: array + integration: + description: Integration defined main Integration configuration. + properties: + sidecar: + description: Sidecar define the integration sidecar spec + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + controllerListenPort: + format: int32 + type: integer + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + listenPort: + format: int32 + type: integer + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + method: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: object labels: additionalProperties: type: string diff --git a/pkg/deployment/resources/config_map_gateway.go b/pkg/deployment/resources/config_map_gateway.go index f539e40a4..420f5f117 100644 --- a/pkg/deployment/resources/config_map_gateway.go +++ b/pkg/deployment/resources/config_map_gateway.go @@ -135,7 +135,7 @@ func (r *Resources) renderGatewayConfig(cachedStatus inspectorInterface.Inspecto cfg.IntegrationSidecar = &gateway.ConfigDestinationTarget{ Host: "127.0.0.1", - Port: int32(r.context.GetSpec().Gateway.GetSidecar().GetListenPort()), + Port: int32(r.context.GetSpec().Integration.GetSidecar().GetListenPort()), } cfg.DefaultDestination = gateway.ConfigDestination{ diff --git a/pkg/deployment/resources/pod_creator_gateway_pod.go b/pkg/deployment/resources/pod_creator_gateway_pod.go index 16d14c89d..620d3d2c8 100644 --- a/pkg/deployment/resources/pod_creator_gateway_pod.go +++ b/pkg/deployment/resources/pod_creator_gateway_pod.go @@ -238,7 +238,13 @@ func (m *MemberGatewayPod) Labels() map[string]string { func (m *MemberGatewayPod) Profiles() (schedulerApi.ProfileTemplates, error) { integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ Image: util.NewType(m.resources.context.GetOperatorImage()), - }, m.spec.Gateway.GetSidecar(), []string{shared.ServerContainerName}, + }, m.spec.Integration.GetSidecar()) + + if err != nil { + return nil, err + } + + integrations, err := sidecar.NewIntegrationEnablement( sidecar.IntegrationEnvoyV3{ Spec: m.spec, }, sidecar.IntegrationAuthenticationV1{ @@ -250,5 +256,7 @@ func (m *MemberGatewayPod) Profiles() (schedulerApi.ProfileTemplates, error) { return nil, err } - return []*schedulerApi.ProfileTemplate{integration}, nil + shutdownAnnotation := sidecar.NewShutdownAnnotations([]string{shared.ServerContainerName}) + + return []*schedulerApi.ProfileTemplate{integration, integrations, shutdownAnnotation}, nil } diff --git a/pkg/integrations/authentication_v1.go b/pkg/integrations/authentication_v1.go index 60bc77afa..0c50e7cc3 100644 --- a/pkg/integrations/authentication_v1.go +++ b/pkg/integrations/authentication_v1.go @@ -27,6 +27,7 @@ import ( pbImplAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1" pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) @@ -40,20 +41,18 @@ type authenticationV1 struct { config pbImplAuthenticationV1.Configuration } -func (a *authenticationV1) Register(cmd *cobra.Command, arg ArgGen) error { - f := cmd.Flags() - - f.StringVar(&a.config.Path, arg("path"), "", "Path to the JWT Folder") - f.BoolVar(&a.config.Enabled, arg("enabled"), true, "Defines if Authentication is enabled") - f.DurationVar(&a.config.TTL, arg("ttl"), pbImplAuthenticationV1.DefaultTTL, "TTL of the JWT cache") - f.StringVar(&a.config.Create.DefaultUser, arg("token.user"), pbImplAuthenticationV1.DefaultUser, "Default user of the Token") - f.DurationVar(&a.config.Create.DefaultTTL, arg("token.ttl.default"), pbImplAuthenticationV1.DefaultTokenDefaultTTL, "Default Token TTL") - f.DurationVar(&a.config.Create.MinTTL, arg("token.ttl.min"), pbImplAuthenticationV1.DefaultTokenMinTTL, "Min Token TTL") - f.DurationVar(&a.config.Create.MaxTTL, arg("token.ttl.max"), pbImplAuthenticationV1.DefaultTokenMaxTTL, "Max Token TTL") - f.Uint16Var(&a.config.Create.MaxSize, arg("token.max-size"), pbImplAuthenticationV1.DefaultMaxTokenSize, "Max Token max size in bytes") - f.StringSliceVar(&a.config.Create.AllowedUsers, arg("token.allowed"), []string{}, "Allowed users for the Token") - - return nil +func (a *authenticationV1) Register(cmd *cobra.Command, fs FlagEnvHandler) error { + return errors.Errors( + fs.StringVar(&a.config.Path, "path", "", "Path to the JWT Folder"), + fs.BoolVar(&a.config.Enabled, "enabled", true, "Defines if Authentication is enabled"), + fs.DurationVar(&a.config.TTL, "ttl", pbImplAuthenticationV1.DefaultTTL, "TTL of the JWT cache"), + fs.StringVar(&a.config.Create.DefaultUser, "token.user", pbImplAuthenticationV1.DefaultUser, "Default user of the Token"), + fs.DurationVar(&a.config.Create.DefaultTTL, "token.ttl.default", pbImplAuthenticationV1.DefaultTokenDefaultTTL, "Default Token TTL"), + fs.DurationVar(&a.config.Create.MinTTL, "token.ttl.min", pbImplAuthenticationV1.DefaultTokenMinTTL, "Min Token TTL"), + fs.DurationVar(&a.config.Create.MaxTTL, "token.ttl.max", pbImplAuthenticationV1.DefaultTokenMaxTTL, "Max Token TTL"), + fs.Uint16Var(&a.config.Create.MaxSize, "token.max-size", pbImplAuthenticationV1.DefaultMaxTokenSize, "Max Token max size in bytes"), + fs.StringSliceVar(&a.config.Create.AllowedUsers, "token.allowed", []string{}, "Allowed users for the Token"), + ) } func (a *authenticationV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { diff --git a/pkg/integrations/authorization_v0.go b/pkg/integrations/authorization_v0.go index fd001d687..61cabd25d 100644 --- a/pkg/integrations/authorization_v0.go +++ b/pkg/integrations/authorization_v0.go @@ -47,7 +47,7 @@ func (a authorizationV0) Description() string { return "Enable AuthorizationV0 Integration Service" } -func (a authorizationV0) Register(cmd *cobra.Command, arg ArgGen) error { +func (a authorizationV0) Register(cmd *cobra.Command, fs FlagEnvHandler) error { return nil } diff --git a/pkg/integrations/config_v1.go b/pkg/integrations/config_v1.go index d0ff5faeb..3f2e7af07 100644 --- a/pkg/integrations/config_v1.go +++ b/pkg/integrations/config_v1.go @@ -41,12 +41,10 @@ type configV1 struct { modules []string } -func (a *configV1) Register(cmd *cobra.Command, arg ArgGen) error { - f := cmd.Flags() - - f.StringSliceVar(&a.modules, arg("module"), nil, "Module in the reference =") - - return nil +func (a *configV1) Register(cmd *cobra.Command, fs FlagEnvHandler) error { + return errors.Errors( + fs.StringSliceVar(&a.modules, "module", nil, "Module in the reference ="), + ) } func (a *configV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { diff --git a/pkg/integrations/envoy_auth_v3.go b/pkg/integrations/envoy_auth_v3.go index c8cb55808..4fbdcfff6 100644 --- a/pkg/integrations/envoy_auth_v3.go +++ b/pkg/integrations/envoy_auth_v3.go @@ -48,7 +48,7 @@ func (a *envoyAuthV3) Description() string { return "Enable EnvoyAuthV3 Integration Service" } -func (a *envoyAuthV3) Register(cmd *cobra.Command, arg ArgGen) error { +func (a *envoyAuthV3) Register(cmd *cobra.Command, fs FlagEnvHandler) error { return nil } diff --git a/pkg/integrations/flags.go b/pkg/integrations/flags.go new file mode 100644 index 000000000..1c4599c72 --- /dev/null +++ b/pkg/integrations/flags.go @@ -0,0 +1,243 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "fmt" + "os" + "reflect" + "strconv" + "strings" + "time" + + flag "github.com/spf13/pflag" + + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" +) + +func NewFlagEnvHandler(fs *flag.FlagSet) FlagEnvHandler { + return flagEnvHandler{ + fs: fs, + } +} + +type FlagEnvHandler interface { + WithPrefix(prefix string) FlagEnvHandler + + StringVar(p *string, name string, value string, usage string) error + String(name string, value string, usage string) error + + StringSliceVar(p *[]string, name string, value []string, usage string) error + StringSlice(name string, value []string, usage string) error + + BoolVar(p *bool, name string, value bool, usage string) error + Bool(name string, value bool, usage string) error + + Uint16Var(p *uint16, name string, value uint16, usage string) error + Uint16(name string, value uint16, usage string) error + + DurationVar(p *time.Duration, name string, value time.Duration, usage string) error + Duration(name string, value time.Duration, usage string) error +} + +type flagEnvHandler struct { + prefix string + fs *flag.FlagSet +} + +func (f flagEnvHandler) StringVar(p *string, name string, value string, usage string) error { + v, err := parseEnvToString(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.StringVar(p, f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) String(name string, value string, usage string) error { + v, err := parseEnvToString(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.String(f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) StringSliceVar(p *[]string, name string, value []string, usage string) error { + v, err := parseEnvToStringArray(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.StringSliceVar(p, f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) StringSlice(name string, value []string, usage string) error { + v, err := parseEnvToStringArray(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.StringSlice(f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) BoolVar(p *bool, name string, value bool, usage string) error { + v, err := parseEnvToBool(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.BoolVar(p, f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) Bool(name string, value bool, usage string) error { + v, err := parseEnvToBool(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.Bool(f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) DurationVar(p *time.Duration, name string, value time.Duration, usage string) error { + v, err := parseEnvToDuration(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.DurationVar(p, f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) Duration(name string, value time.Duration, usage string) error { + v, err := parseEnvToDuration(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.Duration(f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) Uint16Var(p *uint16, name string, value uint16, usage string) error { + v, err := parseEnvToUint16(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.Uint16Var(p, f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) Uint16(name string, value uint16, usage string) error { + v, err := parseEnvToUint16(f.getEnv(name), value) + if err != nil { + return err + } + + f.fs.Uint16(f.name(name), v, f.varDesc(name, usage)) + + return nil +} + +func (f flagEnvHandler) varDesc(name string, dest string) string { + return fmt.Sprintf("%s (Env: %s)", dest, f.getEnv(name)) +} + +func (f flagEnvHandler) getEnv(n string) string { + z := f.name(n) + + z = strings.ReplaceAll(z, ".", "_") + z = strings.ReplaceAll(z, "-", "_") + + return strings.ToUpper(z) +} +func (f flagEnvHandler) name(n string) string { + if f.prefix == "" { + return n + } + if n == "" { + return f.prefix + } + return fmt.Sprintf("%s.%s", f.prefix, n) +} + +func (f flagEnvHandler) WithPrefix(prefix string) FlagEnvHandler { + return flagEnvHandler{ + prefix: f.name(prefix), + fs: f.fs, + } +} + +func parseEnvToDuration(env string, def time.Duration) (time.Duration, error) { + return parseEnvToType(env, def, time.ParseDuration) +} + +func parseEnvToUint16(env string, def uint16) (uint16, error) { + return parseEnvToType(env, def, func(in string) (uint16, error) { + v, err := strconv.ParseUint(in, 10, 16) + return uint16(v), err + }) +} + +func parseEnvToBool(env string, def bool) (bool, error) { + return parseEnvToType(env, def, strconv.ParseBool) +} + +func parseEnvToStringArray(env string, def []string) ([]string, error) { + return parseEnvToType(env, def, func(in string) ([]string, error) { + return strings.Split(in, ","), nil + }) +} + +func parseEnvToString(env string, def string) (string, error) { + return parseEnvToType(env, def, func(in string) (string, error) { + return in, nil + }) +} + +func parseEnvToType[T any](env string, def T, parser func(in string) (T, error)) (T, error) { + if v, ok := os.LookupEnv(env); ok { + if q, err := parser(v); err != nil { + return util.Default[T](), errors.Wrapf(err, "Unable to parse env `%s` as %s", env, reflect.TypeOf(def).String()) + } else { + return q, nil + } + } + + return def, nil +} diff --git a/pkg/integrations/integration.go b/pkg/integrations/integration.go index d896c7f00..9e756c22c 100644 --- a/pkg/integrations/integration.go +++ b/pkg/integrations/integration.go @@ -30,13 +30,11 @@ import ( type Factory func() Integration -type ArgGen func(name string) string - type Integration interface { Name() string Description() string - Register(cmd *cobra.Command, arg ArgGen) error + Register(cmd *cobra.Command, fs FlagEnvHandler) error Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) } diff --git a/pkg/integrations/register.go b/pkg/integrations/register.go index d20a8b0d8..c5d0ae7ec 100644 --- a/pkg/integrations/register.go +++ b/pkg/integrations/register.go @@ -125,37 +125,44 @@ func (c *configuration) Register(cmd *cobra.Command) error { cmd.RunE = c.run - f := cmd.Flags() - - f.StringVar(&c.health.address, "health.address", "0.0.0.0:9091", "Address to expose health service") - f.BoolVar(&c.health.shutdownEnabled, "health.shutdown.enabled", true, "Determines if shutdown service should be enabled and exposed") - f.StringVar(&c.health.auth.t, "health.auth.type", "None", "Auth type for health service") - f.StringVar(&c.health.auth.token, "health.auth.token", "", "Token for health service (when auth service is token)") - f.StringVar(&c.health.tls.keyfile, "health.tls.keyfile", "", "Path to the keyfile") - - f.BoolVar(&c.services.internal.enabled, "services.enabled", true, "Defines if internal access is enabled") - f.StringVar(&c.services.internal.address, "services.address", "127.0.0.1:9092", "Address to expose internal services") - f.StringVar(&c.services.internal.auth.t, "services.auth.type", "None", "Auth type for internal service") - f.StringVar(&c.services.internal.auth.token, "services.auth.token", "", "Token for internal service (when auth service is token)") - f.StringVar(&c.services.internal.tls.keyfile, "services.tls.keyfile", "", "Path to the keyfile") - - f.BoolVar(&c.services.external.enabled, "services.external.enabled", false, "Defines if external access is enabled") - f.StringVar(&c.services.external.address, "services.external.address", "0.0.0.0:9093", "Address to expose external services") - f.StringVar(&c.services.external.auth.t, "services.external.auth.type", "None", "Auth type for external service") - f.StringVar(&c.services.external.auth.token, "services.external.auth.token", "", "Token for external service (when auth service is token)") - f.StringVar(&c.services.external.tls.keyfile, "services.external.tls.keyfile", "", "Path to the keyfile") - + f := NewFlagEnvHandler(cmd.Flags()) + + if err := errors.Errors( + f.StringVar(&c.health.address, "health.address", "0.0.0.0:9091", "Address to expose health service"), + f.BoolVar(&c.health.shutdownEnabled, "health.shutdown.enabled", true, "Determines if shutdown service should be enabled and exposed"), + f.StringVar(&c.health.auth.t, "health.auth.type", "None", "Auth type for health service"), + f.StringVar(&c.health.auth.token, "health.auth.token", "", "Token for health service (when auth service is token)"), + f.StringVar(&c.health.tls.keyfile, "health.tls.keyfile", "", "Path to the keyfile"), + + f.BoolVar(&c.services.internal.enabled, "services.enabled", true, "Defines if internal access is enabled"), + f.StringVar(&c.services.internal.address, "services.address", "127.0.0.1:9092", "Address to expose internal services"), + f.StringVar(&c.services.internal.auth.t, "services.auth.type", "None", "Auth type for internal service"), + f.StringVar(&c.services.internal.auth.token, "services.auth.token", "", "Token for internal service (when auth service is token)"), + f.StringVar(&c.services.internal.tls.keyfile, "services.tls.keyfile", "", "Path to the keyfile"), + + f.BoolVar(&c.services.external.enabled, "services.external.enabled", false, "Defines if external access is enabled"), + f.StringVar(&c.services.external.address, "services.external.address", "0.0.0.0:9093", "Address to expose external services"), + f.StringVar(&c.services.external.auth.t, "services.external.auth.type", "None", "Auth type for external service"), + f.StringVar(&c.services.external.auth.token, "services.external.auth.token", "", "Token for external service (when auth service is token)"), + f.StringVar(&c.services.external.tls.keyfile, "services.external.tls.keyfile", "", "Path to the keyfile"), + ); err != nil { + return err + } for _, service := range c.registered { prefix := fmt.Sprintf("integration.%s", service.Name()) - f.Bool(prefix, false, service.Description()) + fs := f.WithPrefix(prefix) internal, external := GetIntegrationEnablement(service) - f.Bool(fmt.Sprintf("%s.internal", prefix), internal, fmt.Sprintf("Defones if Internal access to service %s is enabled", service.Name())) - f.Bool(fmt.Sprintf("%s.external", prefix), external, fmt.Sprintf("Defones if External access to service %s is enabled", service.Name())) - if err := service.Register(cmd, func(name string) string { - return fmt.Sprintf("%s.%s", prefix, name) - }); err != nil { + if err := errors.Errors( + fs.Bool("", false, service.Description()), + fs.Bool("internal", internal, fmt.Sprintf("Defones if Internal access to service %s is enabled", service.Name())), + fs.Bool("external", external, fmt.Sprintf("Defones if External access to service %s is enabled", service.Name())), + ); err != nil { + return err + } + + if err := service.Register(cmd, fs); err != nil { return errors.Wrapf(err, "Unable to register service %s", service.Name()) } } diff --git a/pkg/integrations/scheduler_v1.go b/pkg/integrations/scheduler_v1.go index ad84aec7f..c7f53ebe2 100644 --- a/pkg/integrations/scheduler_v1.go +++ b/pkg/integrations/scheduler_v1.go @@ -50,13 +50,11 @@ func (b *schedulerV1) Description() string { return "SchedulerV1 Integration" } -func (b *schedulerV1) Register(cmd *cobra.Command, arg ArgGen) error { - f := cmd.Flags() - - f.StringVar(&b.Configuration.Namespace, arg("namespace"), constants.NamespaceWithDefault("default"), "Kubernetes Namespace") - f.BoolVar(&b.Configuration.VerifyAccess, arg("verify-access"), true, "Verify the CRD Access") - - return nil +func (b *schedulerV1) Register(cmd *cobra.Command, fs FlagEnvHandler) error { + return errors.Errors( + fs.StringVar(&b.Configuration.Namespace, "namespace", constants.NamespaceWithDefault("default"), "Kubernetes Namespace"), + fs.BoolVar(&b.Configuration.VerifyAccess, "verify-access", true, "Verify the CRD Access"), + ) } func (b *schedulerV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { diff --git a/pkg/integrations/shutdown_v1.go b/pkg/integrations/shutdown_v1.go index 93c4c4a9c..e93366950 100644 --- a/pkg/integrations/shutdown_v1.go +++ b/pkg/integrations/shutdown_v1.go @@ -52,7 +52,7 @@ func (s *shutdownV1) Description() string { return "ShutdownV1 Handler" } -func (s *shutdownV1) Register(cmd *cobra.Command, arg ArgGen) error { +func (s *shutdownV1) Register(cmd *cobra.Command, fs FlagEnvHandler) error { return nil } diff --git a/pkg/integrations/sidecar/core.go b/pkg/integrations/sidecar/core.go index a79132cf2..93602b548 100644 --- a/pkg/integrations/sidecar/core.go +++ b/pkg/integrations/sidecar/core.go @@ -24,8 +24,9 @@ import ( "fmt" "strings" + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) type Core struct { @@ -49,14 +50,22 @@ func (c *Core) GetExternal() bool { return *c.External } -func (c *Core) Args(int Integration) k8sutil.OptionPairs { - var options k8sutil.OptionPairs +func (c *Core) Envs(int Integration, envs ...core.EnvVar) []core.EnvVar { cmd := strings.Join(util.FormatList(int.Name(), func(a string) string { - return strings.ToLower(a) - }), ".") + return strings.ToUpper(a) + }), "_") + var r = []core.EnvVar{ + { + Name: fmt.Sprintf("INTEGRATION_%s_INTERNAL", cmd), + Value: util.BoolSwitch(c.GetInternal(), "true", "false"), + }, + { + Name: fmt.Sprintf("INTEGRATION_%s_EXTERNAL", cmd), + Value: util.BoolSwitch(c.GetExternal(), "true", "false"), + }, + } - options.Add(fmt.Sprintf("--integration.%s.internal", cmd), c.GetInternal()) - options.Add(fmt.Sprintf("--integration.%s.external", cmd), c.GetExternal()) + r = append(r, envs...) - return options + return r } diff --git a/pkg/integrations/sidecar/integration.authentication.v1.go b/pkg/integrations/sidecar/integration.authentication.v1.go index 9504877df..8273424db 100644 --- a/pkg/integrations/sidecar/integration.authentication.v1.go +++ b/pkg/integrations/sidecar/integration.authentication.v1.go @@ -26,11 +26,9 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util" ) -var _ IntegrationVolumes = IntegrationAuthenticationV1{} - type IntegrationAuthenticationV1 struct { Core *Core @@ -46,16 +44,27 @@ func (i IntegrationAuthenticationV1) Validate() error { return nil } -func (i IntegrationAuthenticationV1) Args() (k8sutil.OptionPairs, error) { - options := k8sutil.CreateOptionPairs() - - options.Add("--integration.authentication.v1", true) - options.Add("--integration.authentication.v1.enabled", i.Spec.IsAuthenticated()) - options.Add("--integration.authentication.v1.path", shared.ClusterJWTSecretVolumeMountDir) +func (i IntegrationAuthenticationV1) Envs() ([]core.EnvVar, error) { + var envs = []core.EnvVar{ + { + Name: "INTEGRATION_AUTHENTICATION_V1", + Value: "true", + }, + { + Name: "INTEGRATION_AUTHENTICATION_V1_ENABLED", + Value: util.BoolSwitch(i.Spec.IsAuthenticated(), "true", "false"), + }, + { + Name: "INTEGRATION_AUTHENTICATION_V1_PATH", + Value: shared.ClusterJWTSecretVolumeMountDir, + }, + } - options.Merge(i.Core.Args(i)) + return i.Core.Envs(i, envs...), nil +} - return options, nil +func (i IntegrationAuthenticationV1) GlobalEnvs() ([]core.EnvVar, error) { + return nil, nil } func (i IntegrationAuthenticationV1) Volumes() ([]core.Volume, []core.VolumeMount, error) { diff --git a/pkg/integrations/sidecar/integration.authorization.v1.go b/pkg/integrations/sidecar/integration.authorization.v0.go similarity index 68% rename from pkg/integrations/sidecar/integration.authorization.v1.go rename to pkg/integrations/sidecar/integration.authorization.v0.go index a94653e7f..6a4781e7d 100644 --- a/pkg/integrations/sidecar/integration.authorization.v1.go +++ b/pkg/integrations/sidecar/integration.authorization.v0.go @@ -21,7 +21,7 @@ package sidecar import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + core "k8s.io/api/core/v1" ) type IntegrationAuthorizationV0 struct { @@ -36,12 +36,21 @@ func (i IntegrationAuthorizationV0) Validate() error { return nil } -func (i IntegrationAuthorizationV0) Args() (k8sutil.OptionPairs, error) { - options := k8sutil.CreateOptionPairs() +func (i IntegrationAuthorizationV0) Envs() ([]core.EnvVar, error) { + var envs = []core.EnvVar{ + { + Name: "INTEGRATION_AUTHENTICATION_V0", + Value: "true", + }, + } - options.Add("--integration.authorization.v0", true) + return i.Core.Envs(i, envs...), nil +} - options.Merge(i.Core.Args(i)) +func (i IntegrationAuthorizationV0) GlobalEnvs() ([]core.EnvVar, error) { + return nil, nil +} - return options, nil +func (i IntegrationAuthorizationV0) Volumes() ([]core.Volume, []core.VolumeMount, error) { + return nil, nil, nil } diff --git a/pkg/integrations/sidecar/integration.envoy.v3.go b/pkg/integrations/sidecar/integration.envoy.v3.go index e8509eeb7..b53c54db6 100644 --- a/pkg/integrations/sidecar/integration.envoy.v3.go +++ b/pkg/integrations/sidecar/integration.envoy.v3.go @@ -21,8 +21,9 @@ package sidecar import ( + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) type IntegrationEnvoyV3 struct { @@ -38,12 +39,21 @@ func (i IntegrationEnvoyV3) Validate() error { return nil } -func (i IntegrationEnvoyV3) Args() (k8sutil.OptionPairs, error) { - options := k8sutil.CreateOptionPairs() +func (i IntegrationEnvoyV3) Envs() ([]core.EnvVar, error) { + var envs = []core.EnvVar{ + { + Name: "INTEGRATION_ENVOY_AUTH_V3", + Value: "true", + }, + } - options.Add("--integration.envoy.auth.v3", true) + return i.Core.Envs(i, envs...), nil +} - options.Merge(i.Core.Args(i)) +func (i IntegrationEnvoyV3) GlobalEnvs() ([]core.EnvVar, error) { + return nil, nil +} - return options, nil +func (i IntegrationEnvoyV3) Volumes() ([]core.Volume, []core.VolumeMount, error) { + return nil, nil, nil } diff --git a/pkg/integrations/sidecar/integration.go b/pkg/integrations/sidecar/integration.go index 87fab7558..28a040cea 100644 --- a/pkg/integrations/sidecar/integration.go +++ b/pkg/integrations/sidecar/integration.go @@ -29,47 +29,93 @@ const ( ListenPortHealthName = "health" ) -func WithIntegrationEnvs(in Integration) ([]core.EnvVar, error) { - if v, ok := in.(IntegrationEnvs); ok { - return v.Envs() - } - - return nil, nil -} - -type IntegrationEnvs interface { - Integration +type Integration interface { + Name() []string Envs() ([]core.EnvVar, error) + GlobalEnvs() ([]core.EnvVar, error) + Volumes() ([]core.Volume, []core.VolumeMount, error) + Validate() error } -func WithIntegrationVolumes(in Integration) ([]core.Volume, []core.VolumeMount, error) { - if v, ok := in.(IntegrationVolumes); ok { - return v.Volumes() +func NewShutdownAnnotations(coreContainers []string) *schedulerApi.ProfileTemplate { + pt := schedulerApi.ProfileTemplate{ + Pod: &schedulerPodApi.Pod{ + Metadata: &schedulerPodResourcesApi.Metadata{ + Annotations: map[string]string{}, + }, + }, } - return nil, nil, nil -} + for _, container := range coreContainers { + pt.Pod.Metadata.Annotations[fmt.Sprintf("%s/%s", constants.AnnotationShutdownCoreContainer, container)] = constants.AnnotationShutdownCoreContainerModeWait + } -type IntegrationVolumes interface { - Integration - Volumes() ([]core.Volume, []core.VolumeMount, error) + return &pt } -type Integration interface { - Name() []string - Args() (k8sutil.OptionPairs, error) - Validate() error -} +func NewIntegrationEnablement(integrations ...Integration) (*schedulerApi.ProfileTemplate, error) { + var envs, gEnvs []core.EnvVar + var volumes []core.Volume + var volumeMounts []core.VolumeMount -func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *schedulerIntegrationApi.Sidecar, coreContainers []string, integrations ...Integration) (*schedulerApi.ProfileTemplate, error) { for _, integration := range integrations { - if err := integration.Validate(); err != nil { - name := strings.Join(integration.Name(), "/") + name := strings.Join(integration.Name(), "/") + if err := integration.Validate(); err != nil { return nil, errors.Wrapf(err, "Failure in %s", name) } + + if lvolumes, lvolumeMounts, err := integration.Volumes(); err != nil { + return nil, errors.Wrapf(err, "Failure in volumes %s", name) + } else if len(lvolumes) > 0 || len(lvolumeMounts) > 0 { + volumes = append(volumes, lvolumes...) + volumeMounts = append(volumeMounts, lvolumeMounts...) + } + + if lenvs, err := integration.Envs(); err != nil { + return nil, errors.Wrapf(err, "Failure in envs %s", name) + } else if len(lenvs) > 0 { + envs = append(envs, lenvs...) + } + + if lgenvs, err := integration.GlobalEnvs(); err != nil { + return nil, errors.Wrapf(err, "Failure in global envs %s", name) + } else if len(lgenvs) > 0 { + gEnvs = append(gEnvs, lgenvs...) + } + } + + if len(envs) == 0 && len(gEnvs) == 0 { + return nil, nil } + return &schedulerApi.ProfileTemplate{ + Pod: &schedulerPodApi.Pod{ + Volumes: &schedulerPodResourcesApi.Volumes{ + Volumes: volumes, + }, + }, + Container: &schedulerApi.ProfileContainerTemplate{ + Containers: map[string]schedulerContainerApi.Container{ + ContainerName: { + Environments: &schedulerContainerResourcesApi.Environments{ + Env: envs, + }, + VolumeMounts: &schedulerContainerResourcesApi.VolumeMounts{ + VolumeMounts: volumeMounts, + }, + }, + }, + All: &schedulerContainerApi.Generic{ + Environments: &schedulerContainerResourcesApi.Environments{ + Env: gEnvs, + }, + }, + }, + }, nil +} + +func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *schedulerIntegrationApi.Sidecar) (*schedulerApi.ProfileTemplate, error) { // Arguments exePath := k8sutil.BinaryPath() @@ -83,10 +129,6 @@ func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *sc options.Addf("--services.address", "127.0.0.1:%d", integration.GetListenPort()) options.Addf("--health.address", "0.0.0.0:%d", integration.GetControllerListenPort()) - // Volumes - var volumes []core.Volume - var volumeMounts []core.VolumeMount - // Envs var envs = []core.EnvVar{ @@ -100,40 +142,6 @@ func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *sc }, } - for _, i := range integrations { - name := strings.Join(i.Name(), "/") - - if err := i.Validate(); err != nil { - return nil, errors.Wrapf(err, "Failure in %s", name) - } - - if args, err := i.Args(); err != nil { - return nil, errors.Wrapf(err, "Failure in arguments %s", name) - } else if len(args) > 0 { - options.Merge(args) - } - - if lvolumes, lvolumeMounts, err := WithIntegrationVolumes(i); err != nil { - return nil, errors.Wrapf(err, "Failure in volumes %s", name) - } else if len(lvolumes) > 0 || len(lvolumeMounts) > 0 { - volumes = append(volumes, lvolumes...) - volumeMounts = append(volumeMounts, lvolumeMounts...) - } - - if lenvs, err := WithIntegrationEnvs(i); err != nil { - return nil, errors.Wrapf(err, "Failure in envs %s", name) - } else if len(lenvs) > 0 { - envs = append(envs, lenvs...) - } - - envs = append(envs, core.EnvVar{ - Name: fmt.Sprintf("INTEGRATION_SERVICE_%s", strings.Join(util.FormatList(i.Name(), func(a string) string { - return strings.ToUpper(a) - }), "_")), - Value: fmt.Sprintf("127.0.0.1:%d", integration.GetListenPort()), - }) - } - c := schedulerContainerApi.Container{ Core: &schedulerContainerResourcesApi.Core{ Command: append([]string{exePath, "integration"}, options.Sort().AsArgs()...), @@ -175,14 +183,15 @@ func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *sc FailureThreshold: 2, // Need 2 failed probes to consider a failed state }, }, - - VolumeMounts: &schedulerContainerResourcesApi.VolumeMounts{ - VolumeMounts: volumeMounts, - }, } pt := schedulerApi.ProfileTemplate{ Container: &schedulerApi.ProfileContainerTemplate{ + All: &schedulerContainerApi.Generic{ + Environments: &schedulerContainerResourcesApi.Environments{ + Env: envs, + }, + }, Containers: map[string]schedulerContainerApi.Container{ ContainerName: util.TypeOrDefault(k8sutil.CreateDefaultContainerTemplate(image).With(&c).With(integration.GetContainer())), }, @@ -191,24 +200,15 @@ func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *sc Metadata: &schedulerPodResourcesApi.Metadata{ Annotations: map[string]string{}, }, - Volumes: &schedulerPodResourcesApi.Volumes{ - Volumes: volumes, - }, }, } - for _, container := range coreContainers { - pt.Pod.Metadata.Annotations[fmt.Sprintf("%s/%s", constants.AnnotationShutdownCoreContainer, container)] = constants.AnnotationShutdownCoreContainerModeWait - } - pt.Pod.Metadata.Annotations[fmt.Sprintf("%s/%s", constants.AnnotationShutdownContainer, ContainerName)] = ListenPortHealthName pt.Pod.Metadata.Annotations[constants.AnnotationShutdownManagedContainer] = "true" - pt.Container.Containers.ExtendContainers(&schedulerContainerApi.Container{ - Environments: &schedulerContainerResourcesApi.Environments{ - Env: envs, - }, - }, coreContainers...) + pt.Container.All.Environments = &schedulerContainerResourcesApi.Environments{ + Env: envs, + } return &pt, nil } diff --git a/pkg/integrations/sidecar/integration.shutdown.v1.go b/pkg/integrations/sidecar/integration.shutdown.v1.go index c990cf7a7..824579a55 100644 --- a/pkg/integrations/sidecar/integration.shutdown.v1.go +++ b/pkg/integrations/sidecar/integration.shutdown.v1.go @@ -21,7 +21,7 @@ package sidecar import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + core "k8s.io/api/core/v1" ) type IntegrationShutdownV1 struct { @@ -36,12 +36,21 @@ func (i IntegrationShutdownV1) Validate() error { return nil } -func (i IntegrationShutdownV1) Args() (k8sutil.OptionPairs, error) { - options := k8sutil.CreateOptionPairs() +func (i IntegrationShutdownV1) Envs() ([]core.EnvVar, error) { + var envs = []core.EnvVar{ + { + Name: "INTEGRATION_SHUTDOWN_V1", + Value: "true", + }, + } - options.Add("--integration.shutdown.v1", true) + return i.Core.Envs(i, envs...), nil +} - options.Merge(i.Core.Args(i)) +func (i IntegrationShutdownV1) GlobalEnvs() ([]core.EnvVar, error) { + return nil, nil +} - return options, nil +func (i IntegrationShutdownV1) Volumes() ([]core.Volume, []core.VolumeMount, error) { + return nil, nil, nil } diff --git a/pkg/integrations/storage_v1.go b/pkg/integrations/storage_v1.go index 9ca2a1f00..5e78cc66c 100644 --- a/pkg/integrations/storage_v1.go +++ b/pkg/integrations/storage_v1.go @@ -26,6 +26,7 @@ import ( "github.com/spf13/cobra" "github.com/arangodb/kube-arangodb/pkg/ml/storage" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/svc" ) @@ -47,21 +48,19 @@ func (b *storageV1) Description() string { return "StorageBucket Integration" } -func (b *storageV1) Register(cmd *cobra.Command, arg ArgGen) error { - f := cmd.Flags() - - f.StringVar((*string)(&b.Configuration.Type), arg("type"), string(storage.S3), "Type of the Storage Integration") - f.StringVar(&b.Configuration.S3.Endpoint, arg("s3.endpoint"), "", "Endpoint of S3 API implementation") - f.StringVar(&b.Configuration.S3.CACrtFile, arg("s3.ca-crt"), "", "Path to file containing CA certificate to validate endpoint connection") - f.StringVar(&b.Configuration.S3.CAKeyFile, arg("s3.ca-key"), "", "Path to file containing keyfile to validate endpoint connection") - f.BoolVar(&b.Configuration.S3.AllowInsecure, arg("s3.allow-insecure"), false, "If set to true, the Endpoint certificates won't be checked") - f.BoolVar(&b.Configuration.S3.DisableSSL, arg("s3.disable-ssl"), false, "If set to true, the SSL won't be used when connecting to Endpoint") - f.StringVar(&b.Configuration.S3.Region, arg("s3.region"), "", "Region") - f.StringVar(&b.Configuration.S3.BucketName, arg("s3.bucket"), "", "Bucket name") - f.StringVar(&b.Configuration.S3.AccessKeyFile, arg("s3.access-key"), "", "Path to file containing S3 AccessKey") - f.StringVar(&b.Configuration.S3.SecretKeyFile, arg("s3.secret-key"), "", "Path to file containing S3 SecretKey") - - return nil +func (b *storageV1) Register(cmd *cobra.Command, fs FlagEnvHandler) error { + return errors.Errors( + fs.StringVar((*string)(&b.Configuration.Type), "type", string(storage.S3), "Type of the Storage Integration"), + fs.StringVar(&b.Configuration.S3.Endpoint, "s3.endpoint", "", "Endpoint of S3 API implementation"), + fs.StringVar(&b.Configuration.S3.CACrtFile, "s3.ca-crt", "", "Path to file containing CA certificate to validate endpoint connection"), + fs.StringVar(&b.Configuration.S3.CAKeyFile, "s3.ca-key", "", "Path to file containing keyfile to validate endpoint connection"), + fs.BoolVar(&b.Configuration.S3.AllowInsecure, "s3.allow-insecure", false, "If set to true, the Endpoint certificates won't be checked"), + fs.BoolVar(&b.Configuration.S3.DisableSSL, "s3.disable-ssl", false, "If set to true, the SSL won't be used when connecting to Endpoint"), + fs.StringVar(&b.Configuration.S3.Region, "s3.region", "", "Region"), + fs.StringVar(&b.Configuration.S3.BucketName, "s3.bucket", "", "Bucket name"), + fs.StringVar(&b.Configuration.S3.AccessKeyFile, "s3.access-key", "", "Path to file containing S3 AccessKey"), + fs.StringVar(&b.Configuration.S3.SecretKeyFile, "s3.secret-key", "", "Path to file containing S3 SecretKey"), + ) } func (b *storageV1) Handler(ctx context.Context, cmd *cobra.Command) (svc.Handler, error) { From 9255fdeb56e8f2068fe4bde991f9c5fc1d0dc355 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:46:21 +0200 Subject: [PATCH 37/50] Bump send and express in /dashboard (#1725) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dashboard/package-lock.json | 275 +++++++++++++++++++----------------- 1 file changed, 146 insertions(+), 129 deletions(-) diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index a43d75a70..f5d5a5edd 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -6752,9 +6752,9 @@ } }, "express": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", - "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dev": true, "requires": { "accepts": "~1.3.8", @@ -6769,7 +6769,7 @@ "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", @@ -6778,11 +6778,11 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", - "serve-static": "1.16.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -6796,6 +6796,19 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "dev": true }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -6811,110 +6824,83 @@ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true }, - "merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, + "object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true + }, "path-to-regexp": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true }, + "qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "requires": { + "side-channel": "^1.0.6" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, - "send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "dependencies": { - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } - } - }, - "serve-static": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", - "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "dependencies": { - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - } - } + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" } } } @@ -7056,38 +7042,6 @@ "integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==", "dev": true }, - "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, "find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", @@ -10469,6 +10423,12 @@ "fs-monkey": "^1.0.3" } }, + "merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -12110,15 +12070,6 @@ "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", "dev": true }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - }, "querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -13572,6 +13523,52 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, + "send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + } + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -13649,6 +13646,26 @@ } } }, + "serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dev": true, + "requires": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "dependencies": { + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true + } + } + }, "set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", From 706f9579cd2493b27db9390bfd9b90a45eef3058 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:43:51 +0200 Subject: [PATCH 38/50] [Feature] [Networking] Endpoints Destination (#1726) --- CHANGELOG.md | 1 + docs/api/ArangoRoute.V1Alpha1.md | 76 ++- .../v1alpha1/route_spec_destination.go | 13 + .../route_spec_destination_authentication.go | 10 +- .../route_spec_destination_endpoint.go | 59 ++ .../route_spec_destination_service.go | 1 - .../v1alpha1/route_status_target.go | 5 +- .../v1alpha1/route_status_target_type.go | 34 + .../v1alpha1/zz_generated.deepcopy.go | 31 + pkg/apis/shared/validate.go | 107 ++++ pkg/apis/shared/validate_test.go | 38 ++ .../networking-route.schema.generated.yaml | 29 + pkg/deployment/cleanup.go | 6 +- pkg/deployment/context_impl.go | 2 +- pkg/deployment/deployment_finalizers.go | 39 +- pkg/deployment/resources/pod_finalizers.go | 4 +- pkg/deployment/resources/pod_inspector.go | 2 +- pkg/deployment/resources/pvc_finalizers.go | 2 +- pkg/deployment/resources/pvc_inspector.go | 2 +- pkg/handlers/networking/route/handler.go | 2 +- .../networking/route/handler_destination.go | 145 +---- .../route/handler_destination_endpoints.go | 180 ++++++ .../handler_destination_endpoints_test.go | 330 ++++++++++ .../route/handler_destination_service.go | 175 +++++ .../route/handler_destination_service_test.go | 598 ++++++++++++++++++ .../route/handler_destination_test.go | 507 +-------------- pkg/replication/finalizers.go | 30 +- pkg/util/k8sutil/finalizers.go | 78 +-- pkg/util/k8sutil/patcher/common.go | 35 + pkg/util/k8sutil/patcher/patcher.go | 3 +- pkg/util/list.go | 16 + pkg/util/tests/kubernetes.go | 44 ++ pkg/util/tests/kubernetes_test.go | 1 + 33 files changed, 1820 insertions(+), 785 deletions(-) create mode 100644 pkg/apis/networking/v1alpha1/route_spec_destination_endpoint.go create mode 100644 pkg/apis/networking/v1alpha1/route_status_target_type.go create mode 100644 pkg/handlers/networking/route/handler_destination_endpoints.go create mode 100644 pkg/handlers/networking/route/handler_destination_endpoints_test.go create mode 100644 pkg/handlers/networking/route/handler_destination_service.go create mode 100644 pkg/handlers/networking/route/handler_destination_service_test.go create mode 100644 pkg/util/k8sutil/patcher/common.go diff --git a/CHANGELOG.md b/CHANGELOG.md index ae68b18c4..b0fbe048c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - (Feature) (Scheduler) Add Status Conditions - (Bugfix) Versioning Alignment - (Feature) (Scheduler) Merge Strategy +- (Feature) (Networking) Endpoints Destination ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/docs/api/ArangoRoute.V1Alpha1.md b/docs/api/ArangoRoute.V1Alpha1.md index 2dc3b2302..fea374ee0 100644 --- a/docs/api/ArangoRoute.V1Alpha1.md +++ b/docs/api/ArangoRoute.V1Alpha1.md @@ -18,19 +18,72 @@ Deployment specifies the ArangoDeployment object name ### .spec.destination.authentication.passMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L28) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L32) + +PassMode define authorization details pass mode when authorization was successful + +Possible Values: +* `"override"` (default) - Generates new token for the user +* `"pass"` - Pass token provided by the user +* `"remove"` - Removes authorization details from the request *** ### .spec.destination.authentication.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L29) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L37) + +Type of the authentication + +Possible Values: +* `"optional"` (default) - Authentication is header is validated and passed to the service. In case if is unauthorized, requests is still passed +* `"required"` - Authentication is header is validated and passed to the service. In case if is unauthorized, returns 403 + +*** + +### .spec.destination.endpoints.checksum + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) + +UID keeps the information about object Checksum + +*** + +### .spec.destination.endpoints.name + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) + +Name of the object + +*** + +### .spec.destination.endpoints.namespace + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) + +Namespace of the object. Should default to the namespace of the parent object + +*** + +### .spec.destination.endpoints.port + +Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_endpoint.go#L36) + +Port defines Port or Port Name used as destination + +*** + +### .spec.destination.endpoints.uid + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) + +UID keeps the information about object UID *** ### .spec.destination.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L36) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L39) Path defines service path used for overrides @@ -38,7 +91,7 @@ Path defines service path used for overrides ### .spec.destination.schema -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L30) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L33) Schema defines HTTP/S schema used for connection @@ -70,13 +123,10 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.destination.service.port -Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_service.go#L36) +Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_service.go#L35) Port defines Port or Port Name used as destination -Links: -* [Documentation](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) - *** ### .spec.destination.service.uid @@ -169,7 +219,7 @@ Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. ### .status.target.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L40) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L43) Path specifies request path override @@ -181,3 +231,11 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. Insecure allows Insecure traffic +*** + +### .status.target.type + +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L34) + +Type define destination type + diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination.go b/pkg/apis/networking/v1alpha1/route_spec_destination.go index 055fd6cbf..1dfa0ab75 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination.go @@ -26,6 +26,9 @@ type ArangoRouteSpecDestination struct { // Service defines service upstream reference Service *ArangoRouteSpecDestinationService `json:"service,omitempty"` + // Endpoints defines service upstream reference - which is used to find endpoints + Endpoints *ArangoRouteSpecDestinationEndpoints `json:"endpoints,omitempty"` + // Schema defines HTTP/S schema used for connection Schema *ArangoRouteSpecDestinationSchema `json:"schema,omitempty"` @@ -47,6 +50,14 @@ func (a *ArangoRouteSpecDestination) GetService() *ArangoRouteSpecDestinationSer return a.Service } +func (a *ArangoRouteSpecDestination) GetEndpoints() *ArangoRouteSpecDestinationEndpoints { + if a == nil || a.Endpoints == nil { + return nil + } + + return a.Endpoints +} + func (a *ArangoRouteSpecDestination) GetSchema() *ArangoRouteSpecDestinationSchema { if a == nil || a.Schema == nil { return nil @@ -85,7 +96,9 @@ func (a *ArangoRouteSpecDestination) Validate() error { } if err := shared.WithErrors( + shared.ValidateExclusiveFields(a, 1, "Service", "Endpoints"), shared.ValidateOptionalInterfacePath("service", a.Service), + shared.ValidateOptionalInterfacePath("endpoints", a.Endpoints), shared.ValidateOptionalInterfacePath("schema", a.Schema), shared.ValidateOptionalInterfacePath("tls", a.TLS), shared.ValidateOptionalInterfacePath("authentication", a.Authentication), diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go b/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go index 9ef89aba8..00ac298df 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go @@ -25,8 +25,16 @@ import ( ) type ArangoRouteSpecDestinationAuthentication struct { + // PassMode define authorization details pass mode when authorization was successful + // +doc/enum: override|Generates new token for the user + // +doc/enum: pass|Pass token provided by the user + // +doc/enum: remove|Removes authorization details from the request PassMode *ArangoRouteSpecAuthenticationPassMode `json:"passMode,omitempty"` - Type *ArangoRouteSpecAuthenticationType `json:"type,omitempty"` + + // Type of the authentication + // +doc/enum: optional|Authentication is header is validated and passed to the service. In case if is unauthorized, requests is still passed + // +doc/enum: required|Authentication is header is validated and passed to the service. In case if is unauthorized, returns 403 + Type *ArangoRouteSpecAuthenticationType `json:"type,omitempty"` } func (a *ArangoRouteSpecDestinationAuthentication) GetType() ArangoRouteSpecAuthenticationType { diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_endpoint.go b/pkg/apis/networking/v1alpha1/route_spec_destination_endpoint.go new file mode 100644 index 000000000..bd7d9e147 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_endpoint.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/util/intstr" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" +) + +type ArangoRouteSpecDestinationEndpoints struct { + // Keeps information on the service, which maps then to the endpoints + *sharedApi.Object `json:",inline,omitempty"` + + // Port defines Port or Port Name used as destination + // +doc/type: intstr.IntOrString + Port *intstr.IntOrString `json:"port,omitempty"` +} + +func (a *ArangoRouteSpecDestinationEndpoints) GetPort() *intstr.IntOrString { + if a == nil || a.Port == nil { + return nil + } + + return a.Port +} + +func (a *ArangoRouteSpecDestinationEndpoints) Validate() error { + if a == nil { + a = &ArangoRouteSpecDestinationEndpoints{} + } + + if err := shared.WithErrors(a.Object.Validate(), shared.ValidateRequiredPath("port", a.Port, func(i intstr.IntOrString) error { + return nil + })); err != nil { + return err + } + + return nil +} diff --git a/pkg/apis/networking/v1alpha1/route_spec_destination_service.go b/pkg/apis/networking/v1alpha1/route_spec_destination_service.go index 9b2c0d9f4..e44a4cbbd 100644 --- a/pkg/apis/networking/v1alpha1/route_spec_destination_service.go +++ b/pkg/apis/networking/v1alpha1/route_spec_destination_service.go @@ -32,7 +32,6 @@ type ArangoRouteSpecDestinationService struct { // Port defines Port or Port Name used as destination // +doc/type: intstr.IntOrString - // +doc/link: Documentation|https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ Port *intstr.IntOrString `json:"port,omitempty"` } diff --git a/pkg/apis/networking/v1alpha1/route_status_target.go b/pkg/apis/networking/v1alpha1/route_status_target.go index 26d67b1d3..8ec626b07 100644 --- a/pkg/apis/networking/v1alpha1/route_status_target.go +++ b/pkg/apis/networking/v1alpha1/route_status_target.go @@ -30,6 +30,9 @@ type ArangoRouteStatusTarget struct { // Destinations keeps target destinations Destinations ArangoRouteStatusTargetDestinations `json:"destinations,omitempty"` + // Type define destination type + Type ArangoRouteStatusTargetType `json:"type,omitempty"` + // TLS Keeps target TLS Settings (if not nil, TLS is enabled) TLS *ArangoRouteStatusTargetTLS `json:"TLS,omitempty"` @@ -64,5 +67,5 @@ func (a *ArangoRouteStatusTarget) Hash() string { if a == nil { return "" } - return util.SHA256FromStringArray(a.Destinations.Hash(), a.TLS.Hash(), a.Path, a.Authentication.Hash()) + return util.SHA256FromStringArray(a.Destinations.Hash(), a.Type.Hash(), a.TLS.Hash(), a.Path, a.Authentication.Hash()) } diff --git a/pkg/apis/networking/v1alpha1/route_status_target_type.go b/pkg/apis/networking/v1alpha1/route_status_target_type.go new file mode 100644 index 000000000..d88340012 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/route_status_target_type.go @@ -0,0 +1,34 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1alpha1 + +import "github.com/arangodb/kube-arangodb/pkg/util" + +type ArangoRouteStatusTargetType string + +func (a ArangoRouteStatusTargetType) Hash() string { + return util.SHA256FromString(string(a)) +} + +const ( + ArangoRouteStatusTargetServiceType ArangoRouteStatusTargetType = "service" + ArangoRouteStatusTargetEndpointsType ArangoRouteStatusTargetType = "endpoints" +) diff --git a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go index 31e9cff51..fa67283f8 100644 --- a/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go @@ -132,6 +132,11 @@ func (in *ArangoRouteSpecDestination) DeepCopyInto(out *ArangoRouteSpecDestinati *out = new(ArangoRouteSpecDestinationService) (*in).DeepCopyInto(*out) } + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = new(ArangoRouteSpecDestinationEndpoints) + (*in).DeepCopyInto(*out) + } if in.Schema != nil { in, out := &in.Schema, &out.Schema *out = new(ArangoRouteSpecDestinationSchema) @@ -191,6 +196,32 @@ func (in *ArangoRouteSpecDestinationAuthentication) DeepCopy() *ArangoRouteSpecD return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoRouteSpecDestinationEndpoints) DeepCopyInto(out *ArangoRouteSpecDestinationEndpoints) { + *out = *in + if in.Object != nil { + in, out := &in.Object, &out.Object + *out = new(v1.Object) + (*in).DeepCopyInto(*out) + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(intstr.IntOrString) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoRouteSpecDestinationEndpoints. +func (in *ArangoRouteSpecDestinationEndpoints) DeepCopy() *ArangoRouteSpecDestinationEndpoints { + if in == nil { + return nil + } + out := new(ArangoRouteSpecDestinationEndpoints) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArangoRouteSpecDestinationService) DeepCopyInto(out *ArangoRouteSpecDestinationService) { *out = *in diff --git a/pkg/apis/shared/validate.go b/pkg/apis/shared/validate.go index 431b5f241..b9da30205 100644 --- a/pkg/apis/shared/validate.go +++ b/pkg/apis/shared/validate.go @@ -24,11 +24,13 @@ import ( "fmt" "reflect" "regexp" + "strings" "github.com/google/uuid" core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" ) @@ -243,3 +245,108 @@ func ValidateServiceType(st core.ServiceType) error { } return errors.Errorf("Unsupported service type %s", st) } + +// ValidateExclusiveFields check if fields are defined in exclusive way +func ValidateExclusiveFields(in any, expected int, fields ...string) error { + v := reflect.ValueOf(in) + t := v.Type() + + if expected > len(fields) { + return errors.Errorf("Expected more fields than allowed") + } + + if t.Kind() == reflect.Pointer { + if !v.IsValid() { + return errors.Errorf("Invalid reference") + } + + if v.IsZero() { + // Skip in case of zero value + return nil + } + + // We got a ptr, detach type + return ValidateExclusiveFields(v.Elem().Interface(), expected, fields...) + } + + if t.Kind() == reflect.Struct { + foundFields := map[string]bool{} + for _, field := range fields { + tf, ok := t.FieldByName(field) + if !ok { + continue + } + + n := field + if tg, ok := tf.Tag.Lookup("json"); ok { + p := strings.Split(tg, ",")[0] + if p != "" { + n = p + } + } + foundFields[n] = false + + vf := v.FieldByName(field) + if !vf.IsValid() { + continue + } + if vf.IsZero() { + // Empty or nil + continue + } + + foundFields[n] = true + } + + existing := util.Sort(util.FlattenList(util.FormatList(util.Extract(foundFields), func(a util.KV[string, bool]) []string { + if a.V { + return []string{a.K} + } + + return nil + })), func(i, j string) bool { + return i < j + }) + + missing := util.Sort(util.FlattenList(util.FormatList(util.Extract(foundFields), func(a util.KV[string, bool]) []string { + if !a.V { + return []string{a.K} + } + + return nil + })), func(i, j string) bool { + return i < j + }) + + all := util.SortKeys(foundFields) + + if len(existing) != expected { + // We did not get all fields, check condition + if len(existing) == 0 { + return errors.Errorf("Elements not provided. Expected %d. Possible: %s", + expected, + strings.Join(all, ", "), + ) + } + if len(existing) < expected { + return errors.Errorf("Not enough elements provided. Expected %d, got %d. Defined: %s, Additionally Possible: %s", + expected, + len(existing), + strings.Join(existing, ", "), + strings.Join(missing, ", "), + ) + } + if len(existing) > expected { + return errors.Errorf("Too many elements provided. Expected %d, got %d. Defined: %s", + expected, + len(existing), + strings.Join(existing, ", "), + ) + } + } + + return nil + } + + return errors.Errorf("Invalid reference") +} diff --git a/pkg/apis/shared/validate_test.go b/pkg/apis/shared/validate_test.go index 31b7f6787..4a0dc4e93 100644 --- a/pkg/apis/shared/validate_test.go +++ b/pkg/apis/shared/validate_test.go @@ -42,3 +42,41 @@ func Test_ValidateAPIPath(t *testing.T) { require.NoError(t, ValidateAPIPath("/api/test/2/")) require.Error(t, ValidateAPIPath("/&/")) } + +func Test_ValidateExclusiveFields(t *testing.T) { + type z struct { + A string `json:"a,omitempty"` + B string `json:"b,omitempty"` + C string `json:"c,omitempty"` + D string `json:"d,omitempty"` + } + + require.EqualError(t, ValidateExclusiveFields(z{}, 1, "A"), "Elements not provided. Expected 1. Possible: a") + + require.NoError(t, ValidateExclusiveFields(z{ + A: "test", + }, 1, "A")) + + require.EqualError(t, ValidateExclusiveFields(z{ + A: "test", + }, 2, "A"), "Expected more fields than allowed") + + require.EqualError(t, ValidateExclusiveFields(z{ + A: "test", + }, 2, "A", "B"), "Not enough elements provided. Expected 2, got 1. Defined: a, Additionally Possible: b") + + require.NoError(t, ValidateExclusiveFields(z{ + A: "test", + B: "test", + }, 2, "A", "B")) + + require.EqualError(t, ValidateExclusiveFields(z{ + A: "test", + B: "test", + }, 1, "A", "B"), "Too many elements provided. Expected 1, got 2. Defined: a, b") + + require.NoError(t, ValidateExclusiveFields(z{ + A: "test", + D: "test", + }, 2, "A", "B", "C", "D")) +} diff --git a/pkg/crd/crds/networking-route.schema.generated.yaml b/pkg/crd/crds/networking-route.schema.generated.yaml index d973e59fb..9d82639de 100644 --- a/pkg/crd/crds/networking-route.schema.generated.yaml +++ b/pkg/crd/crds/networking-route.schema.generated.yaml @@ -13,8 +13,37 @@ v1alpha1: description: Authentication defines auth methods properties: passMode: + description: PassMode define authorization details pass mode when authorization was successful + enum: + - override + - pass + - remove type: string type: + description: Type of the authentication + enum: + - optional + - required + type: string + type: object + endpoints: + description: Endpoints defines service upstream reference - which is used to find endpoints + properties: + checksum: + description: UID keeps the information about object Checksum + type: string + name: + description: Name of the object + type: string + namespace: + description: Namespace of the object. Should default to the namespace of the parent object + type: string + port: + description: Port defines Port or Port Name used as destination + type: string + x-kubernetes-int-or-string: true + uid: + description: UID keeps the information about object UID type: string type: object path: diff --git a/pkg/deployment/cleanup.go b/pkg/deployment/cleanup.go index f0e359bd2..e621efb31 100644 --- a/pkg/deployment/cleanup.go +++ b/pkg/deployment/cleanup.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ func (d *Deployment) removePodFinalizers(ctx context.Context, cachedStatus inspe if err := cachedStatus.Pod().V1().Iterate(func(pod *core.Pod) error { log.Str("pod", pod.GetName()).Info("Removing Pod Finalizer") - if count, err := k8sutil.RemovePodFinalizers(ctx, cachedStatus, d.PodsModInterface(), pod, constants.ManagedFinalizers(), true); err != nil { + if count, err := k8sutil.RemoveSelectedFinalizers[*core.Pod](ctx, cachedStatus.Pod().V1().Read(), cachedStatus.PodsModInterface().V1(), pod, constants.ManagedFinalizers(), true); err != nil { log.Err(err).Warn("Failed to remove pod finalizers") return err } else if count > 0 { @@ -78,7 +78,7 @@ func (d *Deployment) removePVCFinalizers(ctx context.Context, cachedStatus inspe if err := cachedStatus.PersistentVolumeClaim().V1().Iterate(func(pvc *core.PersistentVolumeClaim) error { log.Str("pvc", pvc.GetName()).Info("Removing PVC Finalizer") - if count, err := k8sutil.RemovePVCFinalizers(ctx, cachedStatus, d.PersistentVolumeClaimsModInterface(), pvc, constants.ManagedFinalizers(), true); err != nil { + if count, err := k8sutil.RemoveSelectedFinalizers[*core.PersistentVolumeClaim](ctx, cachedStatus.PersistentVolumeClaim().V1().Read(), cachedStatus.PersistentVolumeClaimsModInterface().V1(), pvc, constants.ManagedFinalizers(), true); err != nil { log.Err(err).Warn("Failed to remove PVC finalizers") return err } else if count > 0 { diff --git a/pkg/deployment/context_impl.go b/pkg/deployment/context_impl.go index d62659885..a2c1b0668 100644 --- a/pkg/deployment/context_impl.go +++ b/pkg/deployment/context_impl.go @@ -399,7 +399,7 @@ func (d *Deployment) RemovePodFinalizers(ctx context.Context, podName string) er return errors.WithStack(err) } - _, err = k8sutil.RemovePodFinalizers(ctx, d.GetCachedStatus(), d.PodsModInterface(), p, p.GetFinalizers(), true) + _, err = k8sutil.RemoveSelectedFinalizers[*core.Pod](ctx, d.GetCachedStatus().Pod().V1().Read(), d.GetCachedStatus().PodsModInterface().V1(), p, p.GetFinalizers(), true) if err != nil { return errors.WithStack(err) } diff --git a/pkg/deployment/deployment_finalizers.go b/pkg/deployment/deployment_finalizers.go index 45192a410..b6404b551 100644 --- a/pkg/deployment/deployment_finalizers.go +++ b/pkg/deployment/deployment_finalizers.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" @@ -90,7 +89,8 @@ func (d *Deployment) runDeploymentFinalizers(ctx context.Context, cachedStatus i } // Remove finalizers (if needed) if len(removalList) > 0 { - if err := removeDeploymentFinalizers(ctx, d.deps.Client.Arango(), updated, removalList); err != nil { + c := d.deps.Client.Arango().DatabaseV1().ArangoDeployments(updated.GetNamespace()) + if _, err := k8sutil.RemoveSelectedFinalizers[*api.ArangoDeployment](ctx, c, c, updated, removalList, false); err != nil { d.log.Err(err).Debug("Failed to update ArangoDeployment (to remove finalizers)") return errors.WithStack(err) } @@ -116,36 +116,3 @@ func (d *Deployment) inspectRemoveChildFinalizers(ctx context.Context, _ *api.Ar return retry, nil } - -// removeDeploymentFinalizers removes the given finalizers from the given PVC. -func removeDeploymentFinalizers(ctx context.Context, cli versioned.Interface, - depl *api.ArangoDeployment, finalizers []string) error { - depls := cli.DatabaseV1().ArangoDeployments(depl.GetNamespace()) - getFunc := func() (meta.Object, error) { - ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) - defer cancel() - - result, err := depls.Get(ctxChild, depl.GetName(), meta.GetOptions{}) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil - } - updateFunc := func(updated meta.Object) error { - updatedDepl := updated.(*api.ArangoDeployment) - ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) - defer cancel() - - result, err := depls.Update(ctxChild, updatedDepl, meta.UpdateOptions{}) - if err != nil { - return errors.WithStack(err) - } - *depl = *result - return nil - } - ignoreNotFound := false - if _, err := k8sutil.RemoveFinalizers(finalizers, getFunc, updateFunc, ignoreNotFound); err != nil { - return errors.WithStack(err) - } - return nil -} diff --git a/pkg/deployment/resources/pod_finalizers.go b/pkg/deployment/resources/pod_finalizers.go index 5e8a53bc8..aef120792 100644 --- a/pkg/deployment/resources/pod_finalizers.go +++ b/pkg/deployment/resources/pod_finalizers.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -115,7 +115,7 @@ func (r *Resources) runPodFinalizers(ctx context.Context, p *core.Pod, memberSta } // Remove finalizers (if needed) if len(removalList) > 0 { - if _, err := k8sutil.RemovePodFinalizers(ctx, r.context.ACS().CurrentClusterCache(), r.context.ACS().CurrentClusterCache().PodsModInterface().V1(), p, removalList, false); err != nil { + if _, err := k8sutil.RemoveSelectedFinalizers[*core.Pod](ctx, r.context.ACS().CurrentClusterCache().Pod().V1().Read(), r.context.ACS().CurrentClusterCache().PodsModInterface().V1(), p, removalList, false); err != nil { log.Err(err).Debug("Failed to update pod (to remove finalizers)") return 0, errors.WithStack(err) } diff --git a/pkg/deployment/resources/pod_inspector.go b/pkg/deployment/resources/pod_inspector.go index 1d6e2e3b8..bf85c699a 100644 --- a/pkg/deployment/resources/pod_inspector.go +++ b/pkg/deployment/resources/pod_inspector.go @@ -117,7 +117,7 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter // Strange, pod belongs to us, but we have no member for it. // Remove all finalizers, so it can be removed. log.Str("pod", pod.GetName()).Warn("Pod belongs to this deployment, but we don't know the member. Removing all finalizers") - _, err := k8sutil.RemovePodFinalizers(ctx, r.context.ACS().CurrentClusterCache(), cachedStatus.PodsModInterface().V1(), pod, pod.GetFinalizers(), false) + _, err := k8sutil.RemoveSelectedFinalizers[*core.Pod](ctx, r.context.ACS().CurrentClusterCache().Pod().V1().Read(), r.context.ACS().CurrentClusterCache().PodsModInterface().V1(), pod, pod.GetFinalizers(), false) if err != nil { log.Str("pod", pod.GetName()).Err(err).Debug("Failed to update pod (to remove all finalizers)") return errors.WithStack(err) diff --git a/pkg/deployment/resources/pvc_finalizers.go b/pkg/deployment/resources/pvc_finalizers.go index 537b6e877..8610758e1 100644 --- a/pkg/deployment/resources/pvc_finalizers.go +++ b/pkg/deployment/resources/pvc_finalizers.go @@ -58,7 +58,7 @@ func (r *Resources) runPVCFinalizers(ctx context.Context, p *core.PersistentVolu } // Remove finalizers (if needed) if len(removalList) > 0 { - _, err := k8sutil.RemovePVCFinalizers(ctx, r.context.ACS().CurrentClusterCache(), r.context.ACS().CurrentClusterCache().PersistentVolumeClaimsModInterface().V1(), p, removalList, false) + _, err := k8sutil.RemoveSelectedFinalizers[*core.PersistentVolumeClaim](ctx, r.context.ACS().CurrentClusterCache().PersistentVolumeClaim().V1().Read(), r.context.ACS().CurrentClusterCache().PersistentVolumeClaimsModInterface().V1(), p, removalList, false) if err != nil { log.Err(err).Debug("Failed to update PVC (to remove finalizers)") return 0, errors.WithStack(err) diff --git a/pkg/deployment/resources/pvc_inspector.go b/pkg/deployment/resources/pvc_inspector.go index f1aad19e3..f369f3be2 100644 --- a/pkg/deployment/resources/pvc_inspector.go +++ b/pkg/deployment/resources/pvc_inspector.go @@ -77,7 +77,7 @@ func (r *Resources) InspectPVCs(ctx context.Context, cachedStatus inspectorInter // Strange, pvc belongs to us, but we have no member for it. // Remove all finalizers, so it can be removed. log.Str("pvc", pvc.GetName()).Warn("PVC belongs to this deployment, but we don't know the member. Removing all finalizers") - _, err := k8sutil.RemovePVCFinalizers(ctx, r.context.ACS().CurrentClusterCache(), cachedStatus.PersistentVolumeClaimsModInterface().V1(), pvc, pvc.GetFinalizers(), false) + _, err := k8sutil.RemoveSelectedFinalizers[*core.PersistentVolumeClaim](ctx, r.context.ACS().CurrentClusterCache().PersistentVolumeClaim().V1().Read(), r.context.ACS().CurrentClusterCache().PersistentVolumeClaimsModInterface().V1(), pvc, pvc.GetFinalizers(), false) if err != nil { log.Str("pvc", pvc.GetName()).Err(err).Debug("Failed to update PVC (to remove all finalizers)") return errors.WithStack(err) diff --git a/pkg/handlers/networking/route/handler.go b/pkg/handlers/networking/route/handler.go index fc5ea603b..bd6009a8b 100644 --- a/pkg/handlers/networking/route/handler.go +++ b/pkg/handlers/networking/route/handler.go @@ -101,7 +101,7 @@ func (h *handler) HandleSpecValidity(ctx context.Context, item operation.Item, e logger.Err(err).Warn("Invalid Spec on %s", item.String()) - if status.Conditions.Update(networkingApi.SpecValidCondition, false, "Spec is invalid", "Spec is invalid") { + if status.Conditions.Update(networkingApi.SpecValidCondition, false, "Spec is invalid", err.Error()) { return true, operator.Stop("Invalid spec") } return false, operator.Stop("Invalid spec") diff --git a/pkg/handlers/networking/route/handler_destination.go b/pkg/handlers/networking/route/handler_destination.go index dfa1e65fd..f6232c2f2 100644 --- a/pkg/handlers/networking/route/handler_destination.go +++ b/pkg/handlers/networking/route/handler_destination.go @@ -22,157 +22,20 @@ package route import ( "context" - "fmt" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/arangodb/kube-arangodb/pkg/util" ) func (h *handler) HandleArangoDestination(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, deployment *api.ArangoDeployment) (*operator.Condition, bool, error) { if dest := extension.Spec.GetDestination(); dest != nil { if svc := dest.GetService(); svc != nil { - port := svc.Port - - if port == nil { - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: "Missing Port definition", - }, false, nil - } - - s, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.kubeClient.CoreV1().Services(svc.GetNamespace(extension)).Get, svc.GetName(), meta.GetOptions{}) - if err != nil { - if api.IsNotFound(err) { - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: fmt.Sprintf("Service `%s/%s` Not found", svc.GetNamespace(extension), svc.GetName()), - }, false, nil - } - - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: fmt.Sprintf("Unknown error for service `%s/%s`: %s", svc.GetNamespace(extension), svc.GetName(), err.Error()), - }, false, nil - } - - if !svc.Equals(s) { - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: fmt.Sprintf("Service `%s/%s` Changed", svc.GetNamespace(extension), svc.GetName()), - }, false, nil - } - - var destPort int32 - - if port.Type == intstr.Int { - p, ok := util.PickFromList(s.Spec.Ports, func(v core.ServicePort) bool { - return v.Port == port.IntVal - }) - if !ok { - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: fmt.Sprintf("Port `%d` not defined on Service `%s/%s`", port.IntVal, svc.GetNamespace(extension), svc.GetName()), - }, false, nil - } - - destPort = p.Port - } else if port.Type == intstr.String && port.StrVal != "" { - p, ok := util.PickFromList(s.Spec.Ports, func(v core.ServicePort) bool { - return v.Name == port.StrVal - }) - if !ok { - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: fmt.Sprintf("Port `%s` not defined on Service `%s/%s`", port.StrVal, svc.GetNamespace(extension), svc.GetName()), - }, false, nil - } - - destPort = p.Port - } else { - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: "Unknown Port definition", - }, false, nil - } - - if destPort == -1 { - return &operator.Condition{ - Status: false, - Reason: "Destination Not Found", - Message: fmt.Sprintf("Unable to discover port on Service `%s/%s`", svc.GetNamespace(extension), svc.GetName()), - }, false, nil - } - - var target networkingApi.ArangoRouteStatusTarget - - target.Path = dest.GetPath() - - // Render Auth Settings - - target.Authentication.Type = dest.GetAuthentication().GetType() - target.Authentication.PassMode = dest.GetAuthentication().GetPassMode() - - if dest.Schema.Get() == networkingApi.ArangoRouteSpecDestinationSchemaHTTPS { - target.TLS = &networkingApi.ArangoRouteStatusTargetTLS{ - Insecure: util.NewType(extension.Spec.Destination.GetTLS().GetInsecure()), - } - } - - if ip := s.Spec.ClusterIP; ip != "" { - target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ - networkingApi.ArangoRouteStatusTargetDestination{ - Host: ip, - Port: destPort, - }, - } - } else { - if domain := deployment.Spec.ClusterDomain; domain != nil { - target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ - networkingApi.ArangoRouteStatusTargetDestination{ - Host: fmt.Sprintf("%s.%s.svc.%s", s.GetName(), s.GetNamespace(), *domain), - Port: destPort, - }, - } - } else { - target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ - networkingApi.ArangoRouteStatusTargetDestination{ - Host: fmt.Sprintf("%s.%s.svc", s.GetName(), s.GetNamespace()), - Port: destPort, - }, - } - } - } - - if status.Target.Hash() == target.Hash() { - return &operator.Condition{ - Status: true, - Reason: "Destination Found", - Message: "Destination Found", - Hash: target.Hash(), - }, false, nil - } - - status.Target = &target - return &operator.Condition{ - Status: true, - Reason: "Destination Found", - Message: "Destination Found", - Hash: target.Hash(), - }, true, nil + return h.HandleArangoDestinationService(ctx, item, extension, status, deployment, dest, svc) + } + if endpoints := dest.GetEndpoints(); endpoints != nil { + return h.HandleArangoDestinationEndpoints(ctx, item, extension, status, deployment, dest, endpoints) } } diff --git a/pkg/handlers/networking/route/handler_destination_endpoints.go b/pkg/handlers/networking/route/handler_destination_endpoints.go new file mode 100644 index 000000000..c67a9a8a1 --- /dev/null +++ b/pkg/handlers/networking/route/handler_destination_endpoints.go @@ -0,0 +1,180 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "context" + "fmt" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func (h *handler) HandleArangoDestinationEndpoints(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, deployment *api.ArangoDeployment, dest *networkingApi.ArangoRouteSpecDestination, endpoints *networkingApi.ArangoRouteSpecDestinationEndpoints) (*operator.Condition, bool, error) { + port := endpoints.Port + + if port == nil { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: "Missing Port definition", + }, false, nil + } + + s, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.kubeClient.CoreV1().Services(endpoints.GetNamespace(extension)).Get, endpoints.GetName(), meta.GetOptions{}) + if err != nil { + if api.IsNotFound(err) { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Service `%s/%s` Not found", endpoints.GetNamespace(extension), endpoints.GetName()), + }, false, nil + } + + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Unknown error for service `%s/%s`: %s", endpoints.GetNamespace(extension), endpoints.GetName(), err.Error()), + }, false, nil + } + + if !endpoints.Equals(s) { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Service `%s/%s` Changed", endpoints.GetNamespace(extension), endpoints.GetName()), + }, false, nil + } + + e, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.kubeClient.CoreV1().Endpoints(endpoints.GetNamespace(extension)).Get, endpoints.GetName(), meta.GetOptions{}) + if err != nil { + if api.IsNotFound(err) { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Endpoints `%s/%s` Not found", endpoints.GetNamespace(extension), endpoints.GetName()), + }, false, nil + } + + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Unknown error for endpoints `%s/%s`: %s", endpoints.GetNamespace(extension), endpoints.GetName(), err.Error()), + }, false, nil + } + + // Discover port name - empty names are allowed + var destPortName = "N/A" + + if port.Type == intstr.Int { + p, ok := util.PickFromList(s.Spec.Ports, func(v core.ServicePort) bool { + return v.Port == port.IntVal + }) + if !ok { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Port `%d` not defined on Service `%s/%s`", port.IntVal, endpoints.GetNamespace(extension), endpoints.GetName()), + }, false, nil + } + + destPortName = p.Name + } else if port.Type == intstr.String { + destPortName = port.StrVal + } + + if destPortName == "N/A" { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Unable to discover port on Service `%s/%s`", endpoints.GetNamespace(extension), endpoints.GetName()), + }, false, nil + } + + var target networkingApi.ArangoRouteStatusTarget + + target.Path = dest.GetPath() + target.Type = networkingApi.ArangoRouteStatusTargetEndpointsType + + // Render Auth Settings + + target.Authentication.Type = dest.GetAuthentication().GetType() + target.Authentication.PassMode = dest.GetAuthentication().GetPassMode() + + if dest.Schema.Get() == networkingApi.ArangoRouteSpecDestinationSchemaHTTPS { + target.TLS = &networkingApi.ArangoRouteStatusTargetTLS{ + Insecure: util.NewType(extension.Spec.Destination.GetTLS().GetInsecure()), + } + } + + for _, subset := range e.Subsets { + p, ok := util.PickFromList(subset.Ports, func(v core.EndpointPort) bool { + return v.Name == destPortName + }) + if !ok { + continue + } + + for _, address := range subset.Addresses { + target.Destinations = append(target.Destinations, networkingApi.ArangoRouteStatusTargetDestination{ + Host: address.IP, + Port: p.Port, + }) + } + + if s.Spec.PublishNotReadyAddresses { + for _, address := range subset.NotReadyAddresses { + target.Destinations = append(target.Destinations, networkingApi.ArangoRouteStatusTargetDestination{ + Host: address.IP, + Port: p.Port, + }) + } + } + } + + target.Destinations = util.Sort(target.Destinations, func(i, j networkingApi.ArangoRouteStatusTargetDestination) bool { + return i.Hash() < j.Hash() + }) + + if status.Target.Hash() == target.Hash() { + return &operator.Condition{ + Status: true, + Reason: "Destination Found", + Message: "Destination Found", + Hash: target.Hash(), + }, false, nil + } + + status.Target = &target + return &operator.Condition{ + Status: true, + Reason: "Destination Found", + Message: "Destination Found", + Hash: target.Hash(), + }, true, nil +} diff --git a/pkg/handlers/networking/route/handler_destination_endpoints_test.go b/pkg/handlers/networking/route/handler_destination_endpoints_test.go new file mode 100644 index 000000000..469ce724d --- /dev/null +++ b/pkg/handlers/networking/route/handler_destination_endpoints_test.go @@ -0,0 +1,330 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "testing" + + "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Destination_Endpoints_Valid(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Endpoints: &networkingApi.ArangoRouteSpecDestinationEndpoints{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + endpoints := tests.NewMetaObject[*core.Endpoints](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Endpoints) { + obj.Subsets = []core.EndpointSubset{ + { + Addresses: []core.EndpointAddress{ + { + IP: "127.0.0.1", + }, + }, + Ports: []core.EndpointPort{ + { + Name: "", + Port: 10244, + }, + }, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc, &endpoints) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetEndpointsType, extension.Status.Target.Type) + + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://127.0.0.1:10244/", extension.Status.Target.RenderURLs()[0]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Endpoints_PortForward(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Endpoints: &networkingApi.ArangoRouteSpecDestinationEndpoints{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + endpoints := tests.NewMetaObject[*core.Endpoints](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Endpoints) { + obj.Subsets = []core.EndpointSubset{ + { + Addresses: []core.EndpointAddress{ + { + IP: "127.0.0.1", + }, + }, + Ports: []core.EndpointPort{ + { + Name: "", + Port: 10245, + }, + }, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc, &endpoints) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetEndpointsType, extension.Status.Target.Type) + + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://127.0.0.1:10245/", extension.Status.Target.RenderURLs()[0]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Endpoints_MultiTargets(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Endpoints: &networkingApi.ArangoRouteSpecDestinationEndpoints{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + endpoints := tests.NewMetaObject[*core.Endpoints](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Endpoints) { + obj.Subsets = []core.EndpointSubset{ + { + Addresses: []core.EndpointAddress{ + { + IP: "127.0.0.1", + }, + }, + Ports: []core.EndpointPort{ + { + Name: "", + Port: 10245, + }, + }, + }, + { + Addresses: []core.EndpointAddress{ + { + IP: "127.0.0.2", + }, + }, + Ports: []core.EndpointPort{ + { + Name: "", + Port: 10246, + }, + }, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc, &endpoints) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetEndpointsType, extension.Status.Target.Type) + + require.Len(t, extension.Status.Target.RenderURLs(), 2) + require.EqualValues(t, "http://127.0.0.1:10245/", extension.Status.Target.RenderURLs()[0]) + require.EqualValues(t, "http://127.0.0.2:10246/", extension.Status.Target.RenderURLs()[1]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Endpoints_MultiDestinations(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Endpoints: &networkingApi.ArangoRouteSpecDestinationEndpoints{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + endpoints := tests.NewMetaObject[*core.Endpoints](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Endpoints) { + obj.Subsets = []core.EndpointSubset{ + { + Addresses: []core.EndpointAddress{ + { + IP: "127.0.0.1", + }, + { + IP: "127.0.0.2", + }, + }, + Ports: []core.EndpointPort{ + { + Name: "", + Port: 10245, + }, + }, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc, &endpoints) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetEndpointsType, extension.Status.Target.Type) + + require.Len(t, extension.Status.Target.RenderURLs(), 2) + require.EqualValues(t, "http://127.0.0.1:10245/", extension.Status.Target.RenderURLs()[0]) + require.EqualValues(t, "http://127.0.0.2:10245/", extension.Status.Target.RenderURLs()[1]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} diff --git a/pkg/handlers/networking/route/handler_destination_service.go b/pkg/handlers/networking/route/handler_destination_service.go new file mode 100644 index 000000000..de56f4efb --- /dev/null +++ b/pkg/handlers/networking/route/handler_destination_service.go @@ -0,0 +1,175 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "context" + "fmt" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func (h *handler) HandleArangoDestinationService(ctx context.Context, item operation.Item, extension *networkingApi.ArangoRoute, status *networkingApi.ArangoRouteStatus, deployment *api.ArangoDeployment, dest *networkingApi.ArangoRouteSpecDestination, svc *networkingApi.ArangoRouteSpecDestinationService) (*operator.Condition, bool, error) { + port := svc.Port + + if port == nil { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: "Missing Port definition", + }, false, nil + } + + s, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.kubeClient.CoreV1().Services(svc.GetNamespace(extension)).Get, svc.GetName(), meta.GetOptions{}) + if err != nil { + if api.IsNotFound(err) { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Service `%s/%s` Not found", svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Unknown error for service `%s/%s`: %s", svc.GetNamespace(extension), svc.GetName(), err.Error()), + }, false, nil + } + + if !svc.Equals(s) { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Service `%s/%s` Changed", svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + var destPort int32 + + if port.Type == intstr.Int { + p, ok := util.PickFromList(s.Spec.Ports, func(v core.ServicePort) bool { + return v.Port == port.IntVal + }) + if !ok { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Port `%d` not defined on Service `%s/%s`", port.IntVal, svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + destPort = p.Port + } else if port.Type == intstr.String && port.StrVal != "" { + p, ok := util.PickFromList(s.Spec.Ports, func(v core.ServicePort) bool { + return v.Name == port.StrVal + }) + if !ok { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Port `%s` not defined on Service `%s/%s`", port.StrVal, svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + destPort = p.Port + } else { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: "Unknown Port definition", + }, false, nil + } + + if destPort == -1 { + return &operator.Condition{ + Status: false, + Reason: "Destination Not Found", + Message: fmt.Sprintf("Unable to discover port on Service `%s/%s`", svc.GetNamespace(extension), svc.GetName()), + }, false, nil + } + + var target networkingApi.ArangoRouteStatusTarget + + target.Path = dest.GetPath() + target.Type = networkingApi.ArangoRouteStatusTargetServiceType + + // Render Auth Settings + + target.Authentication.Type = dest.GetAuthentication().GetType() + target.Authentication.PassMode = dest.GetAuthentication().GetPassMode() + + if dest.Schema.Get() == networkingApi.ArangoRouteSpecDestinationSchemaHTTPS { + target.TLS = &networkingApi.ArangoRouteStatusTargetTLS{ + Insecure: util.NewType(extension.Spec.Destination.GetTLS().GetInsecure()), + } + } + + if ip := s.Spec.ClusterIP; ip != "" { + target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ + networkingApi.ArangoRouteStatusTargetDestination{ + Host: ip, + Port: destPort, + }, + } + } else { + if domain := deployment.Spec.ClusterDomain; domain != nil { + target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ + networkingApi.ArangoRouteStatusTargetDestination{ + Host: fmt.Sprintf("%s.%s.svc.%s", s.GetName(), s.GetNamespace(), *domain), + Port: destPort, + }, + } + } else { + target.Destinations = networkingApi.ArangoRouteStatusTargetDestinations{ + networkingApi.ArangoRouteStatusTargetDestination{ + Host: fmt.Sprintf("%s.%s.svc", s.GetName(), s.GetNamespace()), + Port: destPort, + }, + } + } + } + + if status.Target.Hash() == target.Hash() { + return &operator.Condition{ + Status: true, + Reason: "Destination Found", + Message: "Destination Found", + Hash: target.Hash(), + }, false, nil + } + + status.Target = &target + return &operator.Condition{ + Status: true, + Reason: "Destination Found", + Message: "Destination Found", + Hash: target.Hash(), + }, true, nil +} diff --git a/pkg/handlers/networking/route/handler_destination_service_test.go b/pkg/handlers/networking/route/handler_destination_service_test.go new file mode 100644 index 000000000..c62b354f2 --- /dev/null +++ b/pkg/handlers/networking/route/handler_destination_service_test.go @@ -0,0 +1,598 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package route + +import ( + "testing" + + "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + networkingApi "github.com/arangodb/kube-arangodb/pkg/apis/networking/v1alpha1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Destination_Service_Missing(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Not Found") + require.EqualValues(t, c.Message, "Unknown error for service `fake/deployment`: services \"deployment\" not found") +} + +func Test_Handler_Destination_Service_Valid(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://deployment.fake.svc:10244/", extension.Status.Target.RenderURLs()[0]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Service_Valid_WithIP(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + obj.Spec.ClusterIP = "127.0.0.2" + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://127.0.0.2:10244/", extension.Status.Target.RenderURLs()[0]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Service_Valid_WithPath(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + Path: util.NewType("/test/path/"), + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + obj.Spec.ClusterIP = "127.0.0.2" + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + require.Len(t, extension.Status.Target.RenderURLs(), 1) + require.EqualValues(t, "http://127.0.0.2:10244/test/path/", extension.Status.Target.RenderURLs()[0]) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Service_ValidName(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromString("test")), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10241, + Name: "test1", + }, + { + Port: 10244, + Name: "test", + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) +} + +func Test_Handler_Destination_Service_WrongPort(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10245, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Not Found") + require.EqualValues(t, c.Message, "Port `10244` not defined on Service `fake/deployment`") +} + +func Test_Handler_Destination_Service_WrongPortName(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromString("test")), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10245, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Not Found") + require.EqualValues(t, c.Message, "Port `test` not defined on Service `fake/deployment`") +} + +func Test_Handler_Destination_Service_Insecure_Default(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Testcense + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) + + require.False(t, extension.Status.Target.TLS.IsInsecure()) +} + +func Test_Handler_Destination_Service_Insecure_Nil(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ + Insecure: nil, + }, + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) + + require.False(t, extension.Status.Target.TLS.IsInsecure()) +} + +func Test_Handler_Destination_Service_Insecure_HTTPS_Override(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ + Insecure: util.NewType(true), + }, + Schema: util.NewType(networkingApi.ArangoRouteSpecDestinationSchemaHTTPS), + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) + + require.True(t, extension.Status.Target.TLS.IsInsecure()) +} + +func Test_Handler_Destination_Service_Insecure_HTTP_Override(t *testing.T) { + // Setup + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Deployment = util.NewType("deployment") + }, + func(t *testing.T, obj *networkingApi.ArangoRoute) { + obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ + Service: &networkingApi.ArangoRouteSpecDestinationService{ + Object: &sharedApi.Object{ + Name: "deployment", + }, + Port: util.NewType(intstr.FromInt32(10244)), + }, + TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ + Insecure: util.NewType(true), + }, + Schema: util.NewType(networkingApi.ArangoRouteSpecDestinationSchemaHTTP), + } + }) + deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") + svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { + obj.Spec.Ports = []core.ServicePort{ + { + Port: 10244, + }, + } + }) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Assert + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) + require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) + require.Equal(t, networkingApi.ArangoRouteStatusTargetServiceType, extension.Status.Target.Type) + + c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.True(t, ok) + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Reason, "Destination Found") + require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) + + require.False(t, extension.Status.Target.TLS.IsInsecure()) +} diff --git a/pkg/handlers/networking/route/handler_destination_test.go b/pkg/handlers/networking/route/handler_destination_test.go index e53cd0f7f..a245c63c8 100644 --- a/pkg/handlers/networking/route/handler_destination_test.go +++ b/pkg/handlers/networking/route/handler_destination_test.go @@ -35,7 +35,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/tests" ) -func Test_Handler_Destination_Service_Missing(t *testing.T) { +func Test_Handler_MultiDest(t *testing.T) { // Setup handler := newFakeHandler() @@ -46,342 +46,12 @@ func Test_Handler_Destination_Service_Missing(t *testing.T) { }, func(t *testing.T, obj *networkingApi.ArangoRoute) { obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", - }, - Port: util.NewType(intstr.FromInt32(10244)), - }, - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Not Found") - require.EqualValues(t, c.Message, "Unknown error for service `fake/deployment`: services \"deployment\" not found") -} - -func Test_Handler_Destination_Service_Valid(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", - }, - Port: util.NewType(intstr.FromInt32(10244)), - }, - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10244, - }, - } - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - require.Len(t, extension.Status.Target.RenderURLs(), 1) - require.EqualValues(t, "http://deployment.fake.svc:10244/", extension.Status.Target.RenderURLs()[0]) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) -} - -func Test_Handler_Destination_Service_Valid_WithIP(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", - }, - Port: util.NewType(intstr.FromInt32(10244)), - }, - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10244, - }, - } - obj.Spec.ClusterIP = "127.0.0.2" - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - require.Len(t, extension.Status.Target.RenderURLs(), 1) - require.EqualValues(t, "http://127.0.0.2:10244/", extension.Status.Target.RenderURLs()[0]) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) -} - -func Test_Handler_Destination_Service_Valid_WithPath(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", - }, - Port: util.NewType(intstr.FromInt32(10244)), - }, - Path: util.NewType("/test/path/"), - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10244, - }, - } - obj.Spec.ClusterIP = "127.0.0.2" - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - require.Len(t, extension.Status.Target.RenderURLs(), 1) - require.EqualValues(t, "http://127.0.0.2:10244/test/path/", extension.Status.Target.RenderURLs()[0]) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) -} - -func Test_Handler_Destination_Service_ValidName(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", - }, - Port: util.NewType(intstr.FromString("test")), - }, - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10241, - Name: "test1", - }, - { - Port: 10244, - Name: "test", - }, - } - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) -} - -func Test_Handler_Destination_Service_WrongPort(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ + Endpoints: &networkingApi.ArangoRouteSpecDestinationEndpoints{ Object: &sharedApi.Object{ Name: "deployment", }, Port: util.NewType(intstr.FromInt32(10244)), }, - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10245, - }, - } - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Not Found") - require.EqualValues(t, c.Message, "Port `10244` not defined on Service `fake/deployment`") -} - -func Test_Handler_Destination_Service_WrongPortName(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", - }, - Port: util.NewType(intstr.FromString("test")), - }, - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10245, - }, - } - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.False(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.False(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Not Found") - require.EqualValues(t, c.Message, "Port `test` not defined on Service `fake/deployment`") -} - -func Test_Handler_Destination_Service_Insecure_Default(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ Service: &networkingApi.ArangoRouteSpecDestinationService{ Object: &sharedApi.Object{ Name: "deployment", @@ -398,166 +68,25 @@ func Test_Handler_Destination_Service_Insecure_Default(t *testing.T) { }, } }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Testcense - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) - - require.False(t, extension.Status.Target.TLS.IsInsecure()) -} - -func Test_Handler_Destination_Service_Insecure_Nil(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", - }, - Port: util.NewType(intstr.FromInt32(10244)), - }, - TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ - Insecure: nil, - }, - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ + endpoints := tests.NewMetaObject[*core.Endpoints](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Endpoints) { + obj.Subsets = []core.EndpointSubset{ { - Port: 10244, - }, - } - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) - - require.False(t, extension.Status.Target.TLS.IsInsecure()) -} - -func Test_Handler_Destination_Service_Insecure_HTTPS_Override(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", + Addresses: []core.EndpointAddress{ + { + IP: "127.0.0.1", }, - Port: util.NewType(intstr.FromInt32(10244)), }, - TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ - Insecure: util.NewType(true), - }, - Schema: util.NewType(networkingApi.ArangoRouteSpecDestinationSchemaHTTPS), - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10244, - }, - } - }) - - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) - - // Test - require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) - - // Refresh - refresh(t) - - // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) - require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) - - require.True(t, extension.Status.Target.TLS.IsInsecure()) -} - -func Test_Handler_Destination_Service_Insecure_HTTP_Override(t *testing.T) { - // Setup - handler := newFakeHandler() - - // Arrange - extension := tests.NewMetaObject[*networkingApi.ArangoRoute](t, tests.FakeNamespace, "test", - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Deployment = util.NewType("deployment") - }, - func(t *testing.T, obj *networkingApi.ArangoRoute) { - obj.Spec.Destination = &networkingApi.ArangoRouteSpecDestination{ - Service: &networkingApi.ArangoRouteSpecDestinationService{ - Object: &sharedApi.Object{ - Name: "deployment", + Ports: []core.EndpointPort{ + { + Name: "", + Port: 10244, }, - Port: util.NewType(intstr.FromInt32(10244)), - }, - TLS: &networkingApi.ArangoRouteSpecDestinationTLS{ - Insecure: util.NewType(true), }, - Schema: util.NewType(networkingApi.ArangoRouteSpecDestinationSchemaHTTP), - } - }) - deployment := tests.NewMetaObject[*api.ArangoDeployment](t, tests.FakeNamespace, "deployment") - svc := tests.NewMetaObject[*core.Service](t, tests.FakeNamespace, "deployment", func(t *testing.T, obj *core.Service) { - obj.Spec.Ports = []core.ServicePort{ - { - Port: 10244, }, } }) - refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc) + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &deployment, &extension, &svc, &endpoints) // Test require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) @@ -566,14 +95,8 @@ func Test_Handler_Destination_Service_Insecure_HTTP_Override(t *testing.T) { refresh(t) // Assert - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.DestinationValidCondition)) - require.True(t, extension.Status.Conditions.IsTrue(networkingApi.ReadyCondition)) - - c, ok := extension.Status.Conditions.Get(networkingApi.DestinationValidCondition) + require.False(t, extension.Status.Conditions.IsTrue(networkingApi.SpecValidCondition)) + c, ok := extension.Status.Conditions.Get(networkingApi.SpecValidCondition) require.True(t, ok) - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Reason, "Destination Found") - require.EqualValues(t, c.Hash, extension.Status.Target.Hash()) - - require.False(t, extension.Status.Target.TLS.IsInsecure()) + require.EqualValues(t, "Received 1 errors: spec.destination: Too many elements provided. Expected 1, got 2. Defined: endpoints, service", c.Message) } diff --git a/pkg/replication/finalizers.go b/pkg/replication/finalizers.go index 028075a0b..618617fb4 100644 --- a/pkg/replication/finalizers.go +++ b/pkg/replication/finalizers.go @@ -32,7 +32,6 @@ import ( "github.com/arangodb/go-driver" api "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" - "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -85,7 +84,9 @@ func (dr *DeploymentReplication) runFinalizers(ctx context.Context, p *api.Arang } removalList := []string{constants.FinalizerDeplReplStopSync} - if err := removeDeploymentReplicationFinalizers(dr.deps.Client.Arango(), p, removalList, false); err != nil { + c := dr.deps.Client.Arango().ReplicationV1().ArangoDeploymentReplications(p.GetNamespace()) + + if _, err := k8sutil.RemoveSelectedFinalizers[*api.ArangoDeploymentReplication](ctx, c, c, p, removalList, false); err != nil { return true, errors.WithMessage(err, "Failed to update deployment replication (to remove finalizers)") } @@ -232,31 +233,6 @@ func (dr *DeploymentReplication) inspectFinalizerDeplReplStopSync(ctx context.Co } -// removeDeploymentReplicationFinalizers removes the given finalizers from the given DeploymentReplication. -func removeDeploymentReplicationFinalizers(crcli versioned.Interface, p *api.ArangoDeploymentReplication, finalizers []string, ignoreNotFound bool) error { - repls := crcli.ReplicationV1().ArangoDeploymentReplications(p.GetNamespace()) - getFunc := func() (meta.Object, error) { - result, err := repls.Get(context.Background(), p.GetName(), meta.GetOptions{}) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil - } - updateFunc := func(updated meta.Object) error { - updatedRepl := updated.(*api.ArangoDeploymentReplication) - result, err := repls.Update(context.Background(), updatedRepl, meta.UpdateOptions{}) - if err != nil { - return errors.WithStack(err) - } - *p = *result - return nil - } - if _, err := k8sutil.RemoveFinalizers(finalizers, getFunc, updateFunc, ignoreNotFound); err != nil { - return errors.WithStack(err) - } - return nil -} - // finalizerExists returns true if a given finalizer exists. func finalizerExists(p *api.ArangoDeploymentReplication, finalizer string) bool { for _, f := range p.ObjectMeta.GetFinalizers() { diff --git a/pkg/util/k8sutil/finalizers.go b/pkg/util/k8sutil/finalizers.go index 35100f54b..3ffa6a480 100644 --- a/pkg/util/k8sutil/finalizers.go +++ b/pkg/util/k8sutil/finalizers.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,95 +24,42 @@ import ( "context" "sort" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim" - persistentvolumeclaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod" - podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" ) const ( maxRemoveFinalizersAttempts = 50 ) -// RemovePodFinalizers removes the given finalizers from the given pod. -func RemovePodFinalizers(ctx context.Context, cachedStatus pod.Inspector, c podv1.ModInterface, p *core.Pod, +// RemoveSelectedFinalizers removes the given finalizers from the given pod. +func RemoveSelectedFinalizers[T meta.Object](ctx context.Context, getter generic.GetInterface[T], patcher generic.PatchInterface[T], p T, finalizers []string, ignoreNotFound bool) (int, error) { - getFunc := func() (meta.Object, error) { - ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) - defer cancel() - - result, err := cachedStatus.Pod().V1().Read().Get(ctxChild, p.GetName(), meta.GetOptions{}) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil - } - updateFunc := func(updated meta.Object) error { - updatedPod := updated.(*core.Pod) - ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) - defer cancel() - - result, err := c.Update(ctxChild, updatedPod, meta.UpdateOptions{}) - if err != nil { - return errors.WithStack(err) - } - *p = *result - return nil - } - if count, err := RemoveFinalizers(finalizers, getFunc, updateFunc, ignoreNotFound); err != nil { + if count, err := RemoveFinalizers(ctx, getter, patcher, p.GetName(), finalizers, ignoreNotFound); err != nil { return 0, errors.WithStack(err) } else { return count, nil } } -// RemovePVCFinalizers removes the given finalizers from the given PVC. -func RemovePVCFinalizers(ctx context.Context, cachedStatus persistentvolumeclaim.Inspector, c persistentvolumeclaimv1.ModInterface, - p *core.PersistentVolumeClaim, finalizers []string, ignoreNotFound bool) (int, error) { - getFunc := func() (meta.Object, error) { - ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) - defer cancel() - - result, err := cachedStatus.PersistentVolumeClaim().V1().Read().Get(ctxChild, p.GetName(), meta.GetOptions{}) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil - } - updateFunc := func(updated meta.Object) error { - updatedPVC := updated.(*core.PersistentVolumeClaim) - ctxChild, cancel := globals.GetGlobalTimeouts().Kubernetes().WithTimeout(ctx) - defer cancel() - - result, err := c.Update(ctxChild, updatedPVC, meta.UpdateOptions{}) - if err != nil { - return errors.WithStack(err) - } - *p = *result - return nil - } - if count, err := RemoveFinalizers(finalizers, getFunc, updateFunc, ignoreNotFound); err != nil { - return 0, errors.WithStack(err) - } else { - return count, nil - } +type RemoveFinalizersClient[T meta.Object] interface { + generic.GetInterface[T] + generic.PatchInterface[T] } // RemoveFinalizers is a helper used to remove finalizers from an object. // The functions tries to get the object using the provided get function, // then remove the given finalizers and update the update using the given update function. // In case of an update conflict, the functions tries again. -func RemoveFinalizers(finalizers []string, getFunc func() (meta.Object, error), updateFunc func(meta.Object) error, ignoreNotFound bool) (int, error) { +func RemoveFinalizers[T meta.Object](ctx context.Context, getter generic.GetInterface[T], p generic.PatchInterface[T], name string, finalizers []string, ignoreNotFound bool) (int, error) { attempts := 0 for { attempts++ - obj, err := getFunc() + obj, err := getter.Get(ctx, name, meta.GetOptions{}) if err != nil { if kerrors.IsNotFound(err) && ignoreNotFound { // Object no longer found and we're allowed to ignore that. @@ -140,8 +87,7 @@ func RemoveFinalizers(finalizers []string, getFunc func() (meta.Object, error), } } if z := len(original) - len(newList); z > 0 { - obj.SetFinalizers(newList) - if err := updateFunc(obj); kerrors.IsConflict(err) { + if _, _, err := patcher.Patcher[T](ctx, p, obj, meta.PatchOptions{}, patcher.Finalizers[T](newList)); kerrors.IsConflict(err) { if attempts > maxRemoveFinalizersAttempts { return 0, errors.WithStack(err) } else { diff --git a/pkg/util/k8sutil/patcher/common.go b/pkg/util/k8sutil/patcher/common.go new file mode 100644 index 000000000..a5cbc3b33 --- /dev/null +++ b/pkg/util/k8sutil/patcher/common.go @@ -0,0 +1,35 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package patcher + +import ( + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" +) + +func Finalizers[T meta.Object](finalizers []string) Patch[T] { + return func(in T) []patch.Item { + return []patch.Item{ + patch.ItemReplace(patch.NewPath("metadata", "finalizers"), finalizers), + } + } +} diff --git a/pkg/util/k8sutil/patcher/patcher.go b/pkg/util/k8sutil/patcher/patcher.go index 41bbd53b7..ab95ff474 100644 --- a/pkg/util/k8sutil/patcher/patcher.go +++ b/pkg/util/k8sutil/patcher/patcher.go @@ -30,12 +30,13 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" ) type Patch[T meta.Object] func(in T) []patch.Item type Client[T meta.Object] interface { - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result T, err error) + generic.PatchInterface[T] } func Patcher[T meta.Object](ctx context.Context, client Client[T], in T, opts meta.PatchOptions, functions ...Patch[T]) (T, bool, error) { diff --git a/pkg/util/list.go b/pkg/util/list.go index 2046e4ee8..13409bc7f 100644 --- a/pkg/util/list.go +++ b/pkg/util/list.go @@ -107,3 +107,19 @@ func CopyList[A any](in []A) []A { copy(ret, in) return ret } + +func FlattenList[A any](in [][]A) []A { + count := 0 + + for _, v := range in { + count += len(v) + } + + res := make([]A, 0, count) + + for _, v := range in { + res = append(res, v...) + } + + return res +} diff --git a/pkg/util/tests/kubernetes.go b/pkg/util/tests/kubernetes.go index 5731a783a..ea5c520a1 100644 --- a/pkg/util/tests/kubernetes.go +++ b/pkg/util/tests/kubernetes.go @@ -143,6 +143,12 @@ func CreateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := k8s.CoreV1().Services(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) require.NoError(t, err) + case **core.Endpoints: + require.NotNil(t, v) + + vl := *v + _, err := k8s.CoreV1().Endpoints(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) case **core.ServiceAccount: require.NotNil(t, v) @@ -310,6 +316,12 @@ func UpdateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := k8s.CoreV1().Services(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) require.NoError(t, err) + case **core.Endpoints: + require.NotNil(t, v) + + vl := *v + _, err := k8s.CoreV1().Endpoints(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) case **core.ServiceAccount: require.NotNil(t, v) @@ -466,6 +478,11 @@ func DeleteObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v require.NoError(t, k8s.CoreV1().Services(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) + case **core.Endpoints: + require.NotNil(t, v) + + vl := *v + require.NoError(t, k8s.CoreV1().Endpoints(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) case **core.ServiceAccount: require.NotNil(t, v) @@ -664,6 +681,21 @@ func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientS } else { *v = vn } + case **core.Endpoints: + require.NotNil(t, v) + + vl := *v + + vn, err := k8s.CoreV1().Endpoints(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } case **core.ServiceAccount: require.NotNil(t, v) @@ -994,6 +1026,12 @@ func SetMetaBasedOnType(t *testing.T, object meta.Object) { v.SetSelfLink(fmt.Sprintf("/api/v1/services/%s/%s", object.GetNamespace(), object.GetName())) + case *core.Endpoints: + v.Kind = "Endpoints" + v.APIVersion = "v1" + v.SetSelfLink(fmt.Sprintf("/api/v1/endpoints/%s/%s", + object.GetNamespace(), + object.GetName())) case *core.ServiceAccount: v.Kind = "ServiceAccount" v.APIVersion = "v1" @@ -1214,6 +1252,12 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind { Version: "v1", Kind: "Service", } + case *core.Endpoints: + return schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Endpoints", + } case *core.ServiceAccount: return schema.GroupVersionKind{ Group: "", diff --git a/pkg/util/tests/kubernetes_test.go b/pkg/util/tests/kubernetes_test.go index f20f6da01..c29d42215 100644 --- a/pkg/util/tests/kubernetes_test.go +++ b/pkg/util/tests/kubernetes_test.go @@ -73,6 +73,7 @@ func Test_NewMetaObject(t *testing.T) { NewMetaObjectRun[*core.ConfigMap](t) NewMetaObjectRun[*core.ServiceAccount](t) NewMetaObjectRun[*core.Service](t) + NewMetaObjectRun[*core.Endpoints](t) NewMetaObjectRun[*apps.StatefulSet](t) NewMetaObjectRun[*rbac.Role](t) NewMetaObjectRun[*rbac.RoleBinding](t) From ae663eaf9dfe761500c47bd6415203a114b41fcd Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:17:14 +0200 Subject: [PATCH 39/50] [Bugfix] Fix OIDC Role (#1729) --- .circleci/continue_config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml index 47b5c0c67..0b58819e3 100644 --- a/.circleci/continue_config.yml +++ b/.circleci/continue_config.yml @@ -16,9 +16,9 @@ parameters: executors: golang-executor: docker: - - image: 889010145541.dkr.ecr.eu-central-1.amazonaws.com/cicd/golang:1.22.5 + - image: 889010145541.dkr.ecr.us-east-1.amazonaws.com/cicd/golang:1.22.5 aws_auth: - oidc_role_arn: arn:aws:iam::889010145541:role/circleci-registry-integration-eu-central-1 + oidc_role_arn: arn:aws:iam::889010145541:role/circleci-project-dev-kube-arangodb machine-executor: machine: image: ubuntu-2204:current From bda998564bce563fd5a6b5abcb071214a73b6368 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:04:06 +0200 Subject: [PATCH 40/50] [Improvement] Improve metric handling (#1728) --- CHANGELOG.md | 1 + docs/generated/metrics/README.md | 70 ++++---- .../arangodb_operator_objects_processed.md | 17 ++ ...esources_deployment_config_map_duration.md | 17 ++ ...sources_deployment_config_map_inspected.md | 17 ++ internal/metrics.go | 2 +- internal/metrics.item.go.tmpl | 141 +++------------ internal/metrics.item.go_test.tmpl | 77 +++++++-- internal/metrics.yaml | 21 ++- pkg/deployment/resources/config_maps.go | 15 +- .../arango_operator_objects_processed.go | 149 ---------------- ...db_operator_agency_cache_health_present.go | 24 +++ ...erator_agency_cache_health_present_test.go | 137 +++++++++++++++ .../arangodb_operator_agency_cache_healthy.go | 24 +++ ...godb_operator_agency_cache_healthy_test.go | 137 +++++++++++++++ .../arangodb_operator_agency_cache_leaders.go | 26 +++ ...godb_operator_agency_cache_leaders_test.go | 141 +++++++++++++++ ...rator_agency_cache_member_commit_offset.go | 26 +++ ..._agency_cache_member_commit_offset_test.go | 141 +++++++++++++++ ...db_operator_agency_cache_member_serving.go | 26 +++ ...erator_agency_cache_member_serving_test.go | 141 +++++++++++++++ .../arangodb_operator_agency_cache_present.go | 24 +++ ...godb_operator_agency_cache_present_test.go | 137 +++++++++++++++ .../arangodb_operator_agency_cache_serving.go | 24 +++ ...godb_operator_agency_cache_serving_test.go | 137 +++++++++++++++ .../arangodb_operator_agency_errors.go | 24 +++ .../arangodb_operator_agency_errors_test.go | 137 +++++++++++++++ .../arangodb_operator_agency_fetches.go | 24 +++ .../arangodb_operator_agency_fetches_test.go | 137 +++++++++++++++ .../arangodb_operator_agency_index.go | 24 +++ .../arangodb_operator_agency_index_test.go | 137 +++++++++++++++ ...arangodb_operator_deployment_conditions.go | 26 +++ ...odb_operator_deployment_conditions_test.go | 141 +++++++++++++++ .../arangodb_operator_engine_assertions.go | 22 +++ ...rangodb_operator_engine_assertions_test.go | 133 ++++++++++++++ .../arangodb_operator_engine_ops_alerts.go | 24 +++ ...rangodb_operator_engine_ops_alerts_test.go | 137 +++++++++++++++ ...angodb_operator_engine_panics_recovered.go | 22 +++ ...b_operator_engine_panics_recovered_test.go | 133 ++++++++++++++ ...erator_kubernetes_client_request_errors.go | 24 +++ ...r_kubernetes_client_request_errors_test.go | 137 +++++++++++++++ ...odb_operator_kubernetes_client_requests.go | 24 +++ ...perator_kubernetes_client_requests_test.go | 137 +++++++++++++++ .../arangodb_operator_members_conditions.go | 28 +++ ...angodb_operator_members_conditions_test.go | 145 ++++++++++++++++ ...members_unexpected_container_exit_codes.go | 34 ++++ ...rs_unexpected_container_exit_codes_test.go | 157 +++++++++++++++++ .../arangodb_operator_objects_processed.go | 71 ++++++++ ...angodb_operator_objects_processed_test.go} | 28 +-- .../arangodb_operator_rebalancer_enabled.go | 24 +++ ...angodb_operator_rebalancer_enabled_test.go | 137 +++++++++++++++ ...ngodb_operator_rebalancer_moves_current.go | 24 +++ ..._operator_rebalancer_moves_current_test.go | 137 +++++++++++++++ ...angodb_operator_rebalancer_moves_failed.go | 24 +++ ...b_operator_rebalancer_moves_failed_test.go | 137 +++++++++++++++ ...odb_operator_rebalancer_moves_generated.go | 24 +++ ...perator_rebalancer_moves_generated_test.go | 137 +++++++++++++++ ...odb_operator_rebalancer_moves_succeeded.go | 24 +++ ...perator_rebalancer_moves_succeeded_test.go | 137 +++++++++++++++ ...tor_resources_arangodeployment_accepted.go | 24 +++ ...esources_arangodeployment_accepted_test.go | 137 +++++++++++++++ ...urces_arangodeployment_immutable_errors.go | 24 +++ ..._arangodeployment_immutable_errors_test.go | 137 +++++++++++++++ ...r_resources_arangodeployment_propagated.go | 24 +++ ...ources_arangodeployment_propagated_test.go | 137 +++++++++++++++ ...ources_arangodeployment_status_restores.go | 24 +++ ...s_arangodeployment_status_restores_test.go | 137 +++++++++++++++ ...tor_resources_arangodeployment_uptodate.go | 24 +++ ...esources_arangodeployment_uptodate_test.go | 137 +++++++++++++++ ...rces_arangodeployment_validation_errors.go | 24 +++ ...arangodeployment_validation_errors_test.go | 137 +++++++++++++++ ...rces_arangodeploymentreplication_active.go | 24 +++ ...arangodeploymentreplication_active_test.go | 137 +++++++++++++++ ...rces_arangodeploymentreplication_failed.go | 24 +++ ...arangodeploymentreplication_failed_test.go | 137 +++++++++++++++ ...esources_deployment_config_map_duration.go | 71 ++++++++ ...ces_deployment_config_map_duration_test.go | 162 ++++++++++++++++++ ...sources_deployment_config_map_inspected.go | 71 ++++++++ ...es_deployment_config_map_inspected_test.go | 162 ++++++++++++++++++ pkg/operatorV2/operator_worker.go | 2 +- pkg/util/metrics/duration.go | 30 ++++ pkg/util/metrics/factory_counter.go | 109 ++++++++++++ pkg/util/metrics/factory_gauge.go | 112 ++++++++++++ 83 files changed, 6045 insertions(+), 345 deletions(-) create mode 100644 docs/generated/metrics/arangodb_operator_objects_processed.md create mode 100644 docs/generated/metrics/arangodb_resources_deployment_config_map_duration.md create mode 100644 docs/generated/metrics/arangodb_resources_deployment_config_map_inspected.md delete mode 100644 pkg/generated/metric_descriptions/arango_operator_objects_processed.go create mode 100644 pkg/generated/metric_descriptions/arangodb_operator_objects_processed.go rename pkg/generated/metric_descriptions/{arango_operator_objects_processed_test.go => arangodb_operator_objects_processed_test.go} (82%) create mode 100644 pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration.go create mode 100644 pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration_test.go create mode 100644 pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected.go create mode 100644 pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected_test.go create mode 100644 pkg/util/metrics/duration.go create mode 100644 pkg/util/metrics/factory_counter.go create mode 100644 pkg/util/metrics/factory_gauge.go diff --git a/CHANGELOG.md b/CHANGELOG.md index b0fbe048c..df03d648f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - (Bugfix) Versioning Alignment - (Feature) (Scheduler) Merge Strategy - (Feature) (Networking) Endpoints Destination +- (Improvement) Improve Metrics Handling ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/docs/generated/metrics/README.md b/docs/generated/metrics/README.md index 1b7551643..f432feeec 100644 --- a/docs/generated/metrics/README.md +++ b/docs/generated/metrics/README.md @@ -12,39 +12,41 @@ has_toc: false [START_INJECT]: # (metricsTable) -| Name | Namespace | Group | Type | Description | -|:-------------------------------------------------------------------------------------------------------------------------------------:|:-----------------:|:-----------------:|:-------:|:--------------------------------------------------------------------------------------| -| [arango_operator_objects_processed](./arango_operator_objects_processed.md) | arango_operator | objects | Counter | Number of the processed objects | -| [arangodb_operator_agency_errors](./arangodb_operator_agency_errors.md) | arangodb_operator | agency | Counter | Current count of agency cache fetch errors | -| [arangodb_operator_agency_fetches](./arangodb_operator_agency_fetches.md) | arangodb_operator | agency | Counter | Current count of agency cache fetches | -| [arangodb_operator_agency_index](./arangodb_operator_agency_index.md) | arangodb_operator | agency | Gauge | Current index of the agency cache | -| [arangodb_operator_agency_cache_health_present](./arangodb_operator_agency_cache_health_present.md) | arangodb_operator | agency_cache | Gauge | Determines if local agency cache health is present | -| [arangodb_operator_agency_cache_healthy](./arangodb_operator_agency_cache_healthy.md) | arangodb_operator | agency_cache | Gauge | Determines if agency is healthy | -| [arangodb_operator_agency_cache_leaders](./arangodb_operator_agency_cache_leaders.md) | arangodb_operator | agency_cache | Gauge | Determines agency leader vote count | -| [arangodb_operator_agency_cache_member_commit_offset](./arangodb_operator_agency_cache_member_commit_offset.md) | arangodb_operator | agency_cache | Gauge | Determines agency member commit offset | -| [arangodb_operator_agency_cache_member_serving](./arangodb_operator_agency_cache_member_serving.md) | arangodb_operator | agency_cache | Gauge | Determines if agency member is reachable | -| [arangodb_operator_agency_cache_present](./arangodb_operator_agency_cache_present.md) | arangodb_operator | agency_cache | Gauge | Determines if local agency cache is present | -| [arangodb_operator_agency_cache_serving](./arangodb_operator_agency_cache_serving.md) | arangodb_operator | agency_cache | Gauge | Determines if agency is serving | -| [arangodb_operator_deployment_conditions](./arangodb_operator_deployment_conditions.md) | arangodb_operator | deployment | Gauge | Representation of the ArangoDeployment condition state (true/false) | -| [arangodb_operator_engine_assertions](./arangodb_operator_engine_assertions.md) | arangodb_operator | engine | Counter | Number of assertions invoked during Operator runtime | -| [arangodb_operator_engine_ops_alerts](./arangodb_operator_engine_ops_alerts.md) | arangodb_operator | engine | Counter | Counter for actions which requires ops attention | -| [arangodb_operator_engine_panics_recovered](./arangodb_operator_engine_panics_recovered.md) | arangodb_operator | engine | Counter | Number of Panics recovered inside Operator reconciliation loop | -| [arangodb_operator_kubernetes_client_request_errors](./arangodb_operator_kubernetes_client_request_errors.md) | arangodb_operator | kubernetes_client | Counter | Number of Kubernetes Client request errors | -| [arangodb_operator_kubernetes_client_requests](./arangodb_operator_kubernetes_client_requests.md) | arangodb_operator | kubernetes_client | Counter | Number of Kubernetes Client requests | -| [arangodb_operator_members_conditions](./arangodb_operator_members_conditions.md) | arangodb_operator | members | Gauge | Representation of the ArangoMember condition state (true/false) | -| [arangodb_operator_members_unexpected_container_exit_codes](./arangodb_operator_members_unexpected_container_exit_codes.md) | arangodb_operator | members | Counter | Counter of unexpected restarts in pod (Containers/InitContainers/EphemeralContainers) | -| [arangodb_operator_rebalancer_enabled](./arangodb_operator_rebalancer_enabled.md) | arangodb_operator | rebalancer | Gauge | Determines if rebalancer is enabled | -| [arangodb_operator_rebalancer_moves_current](./arangodb_operator_rebalancer_moves_current.md) | arangodb_operator | rebalancer | Gauge | Define how many moves are currently in progress | -| [arangodb_operator_rebalancer_moves_failed](./arangodb_operator_rebalancer_moves_failed.md) | arangodb_operator | rebalancer | Counter | Define how many moves failed | -| [arangodb_operator_rebalancer_moves_generated](./arangodb_operator_rebalancer_moves_generated.md) | arangodb_operator | rebalancer | Counter | Define how many moves were generated | -| [arangodb_operator_rebalancer_moves_succeeded](./arangodb_operator_rebalancer_moves_succeeded.md) | arangodb_operator | rebalancer | Counter | Define how many moves succeeded | -| [arangodb_operator_resources_arangodeployment_accepted](./arangodb_operator_resources_arangodeployment_accepted.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeployment has been accepted | -| [arangodb_operator_resources_arangodeployment_immutable_errors](./arangodb_operator_resources_arangodeployment_immutable_errors.md) | arangodb_operator | resources | Counter | Counter for deployment immutable errors | -| [arangodb_operator_resources_arangodeployment_propagated](./arangodb_operator_resources_arangodeployment_propagated.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeployment Spec is propagated | -| [arangodb_operator_resources_arangodeployment_status_restores](./arangodb_operator_resources_arangodeployment_status_restores.md) | arangodb_operator | resources | Counter | Counter for deployment status restored | -| [arangodb_operator_resources_arangodeployment_uptodate](./arangodb_operator_resources_arangodeployment_uptodate.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeployment is uptodate | -| [arangodb_operator_resources_arangodeployment_validation_errors](./arangodb_operator_resources_arangodeployment_validation_errors.md) | arangodb_operator | resources | Counter | Counter for deployment validation errors | -| [arangodb_operator_resources_arangodeploymentreplication_active](./arangodb_operator_resources_arangodeploymentreplication_active.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeploymentReplication is configured and running | -| [arangodb_operator_resources_arangodeploymentreplication_failed](./arangodb_operator_resources_arangodeploymentreplication_failed.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeploymentReplication is in Failed phase | +| Name | Namespace | Group | Type | Description | +|:-------------------------------------------------------------------------------------------------------------------------------------:|:------------------:|:---------------------:|:-------:|:--------------------------------------------------------------------------------------| +| [arangodb_operator_agency_errors](./arangodb_operator_agency_errors.md) | arangodb_operator | agency | Counter | Current count of agency cache fetch errors | +| [arangodb_operator_agency_fetches](./arangodb_operator_agency_fetches.md) | arangodb_operator | agency | Counter | Current count of agency cache fetches | +| [arangodb_operator_agency_index](./arangodb_operator_agency_index.md) | arangodb_operator | agency | Gauge | Current index of the agency cache | +| [arangodb_operator_agency_cache_health_present](./arangodb_operator_agency_cache_health_present.md) | arangodb_operator | agency_cache | Gauge | Determines if local agency cache health is present | +| [arangodb_operator_agency_cache_healthy](./arangodb_operator_agency_cache_healthy.md) | arangodb_operator | agency_cache | Gauge | Determines if agency is healthy | +| [arangodb_operator_agency_cache_leaders](./arangodb_operator_agency_cache_leaders.md) | arangodb_operator | agency_cache | Gauge | Determines agency leader vote count | +| [arangodb_operator_agency_cache_member_commit_offset](./arangodb_operator_agency_cache_member_commit_offset.md) | arangodb_operator | agency_cache | Gauge | Determines agency member commit offset | +| [arangodb_operator_agency_cache_member_serving](./arangodb_operator_agency_cache_member_serving.md) | arangodb_operator | agency_cache | Gauge | Determines if agency member is reachable | +| [arangodb_operator_agency_cache_present](./arangodb_operator_agency_cache_present.md) | arangodb_operator | agency_cache | Gauge | Determines if local agency cache is present | +| [arangodb_operator_agency_cache_serving](./arangodb_operator_agency_cache_serving.md) | arangodb_operator | agency_cache | Gauge | Determines if agency is serving | +| [arangodb_operator_deployment_conditions](./arangodb_operator_deployment_conditions.md) | arangodb_operator | deployment | Gauge | Representation of the ArangoDeployment condition state (true/false) | +| [arangodb_operator_engine_assertions](./arangodb_operator_engine_assertions.md) | arangodb_operator | engine | Counter | Number of assertions invoked during Operator runtime | +| [arangodb_operator_engine_ops_alerts](./arangodb_operator_engine_ops_alerts.md) | arangodb_operator | engine | Counter | Counter for actions which requires ops attention | +| [arangodb_operator_engine_panics_recovered](./arangodb_operator_engine_panics_recovered.md) | arangodb_operator | engine | Counter | Number of Panics recovered inside Operator reconciliation loop | +| [arangodb_operator_kubernetes_client_request_errors](./arangodb_operator_kubernetes_client_request_errors.md) | arangodb_operator | kubernetes_client | Counter | Number of Kubernetes Client request errors | +| [arangodb_operator_kubernetes_client_requests](./arangodb_operator_kubernetes_client_requests.md) | arangodb_operator | kubernetes_client | Counter | Number of Kubernetes Client requests | +| [arangodb_operator_members_conditions](./arangodb_operator_members_conditions.md) | arangodb_operator | members | Gauge | Representation of the ArangoMember condition state (true/false) | +| [arangodb_operator_members_unexpected_container_exit_codes](./arangodb_operator_members_unexpected_container_exit_codes.md) | arangodb_operator | members | Counter | Counter of unexpected restarts in pod (Containers/InitContainers/EphemeralContainers) | +| [arangodb_operator_objects_processed](./arangodb_operator_objects_processed.md) | arangodb_operator | objects | Counter | Number of the processed objects | +| [arangodb_operator_rebalancer_enabled](./arangodb_operator_rebalancer_enabled.md) | arangodb_operator | rebalancer | Gauge | Determines if rebalancer is enabled | +| [arangodb_operator_rebalancer_moves_current](./arangodb_operator_rebalancer_moves_current.md) | arangodb_operator | rebalancer | Gauge | Define how many moves are currently in progress | +| [arangodb_operator_rebalancer_moves_failed](./arangodb_operator_rebalancer_moves_failed.md) | arangodb_operator | rebalancer | Counter | Define how many moves failed | +| [arangodb_operator_rebalancer_moves_generated](./arangodb_operator_rebalancer_moves_generated.md) | arangodb_operator | rebalancer | Counter | Define how many moves were generated | +| [arangodb_operator_rebalancer_moves_succeeded](./arangodb_operator_rebalancer_moves_succeeded.md) | arangodb_operator | rebalancer | Counter | Define how many moves succeeded | +| [arangodb_operator_resources_arangodeployment_accepted](./arangodb_operator_resources_arangodeployment_accepted.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeployment has been accepted | +| [arangodb_operator_resources_arangodeployment_immutable_errors](./arangodb_operator_resources_arangodeployment_immutable_errors.md) | arangodb_operator | resources | Counter | Counter for deployment immutable errors | +| [arangodb_operator_resources_arangodeployment_propagated](./arangodb_operator_resources_arangodeployment_propagated.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeployment Spec is propagated | +| [arangodb_operator_resources_arangodeployment_status_restores](./arangodb_operator_resources_arangodeployment_status_restores.md) | arangodb_operator | resources | Counter | Counter for deployment status restored | +| [arangodb_operator_resources_arangodeployment_uptodate](./arangodb_operator_resources_arangodeployment_uptodate.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeployment is uptodate | +| [arangodb_operator_resources_arangodeployment_validation_errors](./arangodb_operator_resources_arangodeployment_validation_errors.md) | arangodb_operator | resources | Counter | Counter for deployment validation errors | +| [arangodb_operator_resources_arangodeploymentreplication_active](./arangodb_operator_resources_arangodeploymentreplication_active.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeploymentReplication is configured and running | +| [arangodb_operator_resources_arangodeploymentreplication_failed](./arangodb_operator_resources_arangodeploymentreplication_failed.md) | arangodb_operator | resources | Gauge | Defines if ArangoDeploymentReplication is in Failed phase | +| [arangodb_resources_deployment_config_map_duration](./arangodb_resources_deployment_config_map_duration.md) | arangodb_resources | deployment_config_map | Gauge | Duration of inspected ConfigMaps by Deployment in seconds | +| [arangodb_resources_deployment_config_map_inspected](./arangodb_resources_deployment_config_map_inspected.md) | arangodb_resources | deployment_config_map | Counter | Number of inspected ConfigMaps by Deployment | [END_INJECT]: # (metricsTable) diff --git a/docs/generated/metrics/arangodb_operator_objects_processed.md b/docs/generated/metrics/arangodb_operator_objects_processed.md new file mode 100644 index 000000000..0964806e8 --- /dev/null +++ b/docs/generated/metrics/arangodb_operator_objects_processed.md @@ -0,0 +1,17 @@ +--- +layout: page +title: arangodb_operator_objects_processed +parent: List of available metrics +--- + +# arangodb_operator_objects_processed (Counter) + +## Description + +Number of the processed objects + +## Labels + +| Label | Description | +|:-------------:|:--------------| +| operator_name | Operator Name | diff --git a/docs/generated/metrics/arangodb_resources_deployment_config_map_duration.md b/docs/generated/metrics/arangodb_resources_deployment_config_map_duration.md new file mode 100644 index 000000000..856d6b269 --- /dev/null +++ b/docs/generated/metrics/arangodb_resources_deployment_config_map_duration.md @@ -0,0 +1,17 @@ +--- +layout: page +title: arangodb_resources_deployment_config_map_duration +parent: List of available metrics +--- + +# arangodb_resources_deployment_config_map_duration (Gauge) + +## Description + +Duration of inspected ConfigMaps by Deployment in seconds + +## Labels + +| Label | Description | +|:----------:|:----------------| +| deployment | Deployment Name | diff --git a/docs/generated/metrics/arangodb_resources_deployment_config_map_inspected.md b/docs/generated/metrics/arangodb_resources_deployment_config_map_inspected.md new file mode 100644 index 000000000..34b719489 --- /dev/null +++ b/docs/generated/metrics/arangodb_resources_deployment_config_map_inspected.md @@ -0,0 +1,17 @@ +--- +layout: page +title: arangodb_resources_deployment_config_map_inspected +parent: List of available metrics +--- + +# arangodb_resources_deployment_config_map_inspected (Counter) + +## Description + +Number of inspected ConfigMaps by Deployment + +## Labels + +| Label | Description | +|:----------:|:----------------| +| deployment | Deployment Name | diff --git a/internal/metrics.go b/internal/metrics.go index 466f544fe..a72a7b150 100644 --- a/internal/metrics.go +++ b/internal/metrics.go @@ -361,12 +361,12 @@ func generateMetricsGO(root string, in MetricsDoc) error { "fname": strings.Join(fnameParts, ""), "ename": strings.Join(tparts, ""), "shortDescription": details.ShortDescription, - "global": details.Global, "labels": generateLabels(details.Labels), "type": details.Type, "mapTypes": mapTypes, "mapKeys": mapKeys, "mapIKeys": mapIKeys, + "global": details.Global, "args": strings.Join(params[1:], ", "), "fparams": strings.Join(params, ", "), "fkeys": strings.Join(keys, ", "), diff --git a/internal/metrics.item.go.tmpl b/internal/metrics.item.go.tmpl index f042dfa8c..043969f29 100644 --- a/internal/metrics.item.go.tmpl +++ b/internal/metrics.item.go.tmpl @@ -23,154 +23,61 @@ package metric_descriptions import ( "github.com/arangodb/kube-arangodb/pkg/util/metrics" -{{- if .global }} - - "sync" -{{- end }} ) var ( {{ .fname }} = metrics.NewDescription("{{ .name }}", "{{ .shortDescription }}", {{ .labels }}, nil) +{{- if .global }} + + // Global Fields + global{{ .ename }}{{ .type }} = New{{ .ename }}{{ .type }}Factory() +{{- end }} ) func init() { registerDescription({{ .fname }}) {{- if .global }} - registerCollector({{ .fname }}Global) + registerCollector(global{{ .ename }}{{ .type }}) {{- end }} } - -func {{ .ename }}() metrics.Description { - return {{ .fname }} -} - {{- if .global }} -func {{ .ename }}Get({{ .args }}) float64 { - return {{ .fname }}Global.Get({{ .ename }}Item{ -{{- range $i, $field := .mapKeys }} - {{ $field }}: {{ index $root.mapIKeys $field }}, -{{- end }} - }) -} - -func {{ .ename }}Add({{ .fparams }}) { - {{ .fname }}Global.Add(value, {{ .ename }}Item{ -{{- range $i, $field := .mapKeys }} - {{ $field }}: {{ index $root.mapIKeys $field }}, -{{- end }} - }) -} -{{- if eq .type "Counter" }} - -func {{ .ename }}Inc({{ .args }}) { - {{ .fname }}Global.Inc({{ .ename }}Item{ -{{- range $i, $field := .mapKeys }} - {{ $field }}: {{ index $root.mapIKeys $field }}, -{{- end }} - }) +func Global{{ .ename }}{{ .type }}() metrics.Factory{{ .type }}[{{ .ename }}Input] { + return global{{ .ename }}{{ .type }} } {{- end }} -func Get{{ .ename }}Factory() {{ .ename }}Factory { - return {{ .fname }}Global -} -var {{ .fname }}Global = &{{ .fname }}Factory{ - items: {{ .fname }}Items{}, +func New{{ .ename }}{{ .type }}Factory() metrics.Factory{{ .type }}[{{ .ename }}Input] { + return metrics.NewFactory{{ .type }}[{{ .ename }}Input]() } -type {{ .ename }}Factory interface { - Get(object {{ .ename }}Item) float64 - Add(value float64, object {{ .ename }}Item) - Remove(object {{ .ename }}Item) - Items() []{{ .ename }}Item -{{- if eq .type "Counter" }} - - Inc(object {{ .ename }}Item) +func New{{ .ename }}Input({{- range $i, $e := .mapKeys }}{{ if $i }}, {{ end }}{{ index $root.mapIKeys . }} {{ index $root.mapTypes . }}{{- end }}) {{ .ename }}Input { + return {{ .ename }}Input{ +{{- range .mapKeys }} + {{ . }}: {{ index $root.mapIKeys . }}, {{- end }} -} - -type {{ .fname }}Factory struct { - lock sync.RWMutex - - items {{ .fname }}Items -} - -func (a *{{ .fname }}Factory) Get(object {{ .ename }}Item) float64 { - a.lock.Lock() - defer a.lock.Unlock() - - v, ok := a.items[object] - if !ok { - return 0 - } - - return v -} - -func (a *{{ .fname }}Factory) Add(value float64, object {{ .ename }}Item) { - a.lock.Lock() - defer a.lock.Unlock() - - v, ok := a.items[object] - if !ok { - a.items[object] = value - return - } - - a.items[object] = value + v -} - -func (a *{{ .fname }}Factory) Remove(obj {{ .ename }}Item) { - a.lock.Lock() - defer a.lock.Unlock() - - delete(a.items, obj) -} - -func (a *{{ .fname }}Factory) Items() []{{ .ename }}Item { - a.lock.Lock() - defer a.lock.Unlock() - - var r = make([]{{ .ename }}Item, 0, len(a.items)) - - for k := range a.items { - r = append(r, k) } - - return r } -{{- if eq .type "Counter" }} -func (a *{{ .fname }}Factory) Inc(object {{ .ename }}Item) { - a.Add(1, object) -} +type {{ .ename }}Input struct { +{{- range .mapKeys }} + {{ . }} {{ index $root.mapTypes . }} `json:"{{ index $root.mapIKeys . }}"` {{- end }} - -func (a *{{ .fname }}Factory) CollectMetrics(in metrics.PushMetric) { - a.lock.RLock() - defer a.lock.RUnlock() - - for k, v := range a.items { - in.Push({{ .fname }}.{{ .type }}(v{{- range .mapKeys }}, k.{{ . }}{{- end }})) - } } -func (a *{{ .fname }}Factory) CollectDescriptions(in metrics.PushDescription) { - in.Push({{ .fname }}) +func (i {{ .ename }}Input) {{ .type }}(value float64) metrics.Metric { + return {{ .ename }}{{ .type }}(value {{- range .mapKeys }}, i.{{ . }}{{- end }}) } -type {{ .fname }}Items map[{{ .ename }}Item]float64 +func (i {{ .ename }}Input) Desc() metrics.Description { + return {{ .ename }}() +} -type {{ .ename }}Item struct { -{{- range .mapKeys }} - {{ . }} {{ index $root.mapTypes . }} -{{- end }} +func {{ .ename }}() metrics.Description { + return {{ .fname }} } -{{- else }} func {{ .ename }}{{ .type }}({{ .fparams }}) metrics.Metric { return {{ .ename }}().{{ .type }}({{ .fkeys }}) } -{{- end }} diff --git a/internal/metrics.item.go_test.tmpl b/internal/metrics.item.go_test.tmpl index 4167a7156..c8d1a9467 100644 --- a/internal/metrics.item.go_test.tmpl +++ b/internal/metrics.item.go_test.tmpl @@ -23,28 +23,24 @@ package metric_descriptions import ( "testing" -{{- if .global }} "github.com/stretchr/testify/require" -{{- end }} ) func Test_{{ .ename }}_Descriptor(t *testing.T) { {{ .ename }}() } -{{- if .global }} - -func Test_{{ .ename }}_Global(t *testing.T) { - global := Get{{ .ename }}Factory() +func Test_{{ .ename }}_Factory(t *testing.T) { + global := New{{ .ename }}{{ .type }}Factory() - object1 := {{ .ename }}Item{ + object1 := {{ .ename }}Input{ {{- range $i, $field := .mapKeys }} {{ $field }}: "1", {{- end }} } - object2 := {{ .ename }}Item{ + object2 := {{ .ename }}Input{ {{- range $i, $field := .mapKeys }} {{ $field }}: "2", {{- end }} @@ -60,7 +56,7 @@ func Test_{{ .ename }}_Global(t *testing.T) { }) t.Run("Add", func(t *testing.T) { - global.Add(10, object1) + global.Add(object1, 10) require.EqualValues(t, 10, global.Get(object1)) require.EqualValues(t, 0, global.Get(object2)) @@ -71,7 +67,7 @@ func Test_{{ .ename }}_Global(t *testing.T) { }) t.Run("Add", func(t *testing.T) { - global.Add(3, object2) + global.Add(object2, 3) require.EqualValues(t, 10, global.Get(object1)) require.EqualValues(t, 3, global.Get(object2)) @@ -82,7 +78,7 @@ func Test_{{ .ename }}_Global(t *testing.T) { }) t.Run("Dec", func(t *testing.T) { - global.Add(-1, object1) + global.Add(object1, -1) require.EqualValues(t, 9, global.Get(object1)) require.EqualValues(t, 3, global.Get(object2)) @@ -127,16 +123,16 @@ func Test_{{ .ename }}_Global(t *testing.T) { } {{- if eq .type "Counter" }} -func Test_{{ .ename }}_Global_Counter(t *testing.T) { - global := Get{{ .ename }}Factory() +func Test_{{ .ename }}_Factory_Counter(t *testing.T) { + global := New{{ .ename }}{{ .type }}Factory() - object1 := {{ .ename }}Item{ + object1 := {{ .ename }}Input{ {{- range $i, $field := .mapKeys }} {{ $field }}: "1", {{- end }} } - object2 := {{ .ename }}Item{ + object2 := {{ .ename }}Input{ {{- range $i, $field := .mapKeys }} {{ $field }}: "2", {{- end }} @@ -152,7 +148,7 @@ func Test_{{ .ename }}_Global_Counter(t *testing.T) { }) t.Run("Add", func(t *testing.T) { - global.Add(10, object1) + global.Add(object1, 10) require.EqualValues(t, 10, global.Get(object1)) require.EqualValues(t, 0, global.Get(object2)) @@ -175,5 +171,54 @@ func Test_{{ .ename }}_Global_Counter(t *testing.T) { }) } {{- end }} +{{- if eq .type "Gauge" }} + +func Test_{{ .ename }}_Factory_Gauge(t *testing.T) { + global := New{{ .ename }}{{ .type }}Factory() + object1 := {{ .ename }}Input{ +{{- range $i, $field := .mapKeys }} + {{ $field }}: "1", {{- end }} + } + + object2 := {{ .ename }}Input{ +{{- range $i, $field := .mapKeys }} + {{ $field }}: "2", +{{- end }} + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} +{{- end }} + diff --git a/internal/metrics.yaml b/internal/metrics.yaml index c8bf25aa2..9f1a8b02a 100644 --- a/internal/metrics.yaml +++ b/internal/metrics.yaml @@ -1,7 +1,25 @@ documentation: docs/generated/metrics destination: pkg/generated/metric_descriptions namespaces: - arango_operator: + arangodb_resources: + deployment_config_map: + inspected: + shortDescription: "Number of inspected ConfigMaps by Deployment" + description: "Number of inspected ConfigMaps by Deployment" + type: "Counter" + global: true + labels: + - key: deployment + description: "Deployment Name" + duration: + shortDescription: "Duration of inspected ConfigMaps by Deployment in seconds" + description: "Duration of inspected ConfigMaps by Deployment in seconds" + type: "Gauge" + global: true + labels: + - key: deployment + description: "Deployment Name" + arangodb_operator: objects: processed: shortDescription: "Number of the processed objects" @@ -11,7 +29,6 @@ namespaces: labels: - key: operator_name description: "Operator Name" - arangodb_operator: agency_cache: present: shortDescription: "Determines if local agency cache is present" diff --git a/pkg/deployment/resources/config_maps.go b/pkg/deployment/resources/config_maps.go index 495ce477c..0fbf34d89 100644 --- a/pkg/deployment/resources/config_maps.go +++ b/pkg/deployment/resources/config_maps.go @@ -22,35 +22,28 @@ package resources import ( "context" - "time" "github.com/arangodb/kube-arangodb/pkg/deployment/features" - "github.com/arangodb/kube-arangodb/pkg/metrics" + "github.com/arangodb/kube-arangodb/pkg/generated/metric_descriptions" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" -) - -var ( - inspectedConfigMapsCounters = metrics.MustRegisterCounterVec(metricsComponent, "inspected_config_maps", "Number of ConfigMaps inspections per deployment", metrics.DeploymentName) - inspectConfigMapsDurationGauges = metrics.MustRegisterGaugeVec(metricsComponent, "inspect_config_maps_duration", "Amount of time taken by a single inspection of all ConfigMaps for a deployment (in sec)", metrics.DeploymentName) + "github.com/arangodb/kube-arangodb/pkg/util/metrics" ) // EnsureConfigMaps creates all ConfigMaps needed to run the given deployment func (r *Resources) EnsureConfigMaps(ctx context.Context, cachedStatus inspectorInterface.Inspector) error { - start := time.Now() spec := r.context.GetSpec() configMaps := cachedStatus.ConfigMapsModInterface().V1() apiObject := r.context.GetAPIObject() deploymentName := apiObject.GetName() - defer metrics.SetDuration(inspectConfigMapsDurationGauges.WithLabelValues(deploymentName), start) - counterMetric := inspectedConfigMapsCounters.WithLabelValues(deploymentName) + defer metrics.WithDuration(metric_descriptions.GlobalArangodbResourcesDeploymentConfigMapDurationGauge(), metric_descriptions.NewArangodbResourcesDeploymentConfigMapDurationInput(deploymentName)) reconcileRequired := k8sutil.NewReconcile(cachedStatus) if features.IsGatewayEnabled(spec) { - counterMetric.Inc() + metric_descriptions.GlobalArangodbResourcesDeploymentConfigMapInspectedCounter().Inc(metric_descriptions.NewArangodbResourcesDeploymentConfigMapInspectedInput(deploymentName)) if err := reconcileRequired.WithError(r.ensureGatewayConfig(ctx, cachedStatus, configMaps)); err != nil { return errors.Section(err, "Gateway ConfigMap") } diff --git a/pkg/generated/metric_descriptions/arango_operator_objects_processed.go b/pkg/generated/metric_descriptions/arango_operator_objects_processed.go deleted file mode 100644 index 6408598a2..000000000 --- a/pkg/generated/metric_descriptions/arango_operator_objects_processed.go +++ /dev/null @@ -1,149 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - -package metric_descriptions - -import ( - "sync" - - "github.com/arangodb/kube-arangodb/pkg/util/metrics" -) - -var ( - arangoOperatorObjectsProcessed = metrics.NewDescription("arango_operator_objects_processed", "Number of the processed objects", []string{`operator_name`}, nil) -) - -func init() { - registerDescription(arangoOperatorObjectsProcessed) - registerCollector(arangoOperatorObjectsProcessedGlobal) -} - -func ArangoOperatorObjectsProcessed() metrics.Description { - return arangoOperatorObjectsProcessed -} - -func ArangoOperatorObjectsProcessedGet(operatorName string) float64 { - return arangoOperatorObjectsProcessedGlobal.Get(ArangoOperatorObjectsProcessedItem{ - OperatorName: operatorName, - }) -} - -func ArangoOperatorObjectsProcessedAdd(value float64, operatorName string) { - arangoOperatorObjectsProcessedGlobal.Add(value, ArangoOperatorObjectsProcessedItem{ - OperatorName: operatorName, - }) -} - -func ArangoOperatorObjectsProcessedInc(operatorName string) { - arangoOperatorObjectsProcessedGlobal.Inc(ArangoOperatorObjectsProcessedItem{ - OperatorName: operatorName, - }) -} - -func GetArangoOperatorObjectsProcessedFactory() ArangoOperatorObjectsProcessedFactory { - return arangoOperatorObjectsProcessedGlobal -} - -var arangoOperatorObjectsProcessedGlobal = &arangoOperatorObjectsProcessedFactory{ - items: arangoOperatorObjectsProcessedItems{}, -} - -type ArangoOperatorObjectsProcessedFactory interface { - Get(object ArangoOperatorObjectsProcessedItem) float64 - Add(value float64, object ArangoOperatorObjectsProcessedItem) - Remove(object ArangoOperatorObjectsProcessedItem) - Items() []ArangoOperatorObjectsProcessedItem - - Inc(object ArangoOperatorObjectsProcessedItem) -} - -type arangoOperatorObjectsProcessedFactory struct { - lock sync.RWMutex - - items arangoOperatorObjectsProcessedItems -} - -func (a *arangoOperatorObjectsProcessedFactory) Get(object ArangoOperatorObjectsProcessedItem) float64 { - a.lock.Lock() - defer a.lock.Unlock() - - v, ok := a.items[object] - if !ok { - return 0 - } - - return v -} - -func (a *arangoOperatorObjectsProcessedFactory) Add(value float64, object ArangoOperatorObjectsProcessedItem) { - a.lock.Lock() - defer a.lock.Unlock() - - v, ok := a.items[object] - if !ok { - a.items[object] = value - return - } - - a.items[object] = value + v -} - -func (a *arangoOperatorObjectsProcessedFactory) Remove(obj ArangoOperatorObjectsProcessedItem) { - a.lock.Lock() - defer a.lock.Unlock() - - delete(a.items, obj) -} - -func (a *arangoOperatorObjectsProcessedFactory) Items() []ArangoOperatorObjectsProcessedItem { - a.lock.Lock() - defer a.lock.Unlock() - - var r = make([]ArangoOperatorObjectsProcessedItem, 0, len(a.items)) - - for k := range a.items { - r = append(r, k) - } - - return r -} - -func (a *arangoOperatorObjectsProcessedFactory) Inc(object ArangoOperatorObjectsProcessedItem) { - a.Add(1, object) -} - -func (a *arangoOperatorObjectsProcessedFactory) CollectMetrics(in metrics.PushMetric) { - a.lock.RLock() - defer a.lock.RUnlock() - - for k, v := range a.items { - in.Push(arangoOperatorObjectsProcessed.Counter(v, k.OperatorName)) - } -} - -func (a *arangoOperatorObjectsProcessedFactory) CollectDescriptions(in metrics.PushDescription) { - in.Push(arangoOperatorObjectsProcessed) -} - -type arangoOperatorObjectsProcessedItems map[ArangoOperatorObjectsProcessedItem]float64 - -type ArangoOperatorObjectsProcessedItem struct { - OperatorName string -} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go index 76943135d..6ae148012 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorAgencyCacheHealthPresent) } +func NewArangodbOperatorAgencyCacheHealthPresentGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyCacheHealthPresentInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyCacheHealthPresentInput]() +} + +func NewArangodbOperatorAgencyCacheHealthPresentInput(namespace string, name string) ArangodbOperatorAgencyCacheHealthPresentInput { + return ArangodbOperatorAgencyCacheHealthPresentInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorAgencyCacheHealthPresentInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorAgencyCacheHealthPresentInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyCacheHealthPresentGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorAgencyCacheHealthPresentInput) Desc() metrics.Description { + return ArangodbOperatorAgencyCacheHealthPresent() +} + func ArangodbOperatorAgencyCacheHealthPresent() metrics.Description { return arangodbOperatorAgencyCacheHealthPresent } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present_test.go index e5309f5be..b0203d8df 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyCacheHealthPresent_Descriptor(t *testing.T) { ArangodbOperatorAgencyCacheHealthPresent() } + +func Test_ArangodbOperatorAgencyCacheHealthPresent_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyCacheHealthPresentGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheHealthPresentInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCacheHealthPresentInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyCacheHealthPresent_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyCacheHealthPresentGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheHealthPresentInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCacheHealthPresentInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go index a78f59495..a96d07432 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorAgencyCacheHealthy) } +func NewArangodbOperatorAgencyCacheHealthyGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyCacheHealthyInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyCacheHealthyInput]() +} + +func NewArangodbOperatorAgencyCacheHealthyInput(namespace string, name string) ArangodbOperatorAgencyCacheHealthyInput { + return ArangodbOperatorAgencyCacheHealthyInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorAgencyCacheHealthyInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorAgencyCacheHealthyInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyCacheHealthyGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorAgencyCacheHealthyInput) Desc() metrics.Description { + return ArangodbOperatorAgencyCacheHealthy() +} + func ArangodbOperatorAgencyCacheHealthy() metrics.Description { return arangodbOperatorAgencyCacheHealthy } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy_test.go index c1a6f057e..2deda701a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyCacheHealthy_Descriptor(t *testing.T) { ArangodbOperatorAgencyCacheHealthy() } + +func Test_ArangodbOperatorAgencyCacheHealthy_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyCacheHealthyGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheHealthyInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCacheHealthyInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyCacheHealthy_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyCacheHealthyGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheHealthyInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCacheHealthyInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go index 44d0d104a..ffe945cdb 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go @@ -32,6 +32,32 @@ func init() { registerDescription(arangodbOperatorAgencyCacheLeaders) } +func NewArangodbOperatorAgencyCacheLeadersGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyCacheLeadersInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyCacheLeadersInput]() +} + +func NewArangodbOperatorAgencyCacheLeadersInput(namespace string, name string, agent string) ArangodbOperatorAgencyCacheLeadersInput { + return ArangodbOperatorAgencyCacheLeadersInput{ + Namespace: namespace, + Name: name, + Agent: agent, + } +} + +type ArangodbOperatorAgencyCacheLeadersInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` + Agent string `json:"agent"` +} + +func (i ArangodbOperatorAgencyCacheLeadersInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyCacheLeadersGauge(value, i.Namespace, i.Name, i.Agent) +} + +func (i ArangodbOperatorAgencyCacheLeadersInput) Desc() metrics.Description { + return ArangodbOperatorAgencyCacheLeaders() +} + func ArangodbOperatorAgencyCacheLeaders() metrics.Description { return arangodbOperatorAgencyCacheLeaders } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders_test.go index 358a9c6e3..8f4584c4b 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders_test.go @@ -22,8 +22,149 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyCacheLeaders_Descriptor(t *testing.T) { ArangodbOperatorAgencyCacheLeaders() } + +func Test_ArangodbOperatorAgencyCacheLeaders_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyCacheLeadersGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheLeadersInput{ + Namespace: "1", + Name: "1", + Agent: "1", + } + + object2 := ArangodbOperatorAgencyCacheLeadersInput{ + Namespace: "2", + Name: "2", + Agent: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyCacheLeaders_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyCacheLeadersGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheLeadersInput{ + Namespace: "1", + Name: "1", + Agent: "1", + } + + object2 := ArangodbOperatorAgencyCacheLeadersInput{ + Namespace: "2", + Name: "2", + Agent: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go index b1d024ade..a9266c730 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go @@ -32,6 +32,32 @@ func init() { registerDescription(arangodbOperatorAgencyCacheMemberCommitOffset) } +func NewArangodbOperatorAgencyCacheMemberCommitOffsetGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyCacheMemberCommitOffsetInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyCacheMemberCommitOffsetInput]() +} + +func NewArangodbOperatorAgencyCacheMemberCommitOffsetInput(namespace string, name string, agent string) ArangodbOperatorAgencyCacheMemberCommitOffsetInput { + return ArangodbOperatorAgencyCacheMemberCommitOffsetInput{ + Namespace: namespace, + Name: name, + Agent: agent, + } +} + +type ArangodbOperatorAgencyCacheMemberCommitOffsetInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` + Agent string `json:"agent"` +} + +func (i ArangodbOperatorAgencyCacheMemberCommitOffsetInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyCacheMemberCommitOffsetGauge(value, i.Namespace, i.Name, i.Agent) +} + +func (i ArangodbOperatorAgencyCacheMemberCommitOffsetInput) Desc() metrics.Description { + return ArangodbOperatorAgencyCacheMemberCommitOffset() +} + func ArangodbOperatorAgencyCacheMemberCommitOffset() metrics.Description { return arangodbOperatorAgencyCacheMemberCommitOffset } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset_test.go index 575d30893..b8e774c88 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset_test.go @@ -22,8 +22,149 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyCacheMemberCommitOffset_Descriptor(t *testing.T) { ArangodbOperatorAgencyCacheMemberCommitOffset() } + +func Test_ArangodbOperatorAgencyCacheMemberCommitOffset_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyCacheMemberCommitOffsetGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheMemberCommitOffsetInput{ + Namespace: "1", + Name: "1", + Agent: "1", + } + + object2 := ArangodbOperatorAgencyCacheMemberCommitOffsetInput{ + Namespace: "2", + Name: "2", + Agent: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyCacheMemberCommitOffset_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyCacheMemberCommitOffsetGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheMemberCommitOffsetInput{ + Namespace: "1", + Name: "1", + Agent: "1", + } + + object2 := ArangodbOperatorAgencyCacheMemberCommitOffsetInput{ + Namespace: "2", + Name: "2", + Agent: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go index e61ade3ab..a4dc80aaa 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go @@ -32,6 +32,32 @@ func init() { registerDescription(arangodbOperatorAgencyCacheMemberServing) } +func NewArangodbOperatorAgencyCacheMemberServingGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyCacheMemberServingInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyCacheMemberServingInput]() +} + +func NewArangodbOperatorAgencyCacheMemberServingInput(namespace string, name string, agent string) ArangodbOperatorAgencyCacheMemberServingInput { + return ArangodbOperatorAgencyCacheMemberServingInput{ + Namespace: namespace, + Name: name, + Agent: agent, + } +} + +type ArangodbOperatorAgencyCacheMemberServingInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` + Agent string `json:"agent"` +} + +func (i ArangodbOperatorAgencyCacheMemberServingInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyCacheMemberServingGauge(value, i.Namespace, i.Name, i.Agent) +} + +func (i ArangodbOperatorAgencyCacheMemberServingInput) Desc() metrics.Description { + return ArangodbOperatorAgencyCacheMemberServing() +} + func ArangodbOperatorAgencyCacheMemberServing() metrics.Description { return arangodbOperatorAgencyCacheMemberServing } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving_test.go index 34d1665c5..7c4742bd0 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving_test.go @@ -22,8 +22,149 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyCacheMemberServing_Descriptor(t *testing.T) { ArangodbOperatorAgencyCacheMemberServing() } + +func Test_ArangodbOperatorAgencyCacheMemberServing_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyCacheMemberServingGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheMemberServingInput{ + Namespace: "1", + Name: "1", + Agent: "1", + } + + object2 := ArangodbOperatorAgencyCacheMemberServingInput{ + Namespace: "2", + Name: "2", + Agent: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyCacheMemberServing_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyCacheMemberServingGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheMemberServingInput{ + Namespace: "1", + Name: "1", + Agent: "1", + } + + object2 := ArangodbOperatorAgencyCacheMemberServingInput{ + Namespace: "2", + Name: "2", + Agent: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go index 24cb88aed..695988bf0 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorAgencyCachePresent) } +func NewArangodbOperatorAgencyCachePresentGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyCachePresentInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyCachePresentInput]() +} + +func NewArangodbOperatorAgencyCachePresentInput(namespace string, name string) ArangodbOperatorAgencyCachePresentInput { + return ArangodbOperatorAgencyCachePresentInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorAgencyCachePresentInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorAgencyCachePresentInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyCachePresentGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorAgencyCachePresentInput) Desc() metrics.Description { + return ArangodbOperatorAgencyCachePresent() +} + func ArangodbOperatorAgencyCachePresent() metrics.Description { return arangodbOperatorAgencyCachePresent } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present_test.go index 04ef1b512..9c3f2ca93 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyCachePresent_Descriptor(t *testing.T) { ArangodbOperatorAgencyCachePresent() } + +func Test_ArangodbOperatorAgencyCachePresent_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyCachePresentGaugeFactory() + + object1 := ArangodbOperatorAgencyCachePresentInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCachePresentInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyCachePresent_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyCachePresentGaugeFactory() + + object1 := ArangodbOperatorAgencyCachePresentInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCachePresentInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go index f38b126fd..4a1958d9a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorAgencyCacheServing) } +func NewArangodbOperatorAgencyCacheServingGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyCacheServingInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyCacheServingInput]() +} + +func NewArangodbOperatorAgencyCacheServingInput(namespace string, name string) ArangodbOperatorAgencyCacheServingInput { + return ArangodbOperatorAgencyCacheServingInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorAgencyCacheServingInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorAgencyCacheServingInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyCacheServingGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorAgencyCacheServingInput) Desc() metrics.Description { + return ArangodbOperatorAgencyCacheServing() +} + func ArangodbOperatorAgencyCacheServing() metrics.Description { return arangodbOperatorAgencyCacheServing } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving_test.go index 59daee1f6..13ea735fd 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyCacheServing_Descriptor(t *testing.T) { ArangodbOperatorAgencyCacheServing() } + +func Test_ArangodbOperatorAgencyCacheServing_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyCacheServingGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheServingInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCacheServingInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyCacheServing_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyCacheServingGaugeFactory() + + object1 := ArangodbOperatorAgencyCacheServingInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyCacheServingInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go index 232fbee0c..2d0bf3a7a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorAgencyErrors) } +func NewArangodbOperatorAgencyErrorsCounterFactory() metrics.FactoryCounter[ArangodbOperatorAgencyErrorsInput] { + return metrics.NewFactoryCounter[ArangodbOperatorAgencyErrorsInput]() +} + +func NewArangodbOperatorAgencyErrorsInput(namespace string, name string) ArangodbOperatorAgencyErrorsInput { + return ArangodbOperatorAgencyErrorsInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorAgencyErrorsInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorAgencyErrorsInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorAgencyErrorsCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorAgencyErrorsInput) Desc() metrics.Description { + return ArangodbOperatorAgencyErrors() +} + func ArangodbOperatorAgencyErrors() metrics.Description { return arangodbOperatorAgencyErrors } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_errors_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_errors_test.go index afbb31371..e6697204f 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_errors_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_errors_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyErrors_Descriptor(t *testing.T) { ArangodbOperatorAgencyErrors() } + +func Test_ArangodbOperatorAgencyErrors_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyErrorsCounterFactory() + + object1 := ArangodbOperatorAgencyErrorsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyErrorsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyErrors_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorAgencyErrorsCounterFactory() + + object1 := ArangodbOperatorAgencyErrorsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyErrorsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go index bac0258b4..413791541 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorAgencyFetches) } +func NewArangodbOperatorAgencyFetchesCounterFactory() metrics.FactoryCounter[ArangodbOperatorAgencyFetchesInput] { + return metrics.NewFactoryCounter[ArangodbOperatorAgencyFetchesInput]() +} + +func NewArangodbOperatorAgencyFetchesInput(namespace string, name string) ArangodbOperatorAgencyFetchesInput { + return ArangodbOperatorAgencyFetchesInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorAgencyFetchesInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorAgencyFetchesInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorAgencyFetchesCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorAgencyFetchesInput) Desc() metrics.Description { + return ArangodbOperatorAgencyFetches() +} + func ArangodbOperatorAgencyFetches() metrics.Description { return arangodbOperatorAgencyFetches } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches_test.go index f0a744812..e5b7c4df5 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyFetches_Descriptor(t *testing.T) { ArangodbOperatorAgencyFetches() } + +func Test_ArangodbOperatorAgencyFetches_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyFetchesCounterFactory() + + object1 := ArangodbOperatorAgencyFetchesInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyFetchesInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyFetches_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorAgencyFetchesCounterFactory() + + object1 := ArangodbOperatorAgencyFetchesInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyFetchesInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go index 4ca0b865a..d35bc7672 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorAgencyIndex) } +func NewArangodbOperatorAgencyIndexGaugeFactory() metrics.FactoryGauge[ArangodbOperatorAgencyIndexInput] { + return metrics.NewFactoryGauge[ArangodbOperatorAgencyIndexInput]() +} + +func NewArangodbOperatorAgencyIndexInput(namespace string, name string) ArangodbOperatorAgencyIndexInput { + return ArangodbOperatorAgencyIndexInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorAgencyIndexInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorAgencyIndexInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorAgencyIndexGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorAgencyIndexInput) Desc() metrics.Description { + return ArangodbOperatorAgencyIndex() +} + func ArangodbOperatorAgencyIndex() metrics.Description { return arangodbOperatorAgencyIndex } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_index_test.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_index_test.go index 4ae14ead1..9143f05c1 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_index_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_index_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorAgencyIndex_Descriptor(t *testing.T) { ArangodbOperatorAgencyIndex() } + +func Test_ArangodbOperatorAgencyIndex_Factory(t *testing.T) { + global := NewArangodbOperatorAgencyIndexGaugeFactory() + + object1 := ArangodbOperatorAgencyIndexInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyIndexInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorAgencyIndex_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorAgencyIndexGaugeFactory() + + object1 := ArangodbOperatorAgencyIndexInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorAgencyIndexInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go b/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go index 75172048b..9aa6a820f 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go @@ -32,6 +32,32 @@ func init() { registerDescription(arangodbOperatorDeploymentConditions) } +func NewArangodbOperatorDeploymentConditionsGaugeFactory() metrics.FactoryGauge[ArangodbOperatorDeploymentConditionsInput] { + return metrics.NewFactoryGauge[ArangodbOperatorDeploymentConditionsInput]() +} + +func NewArangodbOperatorDeploymentConditionsInput(namespace string, name string, condition string) ArangodbOperatorDeploymentConditionsInput { + return ArangodbOperatorDeploymentConditionsInput{ + Namespace: namespace, + Name: name, + Condition: condition, + } +} + +type ArangodbOperatorDeploymentConditionsInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` + Condition string `json:"condition"` +} + +func (i ArangodbOperatorDeploymentConditionsInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorDeploymentConditionsGauge(value, i.Namespace, i.Name, i.Condition) +} + +func (i ArangodbOperatorDeploymentConditionsInput) Desc() metrics.Description { + return ArangodbOperatorDeploymentConditions() +} + func ArangodbOperatorDeploymentConditions() metrics.Description { return arangodbOperatorDeploymentConditions } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions_test.go b/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions_test.go index 81360d516..951b248ee 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions_test.go @@ -22,8 +22,149 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorDeploymentConditions_Descriptor(t *testing.T) { ArangodbOperatorDeploymentConditions() } + +func Test_ArangodbOperatorDeploymentConditions_Factory(t *testing.T) { + global := NewArangodbOperatorDeploymentConditionsGaugeFactory() + + object1 := ArangodbOperatorDeploymentConditionsInput{ + Namespace: "1", + Name: "1", + Condition: "1", + } + + object2 := ArangodbOperatorDeploymentConditionsInput{ + Namespace: "2", + Name: "2", + Condition: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorDeploymentConditions_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorDeploymentConditionsGaugeFactory() + + object1 := ArangodbOperatorDeploymentConditionsInput{ + Namespace: "1", + Name: "1", + Condition: "1", + } + + object2 := ArangodbOperatorDeploymentConditionsInput{ + Namespace: "2", + Name: "2", + Condition: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go index 1d73982a8..122263d82 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go @@ -32,6 +32,28 @@ func init() { registerDescription(arangodbOperatorEngineAssertions) } +func NewArangodbOperatorEngineAssertionsCounterFactory() metrics.FactoryCounter[ArangodbOperatorEngineAssertionsInput] { + return metrics.NewFactoryCounter[ArangodbOperatorEngineAssertionsInput]() +} + +func NewArangodbOperatorEngineAssertionsInput(key string) ArangodbOperatorEngineAssertionsInput { + return ArangodbOperatorEngineAssertionsInput{ + Key: key, + } +} + +type ArangodbOperatorEngineAssertionsInput struct { + Key string `json:"key"` +} + +func (i ArangodbOperatorEngineAssertionsInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorEngineAssertionsCounter(value, i.Key) +} + +func (i ArangodbOperatorEngineAssertionsInput) Desc() metrics.Description { + return ArangodbOperatorEngineAssertions() +} + func ArangodbOperatorEngineAssertions() metrics.Description { return arangodbOperatorEngineAssertions } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions_test.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions_test.go index 84655550a..9dd38051a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions_test.go @@ -22,8 +22,141 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorEngineAssertions_Descriptor(t *testing.T) { ArangodbOperatorEngineAssertions() } + +func Test_ArangodbOperatorEngineAssertions_Factory(t *testing.T) { + global := NewArangodbOperatorEngineAssertionsCounterFactory() + + object1 := ArangodbOperatorEngineAssertionsInput{ + Key: "1", + } + + object2 := ArangodbOperatorEngineAssertionsInput{ + Key: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorEngineAssertions_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorEngineAssertionsCounterFactory() + + object1 := ArangodbOperatorEngineAssertionsInput{ + Key: "1", + } + + object2 := ArangodbOperatorEngineAssertionsInput{ + Key: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go index b44159890..a87b7a4bc 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorEngineOpsAlerts) } +func NewArangodbOperatorEngineOpsAlertsCounterFactory() metrics.FactoryCounter[ArangodbOperatorEngineOpsAlertsInput] { + return metrics.NewFactoryCounter[ArangodbOperatorEngineOpsAlertsInput]() +} + +func NewArangodbOperatorEngineOpsAlertsInput(namespace string, name string) ArangodbOperatorEngineOpsAlertsInput { + return ArangodbOperatorEngineOpsAlertsInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorEngineOpsAlertsInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorEngineOpsAlertsInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorEngineOpsAlertsCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorEngineOpsAlertsInput) Desc() metrics.Description { + return ArangodbOperatorEngineOpsAlerts() +} + func ArangodbOperatorEngineOpsAlerts() metrics.Description { return arangodbOperatorEngineOpsAlerts } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts_test.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts_test.go index 7042cf63a..c7c115541 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorEngineOpsAlerts_Descriptor(t *testing.T) { ArangodbOperatorEngineOpsAlerts() } + +func Test_ArangodbOperatorEngineOpsAlerts_Factory(t *testing.T) { + global := NewArangodbOperatorEngineOpsAlertsCounterFactory() + + object1 := ArangodbOperatorEngineOpsAlertsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorEngineOpsAlertsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorEngineOpsAlerts_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorEngineOpsAlertsCounterFactory() + + object1 := ArangodbOperatorEngineOpsAlertsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorEngineOpsAlertsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go index 5aae6d6fa..689e49a4d 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go @@ -32,6 +32,28 @@ func init() { registerDescription(arangodbOperatorEnginePanicsRecovered) } +func NewArangodbOperatorEnginePanicsRecoveredCounterFactory() metrics.FactoryCounter[ArangodbOperatorEnginePanicsRecoveredInput] { + return metrics.NewFactoryCounter[ArangodbOperatorEnginePanicsRecoveredInput]() +} + +func NewArangodbOperatorEnginePanicsRecoveredInput(section string) ArangodbOperatorEnginePanicsRecoveredInput { + return ArangodbOperatorEnginePanicsRecoveredInput{ + Section: section, + } +} + +type ArangodbOperatorEnginePanicsRecoveredInput struct { + Section string `json:"section"` +} + +func (i ArangodbOperatorEnginePanicsRecoveredInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorEnginePanicsRecoveredCounter(value, i.Section) +} + +func (i ArangodbOperatorEnginePanicsRecoveredInput) Desc() metrics.Description { + return ArangodbOperatorEnginePanicsRecovered() +} + func ArangodbOperatorEnginePanicsRecovered() metrics.Description { return arangodbOperatorEnginePanicsRecovered } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered_test.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered_test.go index 1fb1c4ef5..dbee6979c 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered_test.go @@ -22,8 +22,141 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorEnginePanicsRecovered_Descriptor(t *testing.T) { ArangodbOperatorEnginePanicsRecovered() } + +func Test_ArangodbOperatorEnginePanicsRecovered_Factory(t *testing.T) { + global := NewArangodbOperatorEnginePanicsRecoveredCounterFactory() + + object1 := ArangodbOperatorEnginePanicsRecoveredInput{ + Section: "1", + } + + object2 := ArangodbOperatorEnginePanicsRecoveredInput{ + Section: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorEnginePanicsRecovered_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorEnginePanicsRecoveredCounterFactory() + + object1 := ArangodbOperatorEnginePanicsRecoveredInput{ + Section: "1", + } + + object2 := ArangodbOperatorEnginePanicsRecoveredInput{ + Section: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go index 406a0b24b..c730c736e 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorKubernetesClientRequestErrors) } +func NewArangodbOperatorKubernetesClientRequestErrorsCounterFactory() metrics.FactoryCounter[ArangodbOperatorKubernetesClientRequestErrorsInput] { + return metrics.NewFactoryCounter[ArangodbOperatorKubernetesClientRequestErrorsInput]() +} + +func NewArangodbOperatorKubernetesClientRequestErrorsInput(component string, verb string) ArangodbOperatorKubernetesClientRequestErrorsInput { + return ArangodbOperatorKubernetesClientRequestErrorsInput{ + Component: component, + Verb: verb, + } +} + +type ArangodbOperatorKubernetesClientRequestErrorsInput struct { + Component string `json:"component"` + Verb string `json:"verb"` +} + +func (i ArangodbOperatorKubernetesClientRequestErrorsInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorKubernetesClientRequestErrorsCounter(value, i.Component, i.Verb) +} + +func (i ArangodbOperatorKubernetesClientRequestErrorsInput) Desc() metrics.Description { + return ArangodbOperatorKubernetesClientRequestErrors() +} + func ArangodbOperatorKubernetesClientRequestErrors() metrics.Description { return arangodbOperatorKubernetesClientRequestErrors } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors_test.go b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors_test.go index 130dca568..575709087 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorKubernetesClientRequestErrors_Descriptor(t *testing.T) { ArangodbOperatorKubernetesClientRequestErrors() } + +func Test_ArangodbOperatorKubernetesClientRequestErrors_Factory(t *testing.T) { + global := NewArangodbOperatorKubernetesClientRequestErrorsCounterFactory() + + object1 := ArangodbOperatorKubernetesClientRequestErrorsInput{ + Component: "1", + Verb: "1", + } + + object2 := ArangodbOperatorKubernetesClientRequestErrorsInput{ + Component: "2", + Verb: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorKubernetesClientRequestErrors_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorKubernetesClientRequestErrorsCounterFactory() + + object1 := ArangodbOperatorKubernetesClientRequestErrorsInput{ + Component: "1", + Verb: "1", + } + + object2 := ArangodbOperatorKubernetesClientRequestErrorsInput{ + Component: "2", + Verb: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go index 225cb2516..f39b0686b 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorKubernetesClientRequests) } +func NewArangodbOperatorKubernetesClientRequestsCounterFactory() metrics.FactoryCounter[ArangodbOperatorKubernetesClientRequestsInput] { + return metrics.NewFactoryCounter[ArangodbOperatorKubernetesClientRequestsInput]() +} + +func NewArangodbOperatorKubernetesClientRequestsInput(component string, verb string) ArangodbOperatorKubernetesClientRequestsInput { + return ArangodbOperatorKubernetesClientRequestsInput{ + Component: component, + Verb: verb, + } +} + +type ArangodbOperatorKubernetesClientRequestsInput struct { + Component string `json:"component"` + Verb string `json:"verb"` +} + +func (i ArangodbOperatorKubernetesClientRequestsInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorKubernetesClientRequestsCounter(value, i.Component, i.Verb) +} + +func (i ArangodbOperatorKubernetesClientRequestsInput) Desc() metrics.Description { + return ArangodbOperatorKubernetesClientRequests() +} + func ArangodbOperatorKubernetesClientRequests() metrics.Description { return arangodbOperatorKubernetesClientRequests } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests_test.go b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests_test.go index 58709fb0f..6c8a3eaf8 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorKubernetesClientRequests_Descriptor(t *testing.T) { ArangodbOperatorKubernetesClientRequests() } + +func Test_ArangodbOperatorKubernetesClientRequests_Factory(t *testing.T) { + global := NewArangodbOperatorKubernetesClientRequestsCounterFactory() + + object1 := ArangodbOperatorKubernetesClientRequestsInput{ + Component: "1", + Verb: "1", + } + + object2 := ArangodbOperatorKubernetesClientRequestsInput{ + Component: "2", + Verb: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorKubernetesClientRequests_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorKubernetesClientRequestsCounterFactory() + + object1 := ArangodbOperatorKubernetesClientRequestsInput{ + Component: "1", + Verb: "1", + } + + object2 := ArangodbOperatorKubernetesClientRequestsInput{ + Component: "2", + Verb: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go b/pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go index 453f5e35a..a4ceddd5f 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go @@ -32,6 +32,34 @@ func init() { registerDescription(arangodbOperatorMembersConditions) } +func NewArangodbOperatorMembersConditionsGaugeFactory() metrics.FactoryGauge[ArangodbOperatorMembersConditionsInput] { + return metrics.NewFactoryGauge[ArangodbOperatorMembersConditionsInput]() +} + +func NewArangodbOperatorMembersConditionsInput(namespace string, name string, member string, condition string) ArangodbOperatorMembersConditionsInput { + return ArangodbOperatorMembersConditionsInput{ + Namespace: namespace, + Name: name, + Member: member, + Condition: condition, + } +} + +type ArangodbOperatorMembersConditionsInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` + Member string `json:"member"` + Condition string `json:"condition"` +} + +func (i ArangodbOperatorMembersConditionsInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorMembersConditionsGauge(value, i.Namespace, i.Name, i.Member, i.Condition) +} + +func (i ArangodbOperatorMembersConditionsInput) Desc() metrics.Description { + return ArangodbOperatorMembersConditions() +} + func ArangodbOperatorMembersConditions() metrics.Description { return arangodbOperatorMembersConditions } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_members_conditions_test.go b/pkg/generated/metric_descriptions/arangodb_operator_members_conditions_test.go index dd6973530..be3b09e30 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_members_conditions_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_members_conditions_test.go @@ -22,8 +22,153 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorMembersConditions_Descriptor(t *testing.T) { ArangodbOperatorMembersConditions() } + +func Test_ArangodbOperatorMembersConditions_Factory(t *testing.T) { + global := NewArangodbOperatorMembersConditionsGaugeFactory() + + object1 := ArangodbOperatorMembersConditionsInput{ + Namespace: "1", + Name: "1", + Member: "1", + Condition: "1", + } + + object2 := ArangodbOperatorMembersConditionsInput{ + Namespace: "2", + Name: "2", + Member: "2", + Condition: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorMembersConditions_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorMembersConditionsGaugeFactory() + + object1 := ArangodbOperatorMembersConditionsInput{ + Namespace: "1", + Name: "1", + Member: "1", + Condition: "1", + } + + object2 := ArangodbOperatorMembersConditionsInput{ + Namespace: "2", + Name: "2", + Member: "2", + Condition: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go b/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go index 925ce528d..a7c290853 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go @@ -32,6 +32,40 @@ func init() { registerDescription(arangodbOperatorMembersUnexpectedContainerExitCodes) } +func NewArangodbOperatorMembersUnexpectedContainerExitCodesCounterFactory() metrics.FactoryCounter[ArangodbOperatorMembersUnexpectedContainerExitCodesInput] { + return metrics.NewFactoryCounter[ArangodbOperatorMembersUnexpectedContainerExitCodesInput]() +} + +func NewArangodbOperatorMembersUnexpectedContainerExitCodesInput(namespace string, name string, member string, container string, containerType string, code string, reason string) ArangodbOperatorMembersUnexpectedContainerExitCodesInput { + return ArangodbOperatorMembersUnexpectedContainerExitCodesInput{ + Namespace: namespace, + Name: name, + Member: member, + Container: container, + ContainerType: containerType, + Code: code, + Reason: reason, + } +} + +type ArangodbOperatorMembersUnexpectedContainerExitCodesInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` + Member string `json:"member"` + Container string `json:"container"` + ContainerType string `json:"containerType"` + Code string `json:"code"` + Reason string `json:"reason"` +} + +func (i ArangodbOperatorMembersUnexpectedContainerExitCodesInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorMembersUnexpectedContainerExitCodesCounter(value, i.Namespace, i.Name, i.Member, i.Container, i.ContainerType, i.Code, i.Reason) +} + +func (i ArangodbOperatorMembersUnexpectedContainerExitCodesInput) Desc() metrics.Description { + return ArangodbOperatorMembersUnexpectedContainerExitCodes() +} + func ArangodbOperatorMembersUnexpectedContainerExitCodes() metrics.Description { return arangodbOperatorMembersUnexpectedContainerExitCodes } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes_test.go b/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes_test.go index 1038437ec..a5d3b230a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes_test.go @@ -22,8 +22,165 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorMembersUnexpectedContainerExitCodes_Descriptor(t *testing.T) { ArangodbOperatorMembersUnexpectedContainerExitCodes() } + +func Test_ArangodbOperatorMembersUnexpectedContainerExitCodes_Factory(t *testing.T) { + global := NewArangodbOperatorMembersUnexpectedContainerExitCodesCounterFactory() + + object1 := ArangodbOperatorMembersUnexpectedContainerExitCodesInput{ + Namespace: "1", + Name: "1", + Member: "1", + Container: "1", + ContainerType: "1", + Code: "1", + Reason: "1", + } + + object2 := ArangodbOperatorMembersUnexpectedContainerExitCodesInput{ + Namespace: "2", + Name: "2", + Member: "2", + Container: "2", + ContainerType: "2", + Code: "2", + Reason: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorMembersUnexpectedContainerExitCodes_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorMembersUnexpectedContainerExitCodesCounterFactory() + + object1 := ArangodbOperatorMembersUnexpectedContainerExitCodesInput{ + Namespace: "1", + Name: "1", + Member: "1", + Container: "1", + ContainerType: "1", + Code: "1", + Reason: "1", + } + + object2 := ArangodbOperatorMembersUnexpectedContainerExitCodesInput{ + Namespace: "2", + Name: "2", + Member: "2", + Container: "2", + ContainerType: "2", + Code: "2", + Reason: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_objects_processed.go b/pkg/generated/metric_descriptions/arangodb_operator_objects_processed.go new file mode 100644 index 000000000..0ed680e9e --- /dev/null +++ b/pkg/generated/metric_descriptions/arangodb_operator_objects_processed.go @@ -0,0 +1,71 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metric_descriptions + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/metrics" +) + +var ( + arangodbOperatorObjectsProcessed = metrics.NewDescription("arangodb_operator_objects_processed", "Number of the processed objects", []string{`operator_name`}, nil) + + // Global Fields + globalArangodbOperatorObjectsProcessedCounter = NewArangodbOperatorObjectsProcessedCounterFactory() +) + +func init() { + registerDescription(arangodbOperatorObjectsProcessed) + registerCollector(globalArangodbOperatorObjectsProcessedCounter) +} + +func GlobalArangodbOperatorObjectsProcessedCounter() metrics.FactoryCounter[ArangodbOperatorObjectsProcessedInput] { + return globalArangodbOperatorObjectsProcessedCounter +} + +func NewArangodbOperatorObjectsProcessedCounterFactory() metrics.FactoryCounter[ArangodbOperatorObjectsProcessedInput] { + return metrics.NewFactoryCounter[ArangodbOperatorObjectsProcessedInput]() +} + +func NewArangodbOperatorObjectsProcessedInput(operatorName string) ArangodbOperatorObjectsProcessedInput { + return ArangodbOperatorObjectsProcessedInput{ + OperatorName: operatorName, + } +} + +type ArangodbOperatorObjectsProcessedInput struct { + OperatorName string `json:"operatorName"` +} + +func (i ArangodbOperatorObjectsProcessedInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorObjectsProcessedCounter(value, i.OperatorName) +} + +func (i ArangodbOperatorObjectsProcessedInput) Desc() metrics.Description { + return ArangodbOperatorObjectsProcessed() +} + +func ArangodbOperatorObjectsProcessed() metrics.Description { + return arangodbOperatorObjectsProcessed +} + +func ArangodbOperatorObjectsProcessedCounter(value float64, operatorName string) metrics.Metric { + return ArangodbOperatorObjectsProcessed().Counter(value, operatorName) +} diff --git a/pkg/generated/metric_descriptions/arango_operator_objects_processed_test.go b/pkg/generated/metric_descriptions/arangodb_operator_objects_processed_test.go similarity index 82% rename from pkg/generated/metric_descriptions/arango_operator_objects_processed_test.go rename to pkg/generated/metric_descriptions/arangodb_operator_objects_processed_test.go index 107f21d30..3412ef3ee 100644 --- a/pkg/generated/metric_descriptions/arango_operator_objects_processed_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_objects_processed_test.go @@ -26,18 +26,18 @@ import ( "github.com/stretchr/testify/require" ) -func Test_ArangoOperatorObjectsProcessed_Descriptor(t *testing.T) { - ArangoOperatorObjectsProcessed() +func Test_ArangodbOperatorObjectsProcessed_Descriptor(t *testing.T) { + ArangodbOperatorObjectsProcessed() } -func Test_ArangoOperatorObjectsProcessed_Global(t *testing.T) { - global := GetArangoOperatorObjectsProcessedFactory() +func Test_ArangodbOperatorObjectsProcessed_Factory(t *testing.T) { + global := NewArangodbOperatorObjectsProcessedCounterFactory() - object1 := ArangoOperatorObjectsProcessedItem{ + object1 := ArangodbOperatorObjectsProcessedInput{ OperatorName: "1", } - object2 := ArangoOperatorObjectsProcessedItem{ + object2 := ArangodbOperatorObjectsProcessedInput{ OperatorName: "2", } @@ -51,7 +51,7 @@ func Test_ArangoOperatorObjectsProcessed_Global(t *testing.T) { }) t.Run("Add", func(t *testing.T) { - global.Add(10, object1) + global.Add(object1, 10) require.EqualValues(t, 10, global.Get(object1)) require.EqualValues(t, 0, global.Get(object2)) @@ -62,7 +62,7 @@ func Test_ArangoOperatorObjectsProcessed_Global(t *testing.T) { }) t.Run("Add", func(t *testing.T) { - global.Add(3, object2) + global.Add(object2, 3) require.EqualValues(t, 10, global.Get(object1)) require.EqualValues(t, 3, global.Get(object2)) @@ -73,7 +73,7 @@ func Test_ArangoOperatorObjectsProcessed_Global(t *testing.T) { }) t.Run("Dec", func(t *testing.T) { - global.Add(-1, object1) + global.Add(object1, -1) require.EqualValues(t, 9, global.Get(object1)) require.EqualValues(t, 3, global.Get(object2)) @@ -117,14 +117,14 @@ func Test_ArangoOperatorObjectsProcessed_Global(t *testing.T) { }) } -func Test_ArangoOperatorObjectsProcessed_Global_Counter(t *testing.T) { - global := GetArangoOperatorObjectsProcessedFactory() +func Test_ArangodbOperatorObjectsProcessed_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorObjectsProcessedCounterFactory() - object1 := ArangoOperatorObjectsProcessedItem{ + object1 := ArangodbOperatorObjectsProcessedInput{ OperatorName: "1", } - object2 := ArangoOperatorObjectsProcessedItem{ + object2 := ArangodbOperatorObjectsProcessedInput{ OperatorName: "2", } @@ -138,7 +138,7 @@ func Test_ArangoOperatorObjectsProcessed_Global_Counter(t *testing.T) { }) t.Run("Add", func(t *testing.T) { - global.Add(10, object1) + global.Add(object1, 10) require.EqualValues(t, 10, global.Get(object1)) require.EqualValues(t, 0, global.Get(object2)) diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go index 703118745..5baae3244 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorRebalancerEnabled) } +func NewArangodbOperatorRebalancerEnabledGaugeFactory() metrics.FactoryGauge[ArangodbOperatorRebalancerEnabledInput] { + return metrics.NewFactoryGauge[ArangodbOperatorRebalancerEnabledInput]() +} + +func NewArangodbOperatorRebalancerEnabledInput(namespace string, name string) ArangodbOperatorRebalancerEnabledInput { + return ArangodbOperatorRebalancerEnabledInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorRebalancerEnabledInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorRebalancerEnabledInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorRebalancerEnabledGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorRebalancerEnabledInput) Desc() metrics.Description { + return ArangodbOperatorRebalancerEnabled() +} + func ArangodbOperatorRebalancerEnabled() metrics.Description { return arangodbOperatorRebalancerEnabled } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled_test.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled_test.go index 305e04f0c..78cdf1ffd 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorRebalancerEnabled_Descriptor(t *testing.T) { ArangodbOperatorRebalancerEnabled() } + +func Test_ArangodbOperatorRebalancerEnabled_Factory(t *testing.T) { + global := NewArangodbOperatorRebalancerEnabledGaugeFactory() + + object1 := ArangodbOperatorRebalancerEnabledInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerEnabledInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorRebalancerEnabled_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorRebalancerEnabledGaugeFactory() + + object1 := ArangodbOperatorRebalancerEnabledInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerEnabledInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go index 417db54ac..a45a76708 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorRebalancerMovesCurrent) } +func NewArangodbOperatorRebalancerMovesCurrentGaugeFactory() metrics.FactoryGauge[ArangodbOperatorRebalancerMovesCurrentInput] { + return metrics.NewFactoryGauge[ArangodbOperatorRebalancerMovesCurrentInput]() +} + +func NewArangodbOperatorRebalancerMovesCurrentInput(namespace string, name string) ArangodbOperatorRebalancerMovesCurrentInput { + return ArangodbOperatorRebalancerMovesCurrentInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorRebalancerMovesCurrentInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorRebalancerMovesCurrentInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorRebalancerMovesCurrentGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorRebalancerMovesCurrentInput) Desc() metrics.Description { + return ArangodbOperatorRebalancerMovesCurrent() +} + func ArangodbOperatorRebalancerMovesCurrent() metrics.Description { return arangodbOperatorRebalancerMovesCurrent } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current_test.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current_test.go index af13987d9..f8dc0669b 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorRebalancerMovesCurrent_Descriptor(t *testing.T) { ArangodbOperatorRebalancerMovesCurrent() } + +func Test_ArangodbOperatorRebalancerMovesCurrent_Factory(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesCurrentGaugeFactory() + + object1 := ArangodbOperatorRebalancerMovesCurrentInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesCurrentInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorRebalancerMovesCurrent_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesCurrentGaugeFactory() + + object1 := ArangodbOperatorRebalancerMovesCurrentInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesCurrentInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go index 928eec8d8..1da064507 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorRebalancerMovesFailed) } +func NewArangodbOperatorRebalancerMovesFailedCounterFactory() metrics.FactoryCounter[ArangodbOperatorRebalancerMovesFailedInput] { + return metrics.NewFactoryCounter[ArangodbOperatorRebalancerMovesFailedInput]() +} + +func NewArangodbOperatorRebalancerMovesFailedInput(namespace string, name string) ArangodbOperatorRebalancerMovesFailedInput { + return ArangodbOperatorRebalancerMovesFailedInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorRebalancerMovesFailedInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorRebalancerMovesFailedInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorRebalancerMovesFailedCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorRebalancerMovesFailedInput) Desc() metrics.Description { + return ArangodbOperatorRebalancerMovesFailed() +} + func ArangodbOperatorRebalancerMovesFailed() metrics.Description { return arangodbOperatorRebalancerMovesFailed } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed_test.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed_test.go index 825f8127c..5e482545f 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorRebalancerMovesFailed_Descriptor(t *testing.T) { ArangodbOperatorRebalancerMovesFailed() } + +func Test_ArangodbOperatorRebalancerMovesFailed_Factory(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesFailedCounterFactory() + + object1 := ArangodbOperatorRebalancerMovesFailedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesFailedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorRebalancerMovesFailed_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesFailedCounterFactory() + + object1 := ArangodbOperatorRebalancerMovesFailedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesFailedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go index d4a43f083..72afbf5f0 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorRebalancerMovesGenerated) } +func NewArangodbOperatorRebalancerMovesGeneratedCounterFactory() metrics.FactoryCounter[ArangodbOperatorRebalancerMovesGeneratedInput] { + return metrics.NewFactoryCounter[ArangodbOperatorRebalancerMovesGeneratedInput]() +} + +func NewArangodbOperatorRebalancerMovesGeneratedInput(namespace string, name string) ArangodbOperatorRebalancerMovesGeneratedInput { + return ArangodbOperatorRebalancerMovesGeneratedInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorRebalancerMovesGeneratedInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorRebalancerMovesGeneratedInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorRebalancerMovesGeneratedCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorRebalancerMovesGeneratedInput) Desc() metrics.Description { + return ArangodbOperatorRebalancerMovesGenerated() +} + func ArangodbOperatorRebalancerMovesGenerated() metrics.Description { return arangodbOperatorRebalancerMovesGenerated } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated_test.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated_test.go index e5867b5bf..38c06d7ef 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorRebalancerMovesGenerated_Descriptor(t *testing.T) { ArangodbOperatorRebalancerMovesGenerated() } + +func Test_ArangodbOperatorRebalancerMovesGenerated_Factory(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesGeneratedCounterFactory() + + object1 := ArangodbOperatorRebalancerMovesGeneratedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesGeneratedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorRebalancerMovesGenerated_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesGeneratedCounterFactory() + + object1 := ArangodbOperatorRebalancerMovesGeneratedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesGeneratedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go index dadf0026f..45e0f8160 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorRebalancerMovesSucceeded) } +func NewArangodbOperatorRebalancerMovesSucceededCounterFactory() metrics.FactoryCounter[ArangodbOperatorRebalancerMovesSucceededInput] { + return metrics.NewFactoryCounter[ArangodbOperatorRebalancerMovesSucceededInput]() +} + +func NewArangodbOperatorRebalancerMovesSucceededInput(namespace string, name string) ArangodbOperatorRebalancerMovesSucceededInput { + return ArangodbOperatorRebalancerMovesSucceededInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorRebalancerMovesSucceededInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorRebalancerMovesSucceededInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorRebalancerMovesSucceededCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorRebalancerMovesSucceededInput) Desc() metrics.Description { + return ArangodbOperatorRebalancerMovesSucceeded() +} + func ArangodbOperatorRebalancerMovesSucceeded() metrics.Description { return arangodbOperatorRebalancerMovesSucceeded } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded_test.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded_test.go index 3c7873dcd..46b212245 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorRebalancerMovesSucceeded_Descriptor(t *testing.T) { ArangodbOperatorRebalancerMovesSucceeded() } + +func Test_ArangodbOperatorRebalancerMovesSucceeded_Factory(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesSucceededCounterFactory() + + object1 := ArangodbOperatorRebalancerMovesSucceededInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesSucceededInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorRebalancerMovesSucceeded_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorRebalancerMovesSucceededCounterFactory() + + object1 := ArangodbOperatorRebalancerMovesSucceededInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorRebalancerMovesSucceededInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go index c2d3159d8..edec35c23 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentAccepted) } +func NewArangodbOperatorResourcesArangodeploymentAcceptedGaugeFactory() metrics.FactoryGauge[ArangodbOperatorResourcesArangodeploymentAcceptedInput] { + return metrics.NewFactoryGauge[ArangodbOperatorResourcesArangodeploymentAcceptedInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentAcceptedInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentAcceptedInput { + return ArangodbOperatorResourcesArangodeploymentAcceptedInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentAcceptedInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentAcceptedInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentAcceptedGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentAcceptedInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentAccepted() +} + func ArangodbOperatorResourcesArangodeploymentAccepted() metrics.Description { return arangodbOperatorResourcesArangodeploymentAccepted } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted_test.go index 1496ecb23..eaf6396a0 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentAccepted_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentAccepted() } + +func Test_ArangodbOperatorResourcesArangodeploymentAccepted_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentAcceptedGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentAcceptedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentAcceptedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentAccepted_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentAcceptedGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentAcceptedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentAcceptedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go index b3e103330..38d5d1650 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentImmutableErrors) } +func NewArangodbOperatorResourcesArangodeploymentImmutableErrorsCounterFactory() metrics.FactoryCounter[ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput] { + return metrics.NewFactoryCounter[ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentImmutableErrorsInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput { + return ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentImmutableErrorsCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentImmutableErrors() +} + func ArangodbOperatorResourcesArangodeploymentImmutableErrors() metrics.Description { return arangodbOperatorResourcesArangodeploymentImmutableErrors } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors_test.go index 92fc12790..17e272302 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentImmutableErrors_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentImmutableErrors() } + +func Test_ArangodbOperatorResourcesArangodeploymentImmutableErrors_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentImmutableErrorsCounterFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentImmutableErrors_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentImmutableErrorsCounterFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentImmutableErrorsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go index 5bb79cbc0..c079958b6 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentPropagated) } +func NewArangodbOperatorResourcesArangodeploymentPropagatedGaugeFactory() metrics.FactoryGauge[ArangodbOperatorResourcesArangodeploymentPropagatedInput] { + return metrics.NewFactoryGauge[ArangodbOperatorResourcesArangodeploymentPropagatedInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentPropagatedInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentPropagatedInput { + return ArangodbOperatorResourcesArangodeploymentPropagatedInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentPropagatedInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentPropagatedInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentPropagatedGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentPropagatedInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentPropagated() +} + func ArangodbOperatorResourcesArangodeploymentPropagated() metrics.Description { return arangodbOperatorResourcesArangodeploymentPropagated } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated_test.go index 8f7edc9f1..c44905191 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentPropagated_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentPropagated() } + +func Test_ArangodbOperatorResourcesArangodeploymentPropagated_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentPropagatedGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentPropagatedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentPropagatedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentPropagated_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentPropagatedGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentPropagatedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentPropagatedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go index 453274d60..afc1edd0a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentStatusRestores) } +func NewArangodbOperatorResourcesArangodeploymentStatusRestoresCounterFactory() metrics.FactoryCounter[ArangodbOperatorResourcesArangodeploymentStatusRestoresInput] { + return metrics.NewFactoryCounter[ArangodbOperatorResourcesArangodeploymentStatusRestoresInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentStatusRestoresInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentStatusRestoresInput { + return ArangodbOperatorResourcesArangodeploymentStatusRestoresInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentStatusRestoresInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentStatusRestoresInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentStatusRestoresCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentStatusRestoresInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentStatusRestores() +} + func ArangodbOperatorResourcesArangodeploymentStatusRestores() metrics.Description { return arangodbOperatorResourcesArangodeploymentStatusRestores } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores_test.go index f87582f55..6cd7ff916 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentStatusRestores_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentStatusRestores() } + +func Test_ArangodbOperatorResourcesArangodeploymentStatusRestores_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentStatusRestoresCounterFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentStatusRestoresInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentStatusRestoresInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentStatusRestores_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentStatusRestoresCounterFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentStatusRestoresInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentStatusRestoresInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go index 801dae61c..8e5052ec5 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentUptodate) } +func NewArangodbOperatorResourcesArangodeploymentUptodateGaugeFactory() metrics.FactoryGauge[ArangodbOperatorResourcesArangodeploymentUptodateInput] { + return metrics.NewFactoryGauge[ArangodbOperatorResourcesArangodeploymentUptodateInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentUptodateInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentUptodateInput { + return ArangodbOperatorResourcesArangodeploymentUptodateInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentUptodateInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentUptodateInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentUptodateGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentUptodateInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentUptodate() +} + func ArangodbOperatorResourcesArangodeploymentUptodate() metrics.Description { return arangodbOperatorResourcesArangodeploymentUptodate } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate_test.go index 569d115e6..51f3fe896 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentUptodate_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentUptodate() } + +func Test_ArangodbOperatorResourcesArangodeploymentUptodate_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentUptodateGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentUptodateInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentUptodateInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentUptodate_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentUptodateGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentUptodateInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentUptodateInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go index 6f369280c..0bac4696f 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentValidationErrors) } +func NewArangodbOperatorResourcesArangodeploymentValidationErrorsCounterFactory() metrics.FactoryCounter[ArangodbOperatorResourcesArangodeploymentValidationErrorsInput] { + return metrics.NewFactoryCounter[ArangodbOperatorResourcesArangodeploymentValidationErrorsInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentValidationErrorsInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentValidationErrorsInput { + return ArangodbOperatorResourcesArangodeploymentValidationErrorsInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentValidationErrorsInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentValidationErrorsInput) Counter(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentValidationErrorsCounter(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentValidationErrorsInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentValidationErrors() +} + func ArangodbOperatorResourcesArangodeploymentValidationErrors() metrics.Description { return arangodbOperatorResourcesArangodeploymentValidationErrors } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors_test.go index 7f5db4a80..b6a58a7dc 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentValidationErrors_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentValidationErrors() } + +func Test_ArangodbOperatorResourcesArangodeploymentValidationErrors_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentValidationErrorsCounterFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentValidationErrorsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentValidationErrorsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentValidationErrors_Factory_Counter(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentValidationErrorsCounterFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentValidationErrorsInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentValidationErrorsInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go index 2baabad0a..b9f9b738b 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentreplicationActive) } +func NewArangodbOperatorResourcesArangodeploymentreplicationActiveGaugeFactory() metrics.FactoryGauge[ArangodbOperatorResourcesArangodeploymentreplicationActiveInput] { + return metrics.NewFactoryGauge[ArangodbOperatorResourcesArangodeploymentreplicationActiveInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentreplicationActiveInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentreplicationActiveInput { + return ArangodbOperatorResourcesArangodeploymentreplicationActiveInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentreplicationActiveInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentreplicationActiveInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentreplicationActiveGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentreplicationActiveInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentreplicationActive() +} + func ArangodbOperatorResourcesArangodeploymentreplicationActive() metrics.Description { return arangodbOperatorResourcesArangodeploymentreplicationActive } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active_test.go index caf4fa142..5a4fb5b18 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentreplicationActive_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentreplicationActive() } + +func Test_ArangodbOperatorResourcesArangodeploymentreplicationActive_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentreplicationActiveGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentreplicationActiveInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentreplicationActiveInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentreplicationActive_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentreplicationActiveGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentreplicationActiveInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentreplicationActiveInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go index cc1fd6ab3..3dd09e93f 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go @@ -32,6 +32,30 @@ func init() { registerDescription(arangodbOperatorResourcesArangodeploymentreplicationFailed) } +func NewArangodbOperatorResourcesArangodeploymentreplicationFailedGaugeFactory() metrics.FactoryGauge[ArangodbOperatorResourcesArangodeploymentreplicationFailedInput] { + return metrics.NewFactoryGauge[ArangodbOperatorResourcesArangodeploymentreplicationFailedInput]() +} + +func NewArangodbOperatorResourcesArangodeploymentreplicationFailedInput(namespace string, name string) ArangodbOperatorResourcesArangodeploymentreplicationFailedInput { + return ArangodbOperatorResourcesArangodeploymentreplicationFailedInput{ + Namespace: namespace, + Name: name, + } +} + +type ArangodbOperatorResourcesArangodeploymentreplicationFailedInput struct { + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +func (i ArangodbOperatorResourcesArangodeploymentreplicationFailedInput) Gauge(value float64) metrics.Metric { + return ArangodbOperatorResourcesArangodeploymentreplicationFailedGauge(value, i.Namespace, i.Name) +} + +func (i ArangodbOperatorResourcesArangodeploymentreplicationFailedInput) Desc() metrics.Description { + return ArangodbOperatorResourcesArangodeploymentreplicationFailed() +} + func ArangodbOperatorResourcesArangodeploymentreplicationFailed() metrics.Description { return arangodbOperatorResourcesArangodeploymentreplicationFailed } diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed_test.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed_test.go index bc723c658..125f1f6ac 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed_test.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed_test.go @@ -22,8 +22,145 @@ package metric_descriptions import ( "testing" + + "github.com/stretchr/testify/require" ) func Test_ArangodbOperatorResourcesArangodeploymentreplicationFailed_Descriptor(t *testing.T) { ArangodbOperatorResourcesArangodeploymentreplicationFailed() } + +func Test_ArangodbOperatorResourcesArangodeploymentreplicationFailed_Factory(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentreplicationFailedGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentreplicationFailedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentreplicationFailedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbOperatorResourcesArangodeploymentreplicationFailed_Factory_Gauge(t *testing.T) { + global := NewArangodbOperatorResourcesArangodeploymentreplicationFailedGaugeFactory() + + object1 := ArangodbOperatorResourcesArangodeploymentreplicationFailedInput{ + Namespace: "1", + Name: "1", + } + + object2 := ArangodbOperatorResourcesArangodeploymentreplicationFailedInput{ + Namespace: "2", + Name: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration.go b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration.go new file mode 100644 index 000000000..76212ea76 --- /dev/null +++ b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration.go @@ -0,0 +1,71 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metric_descriptions + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/metrics" +) + +var ( + arangodbResourcesDeploymentConfigMapDuration = metrics.NewDescription("arangodb_resources_deployment_config_map_duration", "Duration of inspected ConfigMaps by Deployment in seconds", []string{`deployment`}, nil) + + // Global Fields + globalArangodbResourcesDeploymentConfigMapDurationGauge = NewArangodbResourcesDeploymentConfigMapDurationGaugeFactory() +) + +func init() { + registerDescription(arangodbResourcesDeploymentConfigMapDuration) + registerCollector(globalArangodbResourcesDeploymentConfigMapDurationGauge) +} + +func GlobalArangodbResourcesDeploymentConfigMapDurationGauge() metrics.FactoryGauge[ArangodbResourcesDeploymentConfigMapDurationInput] { + return globalArangodbResourcesDeploymentConfigMapDurationGauge +} + +func NewArangodbResourcesDeploymentConfigMapDurationGaugeFactory() metrics.FactoryGauge[ArangodbResourcesDeploymentConfigMapDurationInput] { + return metrics.NewFactoryGauge[ArangodbResourcesDeploymentConfigMapDurationInput]() +} + +func NewArangodbResourcesDeploymentConfigMapDurationInput(deployment string) ArangodbResourcesDeploymentConfigMapDurationInput { + return ArangodbResourcesDeploymentConfigMapDurationInput{ + Deployment: deployment, + } +} + +type ArangodbResourcesDeploymentConfigMapDurationInput struct { + Deployment string `json:"deployment"` +} + +func (i ArangodbResourcesDeploymentConfigMapDurationInput) Gauge(value float64) metrics.Metric { + return ArangodbResourcesDeploymentConfigMapDurationGauge(value, i.Deployment) +} + +func (i ArangodbResourcesDeploymentConfigMapDurationInput) Desc() metrics.Description { + return ArangodbResourcesDeploymentConfigMapDuration() +} + +func ArangodbResourcesDeploymentConfigMapDuration() metrics.Description { + return arangodbResourcesDeploymentConfigMapDuration +} + +func ArangodbResourcesDeploymentConfigMapDurationGauge(value float64, deployment string) metrics.Metric { + return ArangodbResourcesDeploymentConfigMapDuration().Gauge(value, deployment) +} diff --git a/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration_test.go b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration_test.go new file mode 100644 index 000000000..a935c2acd --- /dev/null +++ b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_duration_test.go @@ -0,0 +1,162 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metric_descriptions + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_ArangodbResourcesDeploymentConfigMapDuration_Descriptor(t *testing.T) { + ArangodbResourcesDeploymentConfigMapDuration() +} + +func Test_ArangodbResourcesDeploymentConfigMapDuration_Factory(t *testing.T) { + global := NewArangodbResourcesDeploymentConfigMapDurationGaugeFactory() + + object1 := ArangodbResourcesDeploymentConfigMapDurationInput{ + Deployment: "1", + } + + object2 := ArangodbResourcesDeploymentConfigMapDurationInput{ + Deployment: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbResourcesDeploymentConfigMapDuration_Factory_Gauge(t *testing.T) { + global := NewArangodbResourcesDeploymentConfigMapDurationGaugeFactory() + + object1 := ArangodbResourcesDeploymentConfigMapDurationInput{ + Deployment: "1", + } + + object2 := ArangodbResourcesDeploymentConfigMapDurationInput{ + Deployment: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Set", func(t *testing.T) { + global.Set(object1, 3) + global.Set(object2, 1) + + require.EqualValues(t, 3, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected.go b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected.go new file mode 100644 index 000000000..55daf2426 --- /dev/null +++ b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected.go @@ -0,0 +1,71 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metric_descriptions + +import ( + "github.com/arangodb/kube-arangodb/pkg/util/metrics" +) + +var ( + arangodbResourcesDeploymentConfigMapInspected = metrics.NewDescription("arangodb_resources_deployment_config_map_inspected", "Number of inspected ConfigMaps by Deployment", []string{`deployment`}, nil) + + // Global Fields + globalArangodbResourcesDeploymentConfigMapInspectedCounter = NewArangodbResourcesDeploymentConfigMapInspectedCounterFactory() +) + +func init() { + registerDescription(arangodbResourcesDeploymentConfigMapInspected) + registerCollector(globalArangodbResourcesDeploymentConfigMapInspectedCounter) +} + +func GlobalArangodbResourcesDeploymentConfigMapInspectedCounter() metrics.FactoryCounter[ArangodbResourcesDeploymentConfigMapInspectedInput] { + return globalArangodbResourcesDeploymentConfigMapInspectedCounter +} + +func NewArangodbResourcesDeploymentConfigMapInspectedCounterFactory() metrics.FactoryCounter[ArangodbResourcesDeploymentConfigMapInspectedInput] { + return metrics.NewFactoryCounter[ArangodbResourcesDeploymentConfigMapInspectedInput]() +} + +func NewArangodbResourcesDeploymentConfigMapInspectedInput(deployment string) ArangodbResourcesDeploymentConfigMapInspectedInput { + return ArangodbResourcesDeploymentConfigMapInspectedInput{ + Deployment: deployment, + } +} + +type ArangodbResourcesDeploymentConfigMapInspectedInput struct { + Deployment string `json:"deployment"` +} + +func (i ArangodbResourcesDeploymentConfigMapInspectedInput) Counter(value float64) metrics.Metric { + return ArangodbResourcesDeploymentConfigMapInspectedCounter(value, i.Deployment) +} + +func (i ArangodbResourcesDeploymentConfigMapInspectedInput) Desc() metrics.Description { + return ArangodbResourcesDeploymentConfigMapInspected() +} + +func ArangodbResourcesDeploymentConfigMapInspected() metrics.Description { + return arangodbResourcesDeploymentConfigMapInspected +} + +func ArangodbResourcesDeploymentConfigMapInspectedCounter(value float64, deployment string) metrics.Metric { + return ArangodbResourcesDeploymentConfigMapInspected().Counter(value, deployment) +} diff --git a/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected_test.go b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected_test.go new file mode 100644 index 000000000..f8b45c67d --- /dev/null +++ b/pkg/generated/metric_descriptions/arangodb_resources_deployment_config_map_inspected_test.go @@ -0,0 +1,162 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metric_descriptions + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_ArangodbResourcesDeploymentConfigMapInspected_Descriptor(t *testing.T) { + ArangodbResourcesDeploymentConfigMapInspected() +} + +func Test_ArangodbResourcesDeploymentConfigMapInspected_Factory(t *testing.T) { + global := NewArangodbResourcesDeploymentConfigMapInspectedCounterFactory() + + object1 := ArangodbResourcesDeploymentConfigMapInspectedInput{ + Deployment: "1", + } + + object2 := ArangodbResourcesDeploymentConfigMapInspectedInput{ + Deployment: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object2, 3) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Dec", func(t *testing.T) { + global.Add(object1, -1) + + require.EqualValues(t, 9, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object1) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 3, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Remove", func(t *testing.T) { + global.Remove(object2) + + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) +} + +func Test_ArangodbResourcesDeploymentConfigMapInspected_Factory_Counter(t *testing.T) { + global := NewArangodbResourcesDeploymentConfigMapInspectedCounterFactory() + + object1 := ArangodbResourcesDeploymentConfigMapInspectedInput{ + Deployment: "1", + } + + object2 := ArangodbResourcesDeploymentConfigMapInspectedInput{ + Deployment: "2", + } + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 0) + }) + + t.Run("Precheck", func(t *testing.T) { + require.EqualValues(t, 0, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("Add", func(t *testing.T) { + global.Add(object1, 10) + + require.EqualValues(t, 10, global.Get(object1)) + require.EqualValues(t, 0, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 1) + }) + + t.Run("Inc", func(t *testing.T) { + global.Inc(object1) + global.Inc(object2) + + require.EqualValues(t, 11, global.Get(object1)) + require.EqualValues(t, 1, global.Get(object2)) + }) + + t.Run("List", func(t *testing.T) { + require.Len(t, global.Items(), 2) + }) +} diff --git a/pkg/operatorV2/operator_worker.go b/pkg/operatorV2/operator_worker.go index 30f6f72f2..620004bb7 100644 --- a/pkg/operatorV2/operator_worker.go +++ b/pkg/operatorV2/operator_worker.go @@ -102,7 +102,7 @@ func (o *operator) processObject(obj interface{}) error { return nil } - metric_descriptions.ArangoOperatorObjectsProcessedInc(o.operator.name) + metric_descriptions.GlobalArangodbOperatorObjectsProcessedCounter().Inc(metric_descriptions.NewArangodbOperatorObjectsProcessedInput(o.operator.name)) loggerWorker.Trace("Received Item Action: %s, Type: %s/%s/%s, Namespace: %s, Name: %s", item.Operation, diff --git a/pkg/util/metrics/duration.go b/pkg/util/metrics/duration.go new file mode 100644 index 000000000..93c6860d6 --- /dev/null +++ b/pkg/util/metrics/duration.go @@ -0,0 +1,30 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metrics + +import "time" + +func WithDuration[T FactoryTypeGauge](f FactoryGauge[T], v T) func() { + start := time.Now() + return func() { + f.Add(v, float64(time.Since(start))/float64(time.Second)) + } +} diff --git a/pkg/util/metrics/factory_counter.go b/pkg/util/metrics/factory_counter.go new file mode 100644 index 000000000..19c41c34b --- /dev/null +++ b/pkg/util/metrics/factory_counter.go @@ -0,0 +1,109 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metrics + +import ( + "sync" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +type FactoryTypeCounter interface { + comparable + + Desc() Description + Counter(value float64) Metric +} + +func NewFactoryCounter[T FactoryTypeCounter]() FactoryCounter[T] { + return &factoryCounter[T]{ + desc: util.Default[T]().Desc(), + metrics: map[T]float64{}, + } +} + +type FactoryCounter[T FactoryTypeCounter] interface { + Collector + + Items() []T + Get(v T) float64 + Remove(v T) + Add(v T, value float64) + Inc(v T) +} + +type factoryCounter[T FactoryTypeCounter] struct { + lock sync.Mutex + + desc Description + metrics map[T]float64 +} + +func (f *factoryCounter[T]) CollectMetrics(in PushMetric) { + f.lock.Lock() + defer f.lock.Unlock() + + for k, v := range f.metrics { + in.Push(k.Counter(v)) + } +} + +func (f *factoryCounter[T]) CollectDescriptions(in PushDescription) { + in.Push(f.desc) +} + +func (f *factoryCounter[T]) Items() []T { + f.lock.Lock() + defer f.lock.Unlock() + + r := make([]T, 0, len(f.metrics)) + + for k := range f.metrics { + r = append(r, k) + } + + return r +} + +func (f *factoryCounter[T]) Get(v T) float64 { + f.lock.Lock() + defer f.lock.Unlock() + + return f.metrics[v] +} + +func (f *factoryCounter[T]) Remove(v T) { + f.lock.Lock() + defer f.lock.Unlock() + + delete(f.metrics, v) +} + +func (f *factoryCounter[T]) Add(v T, value float64) { + f.lock.Lock() + defer f.lock.Unlock() + + f.metrics[v] = value + f.metrics[v] +} + +func (f *factoryCounter[T]) Inc(v T) { + f.Add(v, 1) +} diff --git a/pkg/util/metrics/factory_gauge.go b/pkg/util/metrics/factory_gauge.go new file mode 100644 index 000000000..5aa283625 --- /dev/null +++ b/pkg/util/metrics/factory_gauge.go @@ -0,0 +1,112 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package metrics + +import ( + "sync" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +type FactoryTypeGauge interface { + comparable + + Desc() Description + Gauge(value float64) Metric +} + +func NewFactoryGauge[T FactoryTypeGauge]() FactoryGauge[T] { + return &factoryGauge[T]{ + desc: util.Default[T]().Desc(), + metrics: map[T]float64{}, + } +} + +type FactoryGauge[T FactoryTypeGauge] interface { + Collector + + Items() []T + Get(v T) float64 + Remove(v T) + Set(v T, value float64) + Add(v T, value float64) +} + +type factoryGauge[T FactoryTypeGauge] struct { + lock sync.Mutex + + desc Description + metrics map[T]float64 +} + +func (f *factoryGauge[T]) CollectMetrics(in PushMetric) { + f.lock.Lock() + defer f.lock.Unlock() + + for k, v := range f.metrics { + in.Push(k.Gauge(v)) + } +} + +func (f *factoryGauge[T]) CollectDescriptions(in PushDescription) { + in.Push(f.desc) +} + +func (f *factoryGauge[T]) Items() []T { + f.lock.Lock() + defer f.lock.Unlock() + + r := make([]T, 0, len(f.metrics)) + + for k := range f.metrics { + r = append(r, k) + } + + return r +} + +func (f *factoryGauge[T]) Get(v T) float64 { + f.lock.Lock() + defer f.lock.Unlock() + + return f.metrics[v] +} + +func (f *factoryGauge[T]) Remove(v T) { + f.lock.Lock() + defer f.lock.Unlock() + + delete(f.metrics, v) +} + +func (f *factoryGauge[T]) Set(v T, value float64) { + f.lock.Lock() + defer f.lock.Unlock() + + f.metrics[v] = value +} + +func (f *factoryGauge[T]) Add(v T, value float64) { + f.lock.Lock() + defer f.lock.Unlock() + + f.metrics[v] = value + f.metrics[v] +} From 367e59fe5b41afcc35d23cfe33b5437fced64010 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:27:59 +0200 Subject: [PATCH 41/50] [Feature] [Scheduler] Create Integration Profile (#1727) --- CHANGELOG.md | 1 + pkg/deployment/resources/arango_profiles.go | 129 ++++++++++++++++++ .../resources/pod_creator_gateway_pod.go | 27 +++- pkg/deployment/resources/resources.go | 3 +- .../inspector/arangoprofile/v1beta1/reader.go | 6 +- pkg/util/k8sutil/interfaces/pod_creator.go | 2 + 6 files changed, 157 insertions(+), 11 deletions(-) create mode 100644 pkg/deployment/resources/arango_profiles.go diff --git a/CHANGELOG.md b/CHANGELOG.md index df03d648f..8afd9abe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - (Feature) (Scheduler) Merge Strategy - (Feature) (Networking) Endpoints Destination - (Improvement) Improve Metrics Handling +- (Feature) (Scheduler) Create Integration Profile ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/deployment/resources/arango_profiles.go b/pkg/deployment/resources/arango_profiles.go new file mode 100644 index 000000000..99bab20e8 --- /dev/null +++ b/pkg/deployment/resources/arango_profiles.go @@ -0,0 +1,129 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package resources + +import ( + "context" + "fmt" + "time" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + "github.com/arangodb/kube-arangodb/pkg/integrations/sidecar" + "github.com/arangodb/kube-arangodb/pkg/metrics" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" +) + +var ( + inspectedArangoProfilesCounters = metrics.MustRegisterCounterVec(metricsComponent, "inspected_arango_profiles", "Number of ArangoProfiles inspections per deployment", metrics.DeploymentName) + inspectArangoProfilesDurationGauges = metrics.MustRegisterGaugeVec(metricsComponent, "inspect_arango_profiles_duration", "Amount of time taken by a single inspection of all ArangoProfiles for a deployment (in sec)", metrics.DeploymentName) +) + +// EnsureArangoProfiles creates all ArangoProfiles needed to run the given deployment +func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspectorInterface.Inspector) error { + start := time.Now() + spec := r.context.GetSpec() + arangoProfiles := cachedStatus.ArangoProfileModInterface().V1Beta1() + apiObject := r.context.GetAPIObject() + deploymentName := apiObject.GetName() + + defer metrics.SetDuration(inspectArangoProfilesDurationGauges.WithLabelValues(deploymentName), start) + counterMetric := inspectedArangoProfilesCounters.WithLabelValues(deploymentName) + + reconcileRequired := k8sutil.NewReconcile(cachedStatus) + + intName := fmt.Sprintf("%s-int", deploymentName) + + integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ + Image: util.NewType(r.context.GetOperatorImage()), + }, spec.Integration.GetSidecar()) + if err != nil { + return err + } + + integrationChecksum, err := integration.Checksum() + if err != nil { + return err + } + + if c, err := cachedStatus.ArangoProfile().V1Beta1(); err == nil { + counterMetric.Inc() + if s, ok := c.GetSimple(intName); !ok { + s = &schedulerApi.ArangoProfile{ + ObjectMeta: meta.ObjectMeta{ + Name: intName, + Namespace: apiObject.GetNamespace(), + OwnerReferences: []meta.OwnerReference{ + apiObject.AsOwner(), + }, + }, + Spec: schedulerApi.ProfileSpec{ + Template: integration, + }, + } + + if _, err := cachedStatus.ArangoProfileModInterface().V1Beta1().Create(ctx, s, meta.CreateOptions{}); err != nil { + return err + } + + reconcileRequired.Required() + } else { + currChecksum, err := s.Spec.Template.Checksum() + if err != nil { + return err + } + + if s.Spec.Selectors != nil { + if _, changed, err := patcher.Patcher[*schedulerApi.ArangoProfile](ctx, arangoProfiles, s, meta.PatchOptions{}, + func(in *schedulerApi.ArangoProfile) []patch.Item { + return []patch.Item{ + patch.ItemRemove(patch.NewPath("spec", "selectors")), + } + }); err != nil { + return err + } else if changed { + reconcileRequired.Required() + } + } + + if currChecksum != integrationChecksum { + if _, changed, err := patcher.Patcher[*schedulerApi.ArangoProfile](ctx, arangoProfiles, s, meta.PatchOptions{}, + func(in *schedulerApi.ArangoProfile) []patch.Item { + return []patch.Item{ + patch.ItemReplace(patch.NewPath("spec", "template"), integration), + } + }); err != nil { + return err + } else if changed { + reconcileRequired.Required() + } + } + } + } + + return reconcileRequired.Reconcile(ctx) +} diff --git a/pkg/deployment/resources/pod_creator_gateway_pod.go b/pkg/deployment/resources/pod_creator_gateway_pod.go index 620d3d2c8..0bbf5f83b 100644 --- a/pkg/deployment/resources/pod_creator_gateway_pod.go +++ b/pkg/deployment/resources/pod_creator_gateway_pod.go @@ -29,13 +29,12 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" - schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources" shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/integrations/sidecar" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/collection" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" @@ -203,6 +202,14 @@ func (m *MemberGatewayPod) Validate(cachedStatus interfaces.Inspector) error { return err } + if c, err := cachedStatus.ArangoProfile().V1Beta1(); err != nil { + return err + } else { + if _, ok := c.GetSimple(fmt.Sprintf("%s-int", m.context.GetName())); !ok { + return errors.Errorf("Unable to find deployment integration") + } + } + return nil } @@ -236,14 +243,20 @@ func (m *MemberGatewayPod) Labels() map[string]string { } func (m *MemberGatewayPod) Profiles() (schedulerApi.ProfileTemplates, error) { - integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ - Image: util.NewType(m.resources.context.GetOperatorImage()), - }, m.spec.Integration.GetSidecar()) - + c, err := m.cachedStatus.ArangoProfile().V1Beta1() if err != nil { return nil, err } + integration, ok := c.GetSimple(fmt.Sprintf("%s-int", m.context.GetName())) + if !ok { + return nil, errors.Errorf("Unable to find deployment integration") + } + + if integration.Status.Accepted == nil { + return nil, errors.Errorf("Unable to find accepted integration integration") + } + integrations, err := sidecar.NewIntegrationEnablement( sidecar.IntegrationEnvoyV3{ Spec: m.spec, @@ -258,5 +271,5 @@ func (m *MemberGatewayPod) Profiles() (schedulerApi.ProfileTemplates, error) { shutdownAnnotation := sidecar.NewShutdownAnnotations([]string{shared.ServerContainerName}) - return []*schedulerApi.ProfileTemplate{integration, integrations, shutdownAnnotation}, nil + return []*schedulerApi.ProfileTemplate{integration.Status.Accepted.Template, integrations, shutdownAnnotation}, nil } diff --git a/pkg/deployment/resources/resources.go b/pkg/deployment/resources/resources.go index e4407c5bb..b233778b9 100644 --- a/pkg/deployment/resources/resources.go +++ b/pkg/deployment/resources/resources.go @@ -57,7 +57,8 @@ func (r *Resources) EnsureCoreResources(ctx context.Context, cachedStatus inspec errors.Section(r.EnsureArangoMembers(ctx, cachedStatus), "EnsureArangoMembers"), errors.Section(r.EnsureServices(ctx, cachedStatus), "EnsureServices"), errors.Section(r.EnsureConfigMaps(ctx, cachedStatus), "EnsureConfigMaps"), - errors.Section(r.EnsureSecrets(ctx, cachedStatus), "EnsureSecrets")) + errors.Section(r.EnsureSecrets(ctx, cachedStatus), "EnsureSecrets"), + errors.Section(r.EnsureArangoProfiles(ctx, cachedStatus), "EnsureArangoProfiles")) } func (r *Resources) EnsureResources(ctx context.Context, serviceMonitorEnabled bool, cachedStatus inspectorInterface.Inspector) error { diff --git a/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go b/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go index 1cc3a44cf..d0328fe5b 100644 --- a/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go +++ b/pkg/util/k8sutil/inspector/arangoprofile/v1beta1/reader.go @@ -31,9 +31,9 @@ import ( // ModInterface has methods to work with ArangoTask resources only for creation type ModInterface interface { - Create(ctx context.Context, arangotask *schedulerApi.ArangoProfile, opts meta.CreateOptions) (*schedulerApi.ArangoProfile, error) - Update(ctx context.Context, arangotask *schedulerApi.ArangoProfile, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) - UpdateStatus(ctx context.Context, arangotask *schedulerApi.ArangoProfile, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) + Create(ctx context.Context, arangoProfile *schedulerApi.ArangoProfile, opts meta.CreateOptions) (*schedulerApi.ArangoProfile, error) + Update(ctx context.Context, arangoProfile *schedulerApi.ArangoProfile, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) + UpdateStatus(ctx context.Context, arangoProfile *schedulerApi.ArangoProfile, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result *schedulerApi.ArangoProfile, err error) Delete(ctx context.Context, name string, opts meta.DeleteOptions) error } diff --git a/pkg/util/k8sutil/interfaces/pod_creator.go b/pkg/util/k8sutil/interfaces/pod_creator.go index 577302ede..171acd051 100644 --- a/pkg/util/k8sutil/interfaces/pod_creator.go +++ b/pkg/util/k8sutil/interfaces/pod_creator.go @@ -26,6 +26,7 @@ import ( core "k8s.io/api/core/v1" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoprofile" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/configmap" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" @@ -35,6 +36,7 @@ type Inspector interface { secret.Inspector service.Inspector configmap.Inspector + arangoprofile.Inspector } type PodModifier interface { From 459462b0dcd02886e78fd63749aba1f2bb1d4cad Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:20:57 +0200 Subject: [PATCH 42/50] [Feature] Scheduler Types (#1730) --- CHANGELOG.md | 1 + Makefile | 2 +- README.md | 2 +- .../crds/scheduler-batchjob.yaml | 22 + .../crds/scheduler-cronjob.yaml | 22 + .../crds/scheduler-deployment.yaml | 22 + .../crds/scheduler-pod.yaml | 22 + .../templates/crd/cluster-role.yaml | 4 + .../templates/scheduler-operator/role.yaml | 31 + .../crds/scheduler-batchjob.yaml | 22 + .../crds/scheduler-cronjob.yaml | 22 + .../crds/scheduler-deployment.yaml | 22 + .../crds/scheduler-pod.yaml | 22 + .../templates/crd/cluster-role.yaml | 4 + .../templates/scheduler-operator/role.yaml | 31 + .../crds/scheduler-batchjob.yaml | 22 + .../crds/scheduler-cronjob.yaml | 22 + .../crds/scheduler-deployment.yaml | 22 + .../crds/scheduler-pod.yaml | 22 + .../templates/crd/cluster-role.yaml | 4 + .../templates/scheduler-operator/role.yaml | 31 + .../crds/scheduler-batchjob.yaml | 22 + .../kube-arangodb/crds/scheduler-cronjob.yaml | 22 + .../crds/scheduler-deployment.yaml | 22 + chart/kube-arangodb/crds/scheduler-pod.yaml | 22 + .../templates/crd/cluster-role.yaml | 4 + .../templates/scheduler-operator/role.yaml | 31 + docs/cli/arangodb_operator.md | 2 +- integrations/scheduler/v1/batch_job.go | 177 + integrations/scheduler/v1/batch_job_test.go | 15 +- integrations/scheduler/v1/cron_job.go | 249 ++ integrations/scheduler/v1/cron_job_test.go | 19 +- .../scheduler/v1/definition/batchjob.pb.go | 99 +- .../scheduler/v1/definition/batchjob.proto | 9 +- .../scheduler/v1/definition/common.pb.go | 262 +- .../scheduler/v1/definition/common.proto | 21 +- .../scheduler/v1/definition/cronjob.pb.go | 156 +- .../scheduler/v1/definition/cronjob.proto | 15 +- .../scheduler/v1/definition/definition.pb.go | 1163 +++++-- .../scheduler/v1/definition/definition.proto | 102 +- .../v1/definition/definition_grpc.pb.go | 190 + .../scheduler/v1/definition/deployment.pb.go | 388 +++ .../scheduler/v1/definition/deployment.proto | 66 + integrations/scheduler/v1/deployment.go | 210 ++ integrations/scheduler/v1/deployment_test.go | 199 ++ integrations/scheduler/v1/helpers.go | 43 + integrations/scheduler/v1/implementation.go | 467 +-- internal/cr_validation_test.go | 36 + pkg/apis/scheduler/definitions.go | 16 + pkg/apis/scheduler/v1beta1/profile.go | 18 +- .../scheduler/v1beta1/profile_templates.go | 8 +- pkg/apis/scheduler/v1beta1/register.go | 8 + pkg/apis/scheduler/v1beta1/types.go | 31 + pkg/apis/scheduler/v1beta1/types_batchjob.go | 83 + pkg/apis/scheduler/v1beta1/types_cronjob.go | 83 + .../scheduler/v1beta1/types_deployment.go | 83 + pkg/apis/scheduler/v1beta1/types_pod.go | 83 + .../v1beta1/zz_generated.deepcopy.go | 435 ++- pkg/crd/crds/crds.go | 4 + pkg/crd/crds/crds_test.go | 8 + pkg/crd/crds/scheduler-batchjob.go | 51 + .../scheduler-batchjob.schema.generated.yaml | 2985 ++++++++++++++++ pkg/crd/crds/scheduler-batchjob.yaml | 22 + pkg/crd/crds/scheduler-cronjob.go | 51 + .../scheduler-cronjob.schema.generated.yaml | 3084 +++++++++++++++++ pkg/crd/crds/scheduler-cronjob.yaml | 22 + pkg/crd/crds/scheduler-deployment.go | 51 + ...scheduler-deployment.schema.generated.yaml | 2953 ++++++++++++++++ pkg/crd/crds/scheduler-deployment.yaml | 22 + pkg/crd/crds/scheduler-pod.go | 51 + .../crds/scheduler-pod.schema.generated.yaml | 2823 +++++++++++++++ pkg/crd/crds/scheduler-pod.yaml | 22 + pkg/crd/scheduling.go | 58 + .../generators/kubernetes/lister.go | 75 +- pkg/deployment/images.go | 12 +- pkg/deployment/resources/arango_profiles.go | 166 +- .../v1beta1/arangoschedulerbatchjob.go | 199 ++ .../v1beta1/arangoschedulercronjob.go | 199 ++ .../v1beta1/arangoschedulerdeployment.go | 199 ++ .../scheduler/v1beta1/arangoschedulerpod.go | 199 ++ .../fake/fake_arangoschedulerbatchjob.go | 145 + .../fake/fake_arangoschedulercronjob.go | 145 + .../fake/fake_arangoschedulerdeployment.go | 145 + .../v1beta1/fake/fake_arangoschedulerpod.go | 145 + .../v1beta1/fake/fake_scheduler_client.go | 16 + .../scheduler/v1beta1/generated_expansion.go | 8 + .../scheduler/v1beta1/scheduler_client.go | 20 + .../informers/externalversions/generic.go | 8 + .../v1beta1/arangoschedulerbatchjob.go | 94 + .../v1beta1/arangoschedulercronjob.go | 94 + .../v1beta1/arangoschedulerdeployment.go | 94 + .../scheduler/v1beta1/arangoschedulerpod.go | 94 + .../scheduler/v1beta1/interface.go | 28 + .../v1beta1/arangoschedulerbatchjob.go | 103 + .../v1beta1/arangoschedulercronjob.go | 103 + .../v1beta1/arangoschedulerdeployment.go | 103 + .../scheduler/v1beta1/arangoschedulerpod.go | 103 + .../scheduler/v1beta1/expansion_generated.go | 32 + pkg/handlers/generic/parent/parent.go | 114 + pkg/handlers/scheduler/batchjob/handler.go | 228 ++ .../scheduler/batchjob/handler_manage_test.go | 230 ++ .../scheduler/batchjob/handler_test.go | 59 + pkg/handlers/scheduler/batchjob/local.go | 48 + pkg/handlers/scheduler/batchjob/register.go | 80 + pkg/handlers/scheduler/batchjob/suite_test.go | 61 + pkg/handlers/scheduler/cronjob/handler.go | 228 ++ .../scheduler/cronjob/handler_manage_test.go | 231 ++ .../scheduler/cronjob/handler_test.go | 59 + pkg/handlers/scheduler/cronjob/local.go | 48 + pkg/handlers/scheduler/cronjob/register.go | 80 + pkg/handlers/scheduler/cronjob/suite_test.go | 61 + pkg/handlers/scheduler/deployment/handler.go | 229 ++ .../deployment/handler_manage_test.go | 227 ++ .../scheduler/deployment/handler_test.go | 59 + pkg/handlers/scheduler/deployment/local.go | 48 + pkg/handlers/scheduler/deployment/register.go | 80 + .../scheduler/deployment/suite_test.go | 61 + pkg/handlers/scheduler/pod/handler.go | 224 ++ .../scheduler/pod/handler_manage_test.go | 227 ++ pkg/handlers/scheduler/pod/handler_test.go | 59 + pkg/handlers/scheduler/pod/local.go | 48 + pkg/handlers/scheduler/pod/register.go | 80 + pkg/handlers/scheduler/pod/suite_test.go | 61 + pkg/handlers/scheduler/profile/handler.go | 2 +- pkg/handlers/scheduler/profile/local.go | 10 + pkg/integrations/sidecar/integration.go | 2 + pkg/operator/operator.go | 48 +- pkg/operatorV2/operation/item.go | 12 + pkg/operatorV2/update.go | 8 +- pkg/operatorV2/update_wraps.go | 18 +- pkg/scheduler/input.go | 57 +- pkg/scheduler/profiles.go | 106 + pkg/scheduler/scheduler.go | 136 - pkg/scheduler/scheduler_test.go | 344 -- .../constants/profiles.go} | 16 +- pkg/util/k8sutil/gvk.go | 55 + pkg/util/k8sutil/inspector/generic/mod.go | 10 +- pkg/util/k8sutil/list.go | 14 +- pkg/util/k8sutil/patcher/metadata.go | 54 + pkg/util/list.go | 26 +- pkg/util/tests/ap.go | 47 + pkg/util/tests/kubernetes.go | 244 +- pkg/util/tests/kubernetes_test.go | 6 + 143 files changed, 22640 insertions(+), 1474 deletions(-) create mode 100644 chart/kube-arangodb-arm64/crds/scheduler-batchjob.yaml create mode 100644 chart/kube-arangodb-arm64/crds/scheduler-cronjob.yaml create mode 100644 chart/kube-arangodb-arm64/crds/scheduler-deployment.yaml create mode 100644 chart/kube-arangodb-arm64/crds/scheduler-pod.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/crds/scheduler-batchjob.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/crds/scheduler-cronjob.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/crds/scheduler-deployment.yaml create mode 100644 chart/kube-arangodb-enterprise-arm64/crds/scheduler-pod.yaml create mode 100644 chart/kube-arangodb-enterprise/crds/scheduler-batchjob.yaml create mode 100644 chart/kube-arangodb-enterprise/crds/scheduler-cronjob.yaml create mode 100644 chart/kube-arangodb-enterprise/crds/scheduler-deployment.yaml create mode 100644 chart/kube-arangodb-enterprise/crds/scheduler-pod.yaml create mode 100644 chart/kube-arangodb/crds/scheduler-batchjob.yaml create mode 100644 chart/kube-arangodb/crds/scheduler-cronjob.yaml create mode 100644 chart/kube-arangodb/crds/scheduler-deployment.yaml create mode 100644 chart/kube-arangodb/crds/scheduler-pod.yaml create mode 100644 integrations/scheduler/v1/batch_job.go create mode 100644 integrations/scheduler/v1/cron_job.go create mode 100644 integrations/scheduler/v1/definition/deployment.pb.go create mode 100644 integrations/scheduler/v1/definition/deployment.proto create mode 100644 integrations/scheduler/v1/deployment.go create mode 100644 integrations/scheduler/v1/deployment_test.go create mode 100644 integrations/scheduler/v1/helpers.go create mode 100644 pkg/apis/scheduler/v1beta1/types.go create mode 100644 pkg/apis/scheduler/v1beta1/types_batchjob.go create mode 100644 pkg/apis/scheduler/v1beta1/types_cronjob.go create mode 100644 pkg/apis/scheduler/v1beta1/types_deployment.go create mode 100644 pkg/apis/scheduler/v1beta1/types_pod.go create mode 100644 pkg/crd/crds/scheduler-batchjob.go create mode 100644 pkg/crd/crds/scheduler-batchjob.schema.generated.yaml create mode 100644 pkg/crd/crds/scheduler-batchjob.yaml create mode 100644 pkg/crd/crds/scheduler-cronjob.go create mode 100644 pkg/crd/crds/scheduler-cronjob.schema.generated.yaml create mode 100644 pkg/crd/crds/scheduler-cronjob.yaml create mode 100644 pkg/crd/crds/scheduler-deployment.go create mode 100644 pkg/crd/crds/scheduler-deployment.schema.generated.yaml create mode 100644 pkg/crd/crds/scheduler-deployment.yaml create mode 100644 pkg/crd/crds/scheduler-pod.go create mode 100644 pkg/crd/crds/scheduler-pod.schema.generated.yaml create mode 100644 pkg/crd/crds/scheduler-pod.yaml create mode 100644 pkg/crd/scheduling.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerbatchjob.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulercronjob.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerdeployment.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerpod.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerbatchjob.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulercronjob.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerdeployment.go create mode 100644 pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerpod.go create mode 100644 pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerbatchjob.go create mode 100644 pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulercronjob.go create mode 100644 pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerdeployment.go create mode 100644 pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerpod.go create mode 100644 pkg/generated/listers/scheduler/v1beta1/arangoschedulerbatchjob.go create mode 100644 pkg/generated/listers/scheduler/v1beta1/arangoschedulercronjob.go create mode 100644 pkg/generated/listers/scheduler/v1beta1/arangoschedulerdeployment.go create mode 100644 pkg/generated/listers/scheduler/v1beta1/arangoschedulerpod.go create mode 100644 pkg/handlers/generic/parent/parent.go create mode 100644 pkg/handlers/scheduler/batchjob/handler.go create mode 100644 pkg/handlers/scheduler/batchjob/handler_manage_test.go create mode 100644 pkg/handlers/scheduler/batchjob/handler_test.go create mode 100644 pkg/handlers/scheduler/batchjob/local.go create mode 100644 pkg/handlers/scheduler/batchjob/register.go create mode 100644 pkg/handlers/scheduler/batchjob/suite_test.go create mode 100644 pkg/handlers/scheduler/cronjob/handler.go create mode 100644 pkg/handlers/scheduler/cronjob/handler_manage_test.go create mode 100644 pkg/handlers/scheduler/cronjob/handler_test.go create mode 100644 pkg/handlers/scheduler/cronjob/local.go create mode 100644 pkg/handlers/scheduler/cronjob/register.go create mode 100644 pkg/handlers/scheduler/cronjob/suite_test.go create mode 100644 pkg/handlers/scheduler/deployment/handler.go create mode 100644 pkg/handlers/scheduler/deployment/handler_manage_test.go create mode 100644 pkg/handlers/scheduler/deployment/handler_test.go create mode 100644 pkg/handlers/scheduler/deployment/local.go create mode 100644 pkg/handlers/scheduler/deployment/register.go create mode 100644 pkg/handlers/scheduler/deployment/suite_test.go create mode 100644 pkg/handlers/scheduler/pod/handler.go create mode 100644 pkg/handlers/scheduler/pod/handler_manage_test.go create mode 100644 pkg/handlers/scheduler/pod/handler_test.go create mode 100644 pkg/handlers/scheduler/pod/local.go create mode 100644 pkg/handlers/scheduler/pod/register.go create mode 100644 pkg/handlers/scheduler/pod/suite_test.go create mode 100644 pkg/scheduler/profiles.go delete mode 100644 pkg/scheduler/scheduler.go delete mode 100644 pkg/scheduler/scheduler_test.go rename pkg/{crd/arangoprofile.go => util/constants/profiles.go} (69%) create mode 100644 pkg/util/k8sutil/gvk.go create mode 100644 pkg/util/k8sutil/patcher/metadata.go create mode 100644 pkg/util/tests/ap.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 8afd9abe6..4b451c1ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - (Feature) (Networking) Endpoints Destination - (Improvement) Improve Metrics Handling - (Feature) (Scheduler) Create Integration Profile +- (Feature) (Scheduler) Additional types ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index c59780eb2..7c176d50e 100644 --- a/Makefile +++ b/Makefile @@ -911,7 +911,7 @@ CRDS:=apps-job \ database-clustersynchronization database-deployment database-member database-task \ replication-deploymentreplication \ ml-storage ml-extension ml-job-batch ml-job-cron \ - scheduler-profile \ + scheduler-profile scheduler-pod scheduler-deployment scheduler-batchjob scheduler-cronjob \ analytics-graphanalyticsengine \ networking-route diff --git a/README.md b/README.md index f6b852ac8..5643abcbd 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, scheduler-profile-operator, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, generic-parent-operator, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, scheduler-batchjob-operator, scheduler-cronjob-operator, scheduler-deployment-operator, scheduler-pod-operator, scheduler-profile-operator, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes diff --git a/chart/kube-arangodb-arm64/crds/scheduler-batchjob.yaml b/chart/kube-arangodb-arm64/crds/scheduler-batchjob.yaml new file mode 100644 index 000000000..e20a31952 --- /dev/null +++ b/chart/kube-arangodb-arm64/crds/scheduler-batchjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-arm64/crds/scheduler-cronjob.yaml b/chart/kube-arangodb-arm64/crds/scheduler-cronjob.yaml new file mode 100644 index 000000000..7c6b02d9b --- /dev/null +++ b/chart/kube-arangodb-arm64/crds/scheduler-cronjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-arm64/crds/scheduler-deployment.yaml b/chart/kube-arangodb-arm64/crds/scheduler-deployment.yaml new file mode 100644 index 000000000..0178e1c89 --- /dev/null +++ b/chart/kube-arangodb-arm64/crds/scheduler-deployment.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-arm64/crds/scheduler-pod.yaml b/chart/kube-arangodb-arm64/crds/scheduler-pod.yaml new file mode 100644 index 000000000..97ab5f973 --- /dev/null +++ b/chart/kube-arangodb-arm64/crds/scheduler-pod.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml index 93ee7ad4d..17936fa1b 100644 --- a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml @@ -68,6 +68,10 @@ rules: verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml b/chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml index 46a3d92f0..f254c77c6 100644 --- a/chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml +++ b/chart/kube-arangodb-arm64/templates/scheduler-operator/role.yaml @@ -18,6 +18,37 @@ rules: resources: - "arangoprofiles" - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" verbs: - "*" - apiGroups: diff --git a/chart/kube-arangodb-enterprise-arm64/crds/scheduler-batchjob.yaml b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-batchjob.yaml new file mode 100644 index 000000000..e20a31952 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-batchjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise-arm64/crds/scheduler-cronjob.yaml b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-cronjob.yaml new file mode 100644 index 000000000..7c6b02d9b --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-cronjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise-arm64/crds/scheduler-deployment.yaml b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-deployment.yaml new file mode 100644 index 000000000..0178e1c89 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-deployment.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise-arm64/crds/scheduler-pod.yaml b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-pod.yaml new file mode 100644 index 000000000..97ab5f973 --- /dev/null +++ b/chart/kube-arangodb-enterprise-arm64/crds/scheduler-pod.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml index 93ee7ad4d..17936fa1b 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml @@ -68,6 +68,10 @@ rules: verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml index 46a3d92f0..f254c77c6 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/scheduler-operator/role.yaml @@ -18,6 +18,37 @@ rules: resources: - "arangoprofiles" - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" verbs: - "*" - apiGroups: diff --git a/chart/kube-arangodb-enterprise/crds/scheduler-batchjob.yaml b/chart/kube-arangodb-enterprise/crds/scheduler-batchjob.yaml new file mode 100644 index 000000000..e20a31952 --- /dev/null +++ b/chart/kube-arangodb-enterprise/crds/scheduler-batchjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise/crds/scheduler-cronjob.yaml b/chart/kube-arangodb-enterprise/crds/scheduler-cronjob.yaml new file mode 100644 index 000000000..7c6b02d9b --- /dev/null +++ b/chart/kube-arangodb-enterprise/crds/scheduler-cronjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise/crds/scheduler-deployment.yaml b/chart/kube-arangodb-enterprise/crds/scheduler-deployment.yaml new file mode 100644 index 000000000..0178e1c89 --- /dev/null +++ b/chart/kube-arangodb-enterprise/crds/scheduler-deployment.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise/crds/scheduler-pod.yaml b/chart/kube-arangodb-enterprise/crds/scheduler-pod.yaml new file mode 100644 index 000000000..97ab5f973 --- /dev/null +++ b/chart/kube-arangodb-enterprise/crds/scheduler-pod.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml index 93ee7ad4d..17936fa1b 100644 --- a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml @@ -68,6 +68,10 @@ rules: verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml b/chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml index 46a3d92f0..f254c77c6 100644 --- a/chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml +++ b/chart/kube-arangodb-enterprise/templates/scheduler-operator/role.yaml @@ -18,6 +18,37 @@ rules: resources: - "arangoprofiles" - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" verbs: - "*" - apiGroups: diff --git a/chart/kube-arangodb/crds/scheduler-batchjob.yaml b/chart/kube-arangodb/crds/scheduler-batchjob.yaml new file mode 100644 index 000000000..e20a31952 --- /dev/null +++ b/chart/kube-arangodb/crds/scheduler-batchjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb/crds/scheduler-cronjob.yaml b/chart/kube-arangodb/crds/scheduler-cronjob.yaml new file mode 100644 index 000000000..7c6b02d9b --- /dev/null +++ b/chart/kube-arangodb/crds/scheduler-cronjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb/crds/scheduler-deployment.yaml b/chart/kube-arangodb/crds/scheduler-deployment.yaml new file mode 100644 index 000000000..0178e1c89 --- /dev/null +++ b/chart/kube-arangodb/crds/scheduler-deployment.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb/crds/scheduler-pod.yaml b/chart/kube-arangodb/crds/scheduler-pod.yaml new file mode 100644 index 000000000..97ab5f973 --- /dev/null +++ b/chart/kube-arangodb/crds/scheduler-pod.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/chart/kube-arangodb/templates/crd/cluster-role.yaml b/chart/kube-arangodb/templates/crd/cluster-role.yaml index 93ee7ad4d..17936fa1b 100644 --- a/chart/kube-arangodb/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb/templates/crd/cluster-role.yaml @@ -68,6 +68,10 @@ rules: verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" {{- end }} {{- end }} diff --git a/chart/kube-arangodb/templates/scheduler-operator/role.yaml b/chart/kube-arangodb/templates/scheduler-operator/role.yaml index 46a3d92f0..f254c77c6 100644 --- a/chart/kube-arangodb/templates/scheduler-operator/role.yaml +++ b/chart/kube-arangodb/templates/scheduler-operator/role.yaml @@ -18,6 +18,37 @@ rules: resources: - "arangoprofiles" - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" verbs: - "*" - apiGroups: diff --git a/docs/cli/arangodb_operator.md b/docs/cli/arangodb_operator.md index 0caa979b0..390ac513b 100644 --- a/docs/cli/arangodb_operator.md +++ b/docs/cli/arangodb_operator.md @@ -80,7 +80,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, scheduler-profile-operator, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, generic-parent-operator, http, inspector, integration-config-v1, integration-envoy-auth-v3, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, scheduler-batchjob-operator, scheduler-cronjob-operator, scheduler-deployment-operator, scheduler-pod-operator, scheduler-profile-operator, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes diff --git a/integrations/scheduler/v1/batch_job.go b/integrations/scheduler/v1/batch_job.go new file mode 100644 index 000000000..c2316ea0e --- /dev/null +++ b/integrations/scheduler/v1/batch_job.go @@ -0,0 +1,177 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/generators/kubernetes" + "github.com/arangodb/kube-arangodb/pkg/scheduler" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" +) + +func (i *implementation) CreateBatchJob(ctx context.Context, request *pbSchedulerV1.CreateBatchJobRequest) (*pbSchedulerV1.CreateBatchJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + template := scheduler.SpecAsTemplate(request.GetSpec()) + + var spec schedulerApi.ArangoSchedulerBatchJob + + spec.Namespace = i.cfg.Namespace + + if meta := request.GetSpec().GetMetadata(); meta != nil { + if util.TypeOrDefault(meta.GenerateName, false) { + spec.GenerateName = meta.Name + } else { + spec.Name = meta.Name + } + } + + spec.Spec.Template = *template + + if batchJob := request.GetBatchJob(); batchJob != nil { + if v := batchJob.Completions; v != nil { + spec.Spec.Completions = v + } + + if v := batchJob.Parallelism; v != nil { + spec.Spec.Parallelism = v + } + + if v := batchJob.BackoffLimit; v != nil { + spec.Spec.BackoffLimit = v + } + } + + if batchJobSpec := request.GetSpec(); batchJobSpec != nil { + if base := batchJobSpec.Base; base != nil { + spec.Labels = base.Labels + } + } + + job, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerBatchJobs(i.cfg.Namespace).Create(ctx, &spec, meta.CreateOptions{}) + + if err != nil { + return nil, err + } + + return &pbSchedulerV1.CreateBatchJobResponse{ + Name: job.Name, + }, nil +} + +func (i *implementation) GetBatchJob(ctx context.Context, request *pbSchedulerV1.GetBatchJobRequest) (*pbSchedulerV1.GetBatchJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + job, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerBatchJobs(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.GetBatchJobResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.GetBatchJobResponse{ + Exists: true, + + BatchJob: &pbSchedulerV1.BatchJob{ + Metadata: ExtractStatusMetadata(job.Status.ArangoSchedulerStatusMetadata), + Spec: &pbSchedulerV1.BatchJobSpec{ + Parallelism: job.Spec.Parallelism, + Completions: job.Spec.Completions, + BackoffLimit: job.Spec.BackoffLimit, + }, + Status: &pbSchedulerV1.BatchJobStatus{ + Active: job.Status.Active, + Succeeded: job.Status.Succeeded, + Failed: job.Status.Failed, + }, + }, + }, nil +} + +func (i *implementation) DeleteBatchJob(ctx context.Context, request *pbSchedulerV1.DeleteBatchJobRequest) (*pbSchedulerV1.DeleteBatchJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + var d meta.DeleteOptions + + if v := request.DeleteChildPods; v != nil { + if *v { + d.PropagationPolicy = util.NewType(meta.DeletePropagationBackground) + } else { + d.PropagationPolicy = util.NewType(meta.DeletePropagationOrphan) + } + } + + err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerBatchJobs(i.cfg.Namespace).Delete(ctx, request.GetName(), d) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.DeleteBatchJobResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.DeleteBatchJobResponse{Exists: true}, nil +} + +func (i *implementation) ListBatchJob(ctx context.Context, request *pbSchedulerV1.ListBatchJobRequest) (*pbSchedulerV1.ListBatchJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + objects, err := kubernetes.ListObjects[*schedulerApi.ArangoSchedulerBatchJobList, *schedulerApi.ArangoSchedulerBatchJob](ctx, i.client.Arango().SchedulerV1beta1().ArangoSchedulerBatchJobs(i.cfg.Namespace), func(result *schedulerApi.ArangoSchedulerBatchJobList) []*schedulerApi.ArangoSchedulerBatchJob { + r := make([]*schedulerApi.ArangoSchedulerBatchJob, len(result.Items)) + + for id := range result.Items { + r[id] = result.Items[id].DeepCopy() + } + + return r + }) + + if err != nil { + return nil, err + } + + return &pbSchedulerV1.ListBatchJobResponse{ + BatchJobs: util.FormatList(objects, func(in *schedulerApi.ArangoSchedulerBatchJob) string { + return in.GetName() + }), + }, nil +} diff --git a/integrations/scheduler/v1/batch_job_test.go b/integrations/scheduler/v1/batch_job_test.go index 368bee751..b7dedb741 100644 --- a/integrations/scheduler/v1/batch_job_test.go +++ b/integrations/scheduler/v1/batch_job_test.go @@ -25,7 +25,6 @@ import ( "testing" "github.com/stretchr/testify/require" - batch "k8s.io/api/batch/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" @@ -42,7 +41,7 @@ func Test_BatchJob(t *testing.T) { client := kclient.NewFakeClientBuilder().Add( tests.NewMetaObject(t, tests.FakeNamespace, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { obj.Spec = schedulerApi.ProfileSpec{} - }), + }, tests.MarkArangoProfileAsReady), tests.NewMetaObject(t, tests.FakeNamespace, "test-select-all", func(t *testing.T, obj *schedulerApi.ArangoProfile) { obj.Spec = schedulerApi.ProfileSpec{ Selectors: &schedulerApi.ProfileSelectors{ @@ -50,7 +49,7 @@ func Test_BatchJob(t *testing.T) { }, Template: &schedulerApi.ProfileTemplate{}, } - }), + }, tests.MarkArangoProfileAsReady), tests.NewMetaObject(t, tests.FakeNamespace, "test-select-specific", func(t *testing.T, obj *schedulerApi.ArangoProfile) { obj.Spec = schedulerApi.ProfileSpec{ Selectors: &schedulerApi.ProfileSelectors{ @@ -62,7 +61,7 @@ func Test_BatchJob(t *testing.T) { }, Template: &schedulerApi.ProfileTemplate{}, } - }), + }, tests.MarkArangoProfileAsReady), ).Client() scheduler := Client(t, ctx, client, func(c Configuration) Configuration { @@ -93,7 +92,7 @@ func Test_BatchJob(t *testing.T) { Metadata: &pbSchedulerV1.Metadata{ Name: "test", }, - Job: &pbSchedulerV1.JobBase{ + Base: &pbSchedulerV1.ObjectBase{ Labels: nil, Profiles: []string{ "test", @@ -117,10 +116,6 @@ func Test_BatchJob(t *testing.T) { require.NoError(t, err) require.EqualValues(t, "test", resp.GetName()) - require.Len(t, resp.Profiles, 2) - require.Contains(t, resp.Profiles, "test") - require.Contains(t, resp.Profiles, "test-select-all") - require.NotContains(t, resp.Profiles, "test-select-specific") }) t.Run("Ensure job exist - get", func(t *testing.T) { @@ -151,7 +146,7 @@ func Test_BatchJob(t *testing.T) { }) t.Run("Ensure job details - update", func(t *testing.T) { - job := tests.NewMetaObject[*batch.Job](t, tests.FakeNamespace, "test") + job := tests.NewMetaObject[*schedulerApi.ArangoSchedulerBatchJob](t, tests.FakeNamespace, "test") tests.RefreshObjectsC(t, client, &job) diff --git a/integrations/scheduler/v1/cron_job.go b/integrations/scheduler/v1/cron_job.go new file mode 100644 index 000000000..892d91d75 --- /dev/null +++ b/integrations/scheduler/v1/cron_job.go @@ -0,0 +1,249 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/generators/kubernetes" + "github.com/arangodb/kube-arangodb/pkg/scheduler" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" +) + +func (i *implementation) CreateCronJob(ctx context.Context, request *pbSchedulerV1.CreateCronJobRequest) (*pbSchedulerV1.CreateCronJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + template := scheduler.SpecAsTemplate(request.GetSpec()) + + var spec schedulerApi.ArangoSchedulerCronJob + + spec.Namespace = i.cfg.Namespace + + if meta := request.GetSpec().GetMetadata(); meta != nil { + if util.TypeOrDefault(meta.GenerateName, false) { + spec.GenerateName = meta.Name + } else { + spec.Name = meta.Name + } + } + + spec.Spec.JobTemplate.Spec.Template = *template + + if cronJob := request.GetCronJob(); cronJob != nil { + spec.Spec.Schedule = cronJob.Schedule + + if batchJob := cronJob.GetJob(); batchJob != nil { + if v := batchJob.Completions; v != nil { + spec.Spec.JobTemplate.Spec.Completions = v + } + + if v := batchJob.Parallelism; v != nil { + spec.Spec.JobTemplate.Spec.Parallelism = v + } + + if v := batchJob.BackoffLimit; v != nil { + spec.Spec.JobTemplate.Spec.BackoffLimit = v + } + } + } + + if batchJobSpec := request.GetSpec(); batchJobSpec != nil { + if base := batchJobSpec.Base; base != nil { + spec.Labels = base.Labels + spec.Spec.JobTemplate.Labels = base.Labels + } + } + + job, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(i.cfg.Namespace).Create(ctx, &spec, meta.CreateOptions{}) + + if err != nil { + return nil, err + } + + return &pbSchedulerV1.CreateCronJobResponse{ + Name: job.Name, + }, nil +} + +func (i *implementation) GetCronJob(ctx context.Context, request *pbSchedulerV1.GetCronJobRequest) (*pbSchedulerV1.GetCronJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + job, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.GetCronJobResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.GetCronJobResponse{ + Exists: true, + + CronJob: &pbSchedulerV1.CronJob{ + Metadata: ExtractStatusMetadata(job.Status.ArangoSchedulerStatusMetadata), + Spec: &pbSchedulerV1.CronJobSpec{ + Schedule: job.Spec.Schedule, + + Job: &pbSchedulerV1.BatchJobSpec{ + Parallelism: job.Spec.JobTemplate.Spec.Parallelism, + Completions: job.Spec.JobTemplate.Spec.Completions, + BackoffLimit: job.Spec.JobTemplate.Spec.BackoffLimit, + }, + }, + Status: &pbSchedulerV1.CronJobStatus{ + BatchJobs: util.FormatList(job.Status.Active, func(in core.ObjectReference) string { + return in.Name + }), + }, + }, + }, nil +} + +func (i *implementation) UpdateCronJob(ctx context.Context, request *pbSchedulerV1.UpdateCronJobRequest) (*pbSchedulerV1.UpdateCronJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + job, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.UpdateCronJobResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + if cronJob := request.GetSpec(); cronJob != nil { + job.Spec.Schedule = cronJob.Schedule + + if batchJob := cronJob.GetJob(); batchJob != nil { + if v := batchJob.Completions; v != nil { + job.Spec.JobTemplate.Spec.Completions = v + } + + if v := batchJob.Parallelism; v != nil { + job.Spec.JobTemplate.Spec.Parallelism = v + } + + if v := batchJob.BackoffLimit; v != nil { + job.Spec.JobTemplate.Spec.BackoffLimit = v + } + } + } + + job, err = i.client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(i.cfg.Namespace).Update(ctx, job, meta.UpdateOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.UpdateCronJobResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.UpdateCronJobResponse{ + Exists: true, + + CronJob: &pbSchedulerV1.CronJob{ + Spec: &pbSchedulerV1.CronJobSpec{ + Schedule: job.Spec.Schedule, + + Job: &pbSchedulerV1.BatchJobSpec{ + Parallelism: job.Spec.JobTemplate.Spec.Parallelism, + Completions: job.Spec.JobTemplate.Spec.Completions, + BackoffLimit: job.Spec.JobTemplate.Spec.BackoffLimit, + }, + }, + }, + }, nil +} + +func (i *implementation) ListCronJob(ctx context.Context, request *pbSchedulerV1.ListCronJobRequest) (*pbSchedulerV1.ListCronJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + objects, err := kubernetes.ListObjects[*schedulerApi.ArangoSchedulerCronJobList, *schedulerApi.ArangoSchedulerCronJob](ctx, i.client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(i.cfg.Namespace), func(result *schedulerApi.ArangoSchedulerCronJobList) []*schedulerApi.ArangoSchedulerCronJob { + r := make([]*schedulerApi.ArangoSchedulerCronJob, len(result.Items)) + + for id := range result.Items { + r[id] = result.Items[id].DeepCopy() + } + + return r + }) + + if err != nil { + return nil, err + } + + return &pbSchedulerV1.ListCronJobResponse{ + CronJobs: util.FormatList(objects, func(in *schedulerApi.ArangoSchedulerCronJob) string { + return in.GetName() + }), + }, nil +} + +func (i *implementation) DeleteCronJob(ctx context.Context, request *pbSchedulerV1.DeleteCronJobRequest) (*pbSchedulerV1.DeleteCronJobResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + var d meta.DeleteOptions + + if v := request.DeleteChildPods; v != nil { + if *v { + d.PropagationPolicy = util.NewType(meta.DeletePropagationBackground) + } else { + d.PropagationPolicy = util.NewType(meta.DeletePropagationOrphan) + } + } + + err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(i.cfg.Namespace).Delete(ctx, request.GetName(), d) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.DeleteCronJobResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.DeleteCronJobResponse{Exists: true}, nil +} diff --git a/integrations/scheduler/v1/cron_job_test.go b/integrations/scheduler/v1/cron_job_test.go index ecddcdac2..3ae9441f1 100644 --- a/integrations/scheduler/v1/cron_job_test.go +++ b/integrations/scheduler/v1/cron_job_test.go @@ -25,7 +25,6 @@ import ( "testing" "github.com/stretchr/testify/require" - batch "k8s.io/api/batch/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -43,7 +42,7 @@ func Test_CronJob(t *testing.T) { client := kclient.NewFakeClientBuilder().Add( tests.NewMetaObject(t, tests.FakeNamespace, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { obj.Spec = schedulerApi.ProfileSpec{} - }), + }, tests.MarkArangoProfileAsReady), tests.NewMetaObject(t, tests.FakeNamespace, "test-select-all", func(t *testing.T, obj *schedulerApi.ArangoProfile) { obj.Spec = schedulerApi.ProfileSpec{ Selectors: &schedulerApi.ProfileSelectors{ @@ -51,7 +50,7 @@ func Test_CronJob(t *testing.T) { }, Template: &schedulerApi.ProfileTemplate{}, } - }), + }, tests.MarkArangoProfileAsReady), tests.NewMetaObject(t, tests.FakeNamespace, "test-select-specific", func(t *testing.T, obj *schedulerApi.ArangoProfile) { obj.Spec = schedulerApi.ProfileSpec{ Selectors: &schedulerApi.ProfileSelectors{ @@ -63,7 +62,7 @@ func Test_CronJob(t *testing.T) { }, Template: &schedulerApi.ProfileTemplate{}, } - }), + }, tests.MarkArangoProfileAsReady), ).Client() scheduler := Client(t, ctx, client, func(c Configuration) Configuration { @@ -94,7 +93,7 @@ func Test_CronJob(t *testing.T) { Metadata: &pbSchedulerV1.Metadata{ Name: "test", }, - Job: &pbSchedulerV1.JobBase{ + Base: &pbSchedulerV1.ObjectBase{ Labels: nil, Profiles: []string{ "test", @@ -123,10 +122,6 @@ func Test_CronJob(t *testing.T) { require.NoError(t, err) require.EqualValues(t, "test", resp.GetName()) - require.Len(t, resp.Profiles, 2) - require.Contains(t, resp.Profiles, "test") - require.Contains(t, resp.Profiles, "test-select-all") - require.NotContains(t, resp.Profiles, "test-select-specific") }) t.Run("Ensure job exist - get", func(t *testing.T) { @@ -153,11 +148,11 @@ func Test_CronJob(t *testing.T) { require.NoError(t, err) require.True(t, resp.GetExists()) - require.Len(t, resp.GetBatchJobs(), 0) + require.Len(t, resp.GetCronJob().GetStatus().GetBatchJobs(), 0) }) t.Run("Ensure job details - update", func(t *testing.T) { - job := tests.NewMetaObject[*batch.CronJob](t, tests.FakeNamespace, "test") + job := tests.NewMetaObject[*schedulerApi.ArangoSchedulerCronJob](t, tests.FakeNamespace, "test") tests.RefreshObjectsC(t, client, &job) @@ -177,7 +172,7 @@ func Test_CronJob(t *testing.T) { require.NoError(t, err) require.True(t, resp.GetExists()) - require.Len(t, resp.GetBatchJobs(), 1) + require.Len(t, resp.GetCronJob().GetStatus().GetBatchJobs(), 1) }) t.Run("Update Job - Pre", func(t *testing.T) { diff --git a/integrations/scheduler/v1/definition/batchjob.pb.go b/integrations/scheduler/v1/definition/batchjob.pb.go index fc6bbb589..dbc1e3c4b 100644 --- a/integrations/scheduler/v1/definition/batchjob.pb.go +++ b/integrations/scheduler/v1/definition/batchjob.pb.go @@ -46,10 +46,12 @@ type BatchJob struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // defines object status metadate + Metadata *StatusMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Keeps BatchJob settings - Spec *BatchJobSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` + Spec *BatchJobSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` // Keeps current BatchJob Status - Status *BatchJobStatus `protobuf:"bytes,2,opt,name=status,proto3,oneof" json:"status,omitempty"` + Status *BatchJobStatus `protobuf:"bytes,3,opt,name=status,proto3,oneof" json:"status,omitempty"` } func (x *BatchJob) Reset() { @@ -84,6 +86,13 @@ func (*BatchJob) Descriptor() ([]byte, []int) { return file_integrations_scheduler_v1_definition_batchjob_proto_rawDescGZIP(), []int{0} } +func (x *BatchJob) GetMetadata() *StatusMetadata { + if x != nil { + return x.Metadata + } + return nil +} + func (x *BatchJob) GetSpec() *BatchJobSpec { if x != nil { return x.Spec @@ -239,37 +248,44 @@ var file_integrations_scheduler_v1_definition_batchjob_proto_rawDesc = []byte{ 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x6a, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, - 0x22, 0x7a, 0x0a, 0x08, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x12, 0x2b, 0x0a, 0x04, - 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, - 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x88, 0x01, - 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xb8, 0x01, 0x0a, - 0x0c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, - 0x0b, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x69, 0x73, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x69, 0x73, - 0x6d, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x62, - 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x48, 0x02, 0x52, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, - 0x65, 0x6c, 0x69, 0x73, 0x6d, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, - 0x66, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x5e, 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, - 0x75, 0x62, 0x65, 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x31, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xb1, 0x01, 0x0a, 0x08, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, + 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, + 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, + 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x61, + 0x6c, 0x6c, 0x65, 0x6c, 0x69, 0x73, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, + 0x0b, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x69, 0x73, 0x6d, 0x88, 0x01, 0x01, 0x12, + 0x25, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, + 0x66, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, + 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x69, 0x73, 0x6d, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x5e, 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, + 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, 0x61, + 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, + 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -289,15 +305,17 @@ var file_integrations_scheduler_v1_definition_batchjob_proto_goTypes = []interfa (*BatchJob)(nil), // 0: scheduler.BatchJob (*BatchJobSpec)(nil), // 1: scheduler.BatchJobSpec (*BatchJobStatus)(nil), // 2: scheduler.BatchJobStatus + (*StatusMetadata)(nil), // 3: scheduler.StatusMetadata } var file_integrations_scheduler_v1_definition_batchjob_proto_depIdxs = []int32{ - 1, // 0: scheduler.BatchJob.spec:type_name -> scheduler.BatchJobSpec - 2, // 1: scheduler.BatchJob.status:type_name -> scheduler.BatchJobStatus - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 3, // 0: scheduler.BatchJob.metadata:type_name -> scheduler.StatusMetadata + 1, // 1: scheduler.BatchJob.spec:type_name -> scheduler.BatchJobSpec + 2, // 2: scheduler.BatchJob.status:type_name -> scheduler.BatchJobStatus + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_integrations_scheduler_v1_definition_batchjob_proto_init() } @@ -305,6 +323,7 @@ func file_integrations_scheduler_v1_definition_batchjob_proto_init() { if File_integrations_scheduler_v1_definition_batchjob_proto != nil { return } + file_integrations_scheduler_v1_definition_common_proto_init() if !protoimpl.UnsafeEnabled { file_integrations_scheduler_v1_definition_batchjob_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchJob); i { diff --git a/integrations/scheduler/v1/definition/batchjob.proto b/integrations/scheduler/v1/definition/batchjob.proto index 51492a6cc..309a8f2fd 100644 --- a/integrations/scheduler/v1/definition/batchjob.proto +++ b/integrations/scheduler/v1/definition/batchjob.proto @@ -22,15 +22,20 @@ syntax = "proto3"; package scheduler; +import "integrations/scheduler/v1/definition/common.proto"; + option go_package = "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition"; // Keeps information about Kubernetes Batch/V1 Job message BatchJob { + // defines object status metadate + StatusMetadata metadata = 1; + // Keeps BatchJob settings - BatchJobSpec spec = 1; + BatchJobSpec spec = 2; // Keeps current BatchJob Status - optional BatchJobStatus status = 2; + optional BatchJobStatus status = 3; } // Information about BatchJob run settings, like completions and parallelism diff --git a/integrations/scheduler/v1/definition/common.pb.go b/integrations/scheduler/v1/definition/common.pb.go index 6a2ed6844..e07fa1901 100644 --- a/integrations/scheduler/v1/definition/common.pb.go +++ b/integrations/scheduler/v1/definition/common.pb.go @@ -40,8 +40,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Common base of the Jobs -type JobBase struct { +// Common base of the objects +type ObjectBase struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -52,8 +52,8 @@ type JobBase struct { Profiles []string `protobuf:"bytes,2,rep,name=profiles,proto3" json:"profiles,omitempty"` } -func (x *JobBase) Reset() { - *x = JobBase{} +func (x *ObjectBase) Reset() { + *x = ObjectBase{} if protoimpl.UnsafeEnabled { mi := &file_integrations_scheduler_v1_definition_common_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -61,13 +61,13 @@ func (x *JobBase) Reset() { } } -func (x *JobBase) String() string { +func (x *ObjectBase) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JobBase) ProtoMessage() {} +func (*ObjectBase) ProtoMessage() {} -func (x *JobBase) ProtoReflect() protoreflect.Message { +func (x *ObjectBase) ProtoReflect() protoreflect.Message { mi := &file_integrations_scheduler_v1_definition_common_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -79,19 +79,19 @@ func (x *JobBase) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use JobBase.ProtoReflect.Descriptor instead. -func (*JobBase) Descriptor() ([]byte, []int) { +// Deprecated: Use ObjectBase.ProtoReflect.Descriptor instead. +func (*ObjectBase) Descriptor() ([]byte, []int) { return file_integrations_scheduler_v1_definition_common_proto_rawDescGZIP(), []int{0} } -func (x *JobBase) GetLabels() map[string]string { +func (x *ObjectBase) GetLabels() map[string]string { if x != nil { return x.Labels } return nil } -func (x *JobBase) GetProfiles() []string { +func (x *ObjectBase) GetProfiles() []string { if x != nil { return x.Profiles } @@ -232,7 +232,7 @@ type Spec struct { // Keeps requested Metadata Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Keeps requested Job base - Job *JobBase `protobuf:"bytes,2,opt,name=job,proto3" json:"job,omitempty"` + Base *ObjectBase `protobuf:"bytes,2,opt,name=base,proto3" json:"base,omitempty"` // Keeps map of the containers Containers map[string]*ContainerBase `protobuf:"bytes,3,rep,name=containers,proto3" json:"containers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } @@ -276,9 +276,9 @@ func (x *Spec) GetMetadata() *Metadata { return nil } -func (x *Spec) GetJob() *JobBase { +func (x *Spec) GetBase() *ObjectBase { if x != nil { - return x.Job + return x.Base } return nil } @@ -290,65 +290,151 @@ func (x *Spec) GetContainers() map[string]*ContainerBase { return nil } +// Defines status of the scheduled object +type StatusMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Defines if upstream object has been created + Created bool `protobuf:"varint,1,opt,name=created,proto3" json:"created,omitempty"` + // Defines checksum + Checksum *string `protobuf:"bytes,2,opt,name=checksum,proto3,oneof" json:"checksum,omitempty"` + // Defines uid + Uid *string `protobuf:"bytes,3,opt,name=uid,proto3,oneof" json:"uid,omitempty"` + // Defiles list of applied profiles + Profiles []string `protobuf:"bytes,4,rep,name=profiles,proto3" json:"profiles,omitempty"` +} + +func (x *StatusMetadata) Reset() { + *x = StatusMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusMetadata) ProtoMessage() {} + +func (x *StatusMetadata) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_common_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusMetadata.ProtoReflect.Descriptor instead. +func (*StatusMetadata) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_common_proto_rawDescGZIP(), []int{4} +} + +func (x *StatusMetadata) GetCreated() bool { + if x != nil { + return x.Created + } + return false +} + +func (x *StatusMetadata) GetChecksum() string { + if x != nil && x.Checksum != nil { + return *x.Checksum + } + return "" +} + +func (x *StatusMetadata) GetUid() string { + if x != nil && x.Uid != nil { + return *x.Uid + } + return "" +} + +func (x *StatusMetadata) GetProfiles() []string { + if x != nil { + return x.Profiles + } + return nil +} + var File_integrations_scheduler_v1_definition_common_proto protoreflect.FileDescriptor var file_integrations_scheduler_v1_definition_common_proto_rawDesc = []byte{ 0x0a, 0x31, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x22, 0x98, - 0x01, 0x0a, 0x07, 0x4a, 0x6f, 0x62, 0x42, 0x61, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4a, 0x6f, 0x62, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x39, - 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x5a, 0x0a, 0x08, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xfa, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x42, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x88, - 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x67, 0x0a, 0x15, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, - 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x73, 0x65, 0x2e, - 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x14, 0x65, 0x6e, 0x76, 0x69, 0x72, - 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x1a, - 0x47, 0x0a, 0x19, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x22, 0xf7, 0x01, 0x0a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x12, 0x2f, 0x0a, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x03, - 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4a, 0x6f, 0x62, 0x42, 0x61, 0x73, 0x65, 0x52, 0x03, 0x6a, - 0x6f, 0x62, 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x72, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x73, 0x1a, 0x57, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x73, - 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x48, 0x5a, 0x46, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, - 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, - 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x22, 0x9e, + 0x01, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x61, 0x73, 0x65, 0x12, 0x39, 0x0a, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x42, 0x61, 0x73, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x5a, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x28, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xfa, 0x01, 0x0a, 0x0d, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x67, 0x0a, 0x15, + 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x72, 0x69, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x73, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x14, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72, 0x69, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x1a, 0x47, 0x0a, 0x19, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x04, 0x53, 0x70, 0x65, + 0x63, 0x12, 0x2f, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x29, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x42, 0x61, 0x73, 0x65, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x3f, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x70, + 0x65, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x57, + 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x73, 0x65, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x93, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x75, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x01, 0x52, 0x03, 0x75, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x69, 0x64, 0x42, 0x48, 0x5a, + 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, + 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, + 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -363,22 +449,23 @@ func file_integrations_scheduler_v1_definition_common_proto_rawDescGZIP() []byte return file_integrations_scheduler_v1_definition_common_proto_rawDescData } -var file_integrations_scheduler_v1_definition_common_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_integrations_scheduler_v1_definition_common_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_integrations_scheduler_v1_definition_common_proto_goTypes = []interface{}{ - (*JobBase)(nil), // 0: scheduler.JobBase - (*Metadata)(nil), // 1: scheduler.Metadata - (*ContainerBase)(nil), // 2: scheduler.ContainerBase - (*Spec)(nil), // 3: scheduler.Spec - nil, // 4: scheduler.JobBase.LabelsEntry - nil, // 5: scheduler.ContainerBase.EnvironmentVariablesEntry - nil, // 6: scheduler.Spec.ContainersEntry + (*ObjectBase)(nil), // 0: scheduler.ObjectBase + (*Metadata)(nil), // 1: scheduler.Metadata + (*ContainerBase)(nil), // 2: scheduler.ContainerBase + (*Spec)(nil), // 3: scheduler.Spec + (*StatusMetadata)(nil), // 4: scheduler.StatusMetadata + nil, // 5: scheduler.ObjectBase.LabelsEntry + nil, // 6: scheduler.ContainerBase.EnvironmentVariablesEntry + nil, // 7: scheduler.Spec.ContainersEntry } var file_integrations_scheduler_v1_definition_common_proto_depIdxs = []int32{ - 4, // 0: scheduler.JobBase.labels:type_name -> scheduler.JobBase.LabelsEntry - 5, // 1: scheduler.ContainerBase.environment_variables:type_name -> scheduler.ContainerBase.EnvironmentVariablesEntry + 5, // 0: scheduler.ObjectBase.labels:type_name -> scheduler.ObjectBase.LabelsEntry + 6, // 1: scheduler.ContainerBase.environment_variables:type_name -> scheduler.ContainerBase.EnvironmentVariablesEntry 1, // 2: scheduler.Spec.metadata:type_name -> scheduler.Metadata - 0, // 3: scheduler.Spec.job:type_name -> scheduler.JobBase - 6, // 4: scheduler.Spec.containers:type_name -> scheduler.Spec.ContainersEntry + 0, // 3: scheduler.Spec.base:type_name -> scheduler.ObjectBase + 7, // 4: scheduler.Spec.containers:type_name -> scheduler.Spec.ContainersEntry 2, // 5: scheduler.Spec.ContainersEntry.value:type_name -> scheduler.ContainerBase 6, // [6:6] is the sub-list for method output_type 6, // [6:6] is the sub-list for method input_type @@ -394,7 +481,7 @@ func file_integrations_scheduler_v1_definition_common_proto_init() { } if !protoimpl.UnsafeEnabled { file_integrations_scheduler_v1_definition_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JobBase); i { + switch v := v.(*ObjectBase); i { case 0: return &v.state case 1: @@ -441,16 +528,29 @@ func file_integrations_scheduler_v1_definition_common_proto_init() { return nil } } + file_integrations_scheduler_v1_definition_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_integrations_scheduler_v1_definition_common_proto_msgTypes[1].OneofWrappers = []interface{}{} file_integrations_scheduler_v1_definition_common_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_integrations_scheduler_v1_definition_common_proto_msgTypes[4].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_integrations_scheduler_v1_definition_common_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/integrations/scheduler/v1/definition/common.proto b/integrations/scheduler/v1/definition/common.proto index ab83b0bbb..525a0a3a2 100644 --- a/integrations/scheduler/v1/definition/common.proto +++ b/integrations/scheduler/v1/definition/common.proto @@ -24,8 +24,8 @@ package scheduler; option go_package = "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition"; -// Common base of the Jobs -message JobBase { +// Common base of the objects +message ObjectBase { // Map of the Labels assigned to the job. Used for Profile selection map labels = 1; @@ -60,8 +60,23 @@ message Spec { Metadata metadata = 1; // Keeps requested Job base - JobBase job = 2; + ObjectBase base = 2; // Keeps map of the containers map containers = 3; } + +// Defines status of the scheduled object +message StatusMetadata { + // Defines if upstream object has been created + bool created = 1; + + // Defines checksum + optional string checksum =2; + + // Defines uid + optional string uid =3; + + // Defiles list of applied profiles + repeated string profiles = 4; +} \ No newline at end of file diff --git a/integrations/scheduler/v1/definition/cronjob.pb.go b/integrations/scheduler/v1/definition/cronjob.pb.go index 6b32da840..fdf642257 100644 --- a/integrations/scheduler/v1/definition/cronjob.pb.go +++ b/integrations/scheduler/v1/definition/cronjob.pb.go @@ -46,8 +46,12 @@ type CronJob struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // defines object status metadate + Metadata *StatusMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Keeps the CronJob Settings - Spec *CronJobSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` + Spec *CronJobSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + // Keeps the CronJob Status + Status *CronJobStatus `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` } func (x *CronJob) Reset() { @@ -82,6 +86,13 @@ func (*CronJob) Descriptor() ([]byte, []int) { return file_integrations_scheduler_v1_definition_cronjob_proto_rawDescGZIP(), []int{0} } +func (x *CronJob) GetMetadata() *StatusMetadata { + if x != nil { + return x.Metadata + } + return nil +} + func (x *CronJob) GetSpec() *CronJobSpec { if x != nil { return x.Spec @@ -89,6 +100,13 @@ func (x *CronJob) GetSpec() *CronJobSpec { return nil } +func (x *CronJob) GetStatus() *CronJobStatus { + if x != nil { + return x.Status + } + return nil +} + // Information about CronJob run settings type CronJobSpec struct { state protoimpl.MessageState @@ -147,6 +165,55 @@ func (x *CronJobSpec) GetJob() *BatchJobSpec { return nil } +// Information about CronJob Status +type CronJobStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Keeps list of created BatchJobs + BatchJobs []string `protobuf:"bytes,1,rep,name=batch_jobs,json=batchJobs,proto3" json:"batch_jobs,omitempty"` +} + +func (x *CronJobStatus) Reset() { + *x = CronJobStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_cronjob_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CronJobStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CronJobStatus) ProtoMessage() {} + +func (x *CronJobStatus) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_cronjob_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CronJobStatus.ProtoReflect.Descriptor instead. +func (*CronJobStatus) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_cronjob_proto_rawDescGZIP(), []int{2} +} + +func (x *CronJobStatus) GetBatchJobs() []string { + if x != nil { + return x.BatchJobs + } + return nil +} + var File_integrations_scheduler_v1_definition_cronjob_proto protoreflect.FileDescriptor var file_integrations_scheduler_v1_definition_cronjob_proto_rawDesc = []byte{ @@ -154,24 +221,36 @@ var file_integrations_scheduler_v1_definition_cronjob_proto_rawDesc = []byte{ 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x72, 0x6f, 0x6e, 0x6a, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x1a, - 0x33, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, + 0x31, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x6a, 0x6f, 0x62, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, 0x07, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, - 0x2a, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x54, 0x0a, 0x0b, 0x43, - 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x29, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x52, 0x03, 0x6a, 0x6f, - 0x62, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, 0x61, 0x72, - 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, - 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x33, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x6a, 0x6f, + 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a, 0x07, 0x43, 0x72, 0x6f, 0x6e, + 0x4a, 0x6f, 0x62, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x54, 0x0a, 0x0b, 0x43, 0x72, 0x6f, 0x6e, + 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x29, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x22, 0x2e, + 0x0a, 0x0d, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x42, 0x48, + 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, + 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, + 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -186,20 +265,24 @@ func file_integrations_scheduler_v1_definition_cronjob_proto_rawDescGZIP() []byt return file_integrations_scheduler_v1_definition_cronjob_proto_rawDescData } -var file_integrations_scheduler_v1_definition_cronjob_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_integrations_scheduler_v1_definition_cronjob_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_integrations_scheduler_v1_definition_cronjob_proto_goTypes = []interface{}{ - (*CronJob)(nil), // 0: scheduler.CronJob - (*CronJobSpec)(nil), // 1: scheduler.CronJobSpec - (*BatchJobSpec)(nil), // 2: scheduler.BatchJobSpec + (*CronJob)(nil), // 0: scheduler.CronJob + (*CronJobSpec)(nil), // 1: scheduler.CronJobSpec + (*CronJobStatus)(nil), // 2: scheduler.CronJobStatus + (*StatusMetadata)(nil), // 3: scheduler.StatusMetadata + (*BatchJobSpec)(nil), // 4: scheduler.BatchJobSpec } var file_integrations_scheduler_v1_definition_cronjob_proto_depIdxs = []int32{ - 1, // 0: scheduler.CronJob.spec:type_name -> scheduler.CronJobSpec - 2, // 1: scheduler.CronJobSpec.job:type_name -> scheduler.BatchJobSpec - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 3, // 0: scheduler.CronJob.metadata:type_name -> scheduler.StatusMetadata + 1, // 1: scheduler.CronJob.spec:type_name -> scheduler.CronJobSpec + 2, // 2: scheduler.CronJob.status:type_name -> scheduler.CronJobStatus + 4, // 3: scheduler.CronJobSpec.job:type_name -> scheduler.BatchJobSpec + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_integrations_scheduler_v1_definition_cronjob_proto_init() } @@ -207,6 +290,7 @@ func file_integrations_scheduler_v1_definition_cronjob_proto_init() { if File_integrations_scheduler_v1_definition_cronjob_proto != nil { return } + file_integrations_scheduler_v1_definition_common_proto_init() file_integrations_scheduler_v1_definition_batchjob_proto_init() if !protoimpl.UnsafeEnabled { file_integrations_scheduler_v1_definition_cronjob_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -233,6 +317,18 @@ func file_integrations_scheduler_v1_definition_cronjob_proto_init() { return nil } } + file_integrations_scheduler_v1_definition_cronjob_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CronJobStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -240,7 +336,7 @@ func file_integrations_scheduler_v1_definition_cronjob_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_integrations_scheduler_v1_definition_cronjob_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/integrations/scheduler/v1/definition/cronjob.proto b/integrations/scheduler/v1/definition/cronjob.proto index b0f37eadc..57fcf3430 100644 --- a/integrations/scheduler/v1/definition/cronjob.proto +++ b/integrations/scheduler/v1/definition/cronjob.proto @@ -22,14 +22,21 @@ syntax = "proto3"; package scheduler; +import "integrations/scheduler/v1/definition/common.proto"; import "integrations/scheduler/v1/definition/batchjob.proto"; option go_package = "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition"; // Keeps information about Kubernetes Batch/V1 CronJob message CronJob { + // defines object status metadate + StatusMetadata metadata = 1; + // Keeps the CronJob Settings - CronJobSpec spec = 1; + CronJobSpec spec = 2; + + // Keeps the CronJob Status + CronJobStatus status = 3; } // Information about CronJob run settings @@ -40,3 +47,9 @@ message CronJobSpec { // Keeps BatchJob settings BatchJobSpec job = 2; } + +// Information about CronJob Status +message CronJobStatus { + // Keeps list of created BatchJobs + repeated string batch_jobs = 1; +} diff --git a/integrations/scheduler/v1/definition/definition.pb.go b/integrations/scheduler/v1/definition/definition.pb.go index a86fab87a..854cb44e4 100644 --- a/integrations/scheduler/v1/definition/definition.pb.go +++ b/integrations/scheduler/v1/definition/definition.pb.go @@ -106,8 +106,6 @@ type CreateBatchJobResponse struct { // Name of the scheduled job Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // List of the assigned profiles - Profiles []string `protobuf:"bytes,2,rep,name=profiles,proto3" json:"profiles,omitempty"` } func (x *CreateBatchJobResponse) Reset() { @@ -149,13 +147,6 @@ func (x *CreateBatchJobResponse) GetName() string { return "" } -func (x *CreateBatchJobResponse) GetProfiles() []string { - if x != nil { - return x.Profiles - } - return nil -} - // Get Request type GetBatchJobRequest struct { state protoimpl.MessageState @@ -524,8 +515,6 @@ type CreateCronJobResponse struct { // Name of the scheduled job Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // List of the assigned profiles - Profiles []string `protobuf:"bytes,2,rep,name=profiles,proto3" json:"profiles,omitempty"` } func (x *CreateCronJobResponse) Reset() { @@ -567,13 +556,6 @@ func (x *CreateCronJobResponse) GetName() string { return "" } -func (x *CreateCronJobResponse) GetProfiles() []string { - if x != nil { - return x.Profiles - } - return nil -} - // Get Request type GetCronJobRequest struct { state protoimpl.MessageState @@ -633,8 +615,6 @@ type GetCronJobResponse struct { Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` // CronJob run settings and current status CronJob *CronJob `protobuf:"bytes,2,opt,name=cron_job,json=cronJob,proto3,oneof" json:"cron_job,omitempty"` - // Keeps list of created BatchJobs - BatchJobs []string `protobuf:"bytes,3,rep,name=batch_jobs,json=batchJobs,proto3" json:"batch_jobs,omitempty"` } func (x *GetCronJobResponse) Reset() { @@ -683,13 +663,6 @@ func (x *GetCronJobResponse) GetCronJob() *CronJob { return nil } -func (x *GetCronJobResponse) GetBatchJobs() []string { - if x != nil { - return x.BatchJobs - } - return nil -} - // Update Request type UpdateCronJobRequest struct { state protoimpl.MessageState @@ -1001,6 +974,531 @@ func (x *DeleteCronJobResponse) GetExists() bool { return false } +// Create Request +type CreateDeploymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Spec of the Schedule request + Spec *Spec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` + // Deployment run settings + Deployment *DeploymentSpec `protobuf:"bytes,2,opt,name=deployment,proto3" json:"deployment,omitempty"` +} + +func (x *CreateDeploymentRequest) Reset() { + *x = CreateDeploymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDeploymentRequest) ProtoMessage() {} + +func (x *CreateDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDeploymentRequest.ProtoReflect.Descriptor instead. +func (*CreateDeploymentRequest) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{18} +} + +func (x *CreateDeploymentRequest) GetSpec() *Spec { + if x != nil { + return x.Spec + } + return nil +} + +func (x *CreateDeploymentRequest) GetDeployment() *DeploymentSpec { + if x != nil { + return x.Deployment + } + return nil +} + +// Create Response +type CreateDeploymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the scheduled deployment + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CreateDeploymentResponse) Reset() { + *x = CreateDeploymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDeploymentResponse) ProtoMessage() {} + +func (x *CreateDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDeploymentResponse.ProtoReflect.Descriptor instead. +func (*CreateDeploymentResponse) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{19} +} + +func (x *CreateDeploymentResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Get Request +type GetDeploymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the scheduled deployment + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetDeploymentRequest) Reset() { + *x = GetDeploymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDeploymentRequest) ProtoMessage() {} + +func (x *GetDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDeploymentRequest.ProtoReflect.Descriptor instead. +func (*GetDeploymentRequest) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{20} +} + +func (x *GetDeploymentRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Get Response +type GetDeploymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Defines if deployment was found + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + // Deployment run settings and current status + Deployment *Deployment `protobuf:"bytes,2,opt,name=deployment,proto3,oneof" json:"deployment,omitempty"` +} + +func (x *GetDeploymentResponse) Reset() { + *x = GetDeploymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDeploymentResponse) ProtoMessage() {} + +func (x *GetDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDeploymentResponse.ProtoReflect.Descriptor instead. +func (*GetDeploymentResponse) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{21} +} + +func (x *GetDeploymentResponse) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + +func (x *GetDeploymentResponse) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +// Update Request +type UpdateDeploymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the scheduled deployment + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Deployment spec to be updated + Spec *DeploymentSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` +} + +func (x *UpdateDeploymentRequest) Reset() { + *x = UpdateDeploymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDeploymentRequest) ProtoMessage() {} + +func (x *UpdateDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDeploymentRequest.ProtoReflect.Descriptor instead. +func (*UpdateDeploymentRequest) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{22} +} + +func (x *UpdateDeploymentRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateDeploymentRequest) GetSpec() *DeploymentSpec { + if x != nil { + return x.Spec + } + return nil +} + +// Update Response +type UpdateDeploymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Defines if deployment was found + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + // Deployment run settings and current status + Deployment *Deployment `protobuf:"bytes,2,opt,name=deployment,proto3,oneof" json:"deployment,omitempty"` +} + +func (x *UpdateDeploymentResponse) Reset() { + *x = UpdateDeploymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateDeploymentResponse) ProtoMessage() {} + +func (x *UpdateDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateDeploymentResponse.ProtoReflect.Descriptor instead. +func (*UpdateDeploymentResponse) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{23} +} + +func (x *UpdateDeploymentResponse) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + +func (x *UpdateDeploymentResponse) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +// List Request +type ListDeploymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListDeploymentRequest) Reset() { + *x = ListDeploymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDeploymentRequest) ProtoMessage() {} + +func (x *ListDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDeploymentRequest.ProtoReflect.Descriptor instead. +func (*ListDeploymentRequest) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{24} +} + +// List Response +type ListDeploymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of the Deployments + Deployments []string `protobuf:"bytes,1,rep,name=deployments,proto3" json:"deployments,omitempty"` +} + +func (x *ListDeploymentResponse) Reset() { + *x = ListDeploymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDeploymentResponse) ProtoMessage() {} + +func (x *ListDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDeploymentResponse.ProtoReflect.Descriptor instead. +func (*ListDeploymentResponse) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{25} +} + +func (x *ListDeploymentResponse) GetDeployments() []string { + if x != nil { + return x.Deployments + } + return nil +} + +// Delete Request +type DeleteDeploymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the scheduled deployment + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Defines if all child containers/pods should be removed together with deployment + DeleteChildPods *bool `protobuf:"varint,2,opt,name=delete_child_pods,json=deleteChildPods,proto3,oneof" json:"delete_child_pods,omitempty"` +} + +func (x *DeleteDeploymentRequest) Reset() { + *x = DeleteDeploymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDeploymentRequest) ProtoMessage() {} + +func (x *DeleteDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDeploymentRequest.ProtoReflect.Descriptor instead. +func (*DeleteDeploymentRequest) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{26} +} + +func (x *DeleteDeploymentRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeleteDeploymentRequest) GetDeleteChildPods() bool { + if x != nil && x.DeleteChildPods != nil { + return *x.DeleteChildPods + } + return false +} + +// Delete Response +type DeleteDeploymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Defines if deployment was found + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` +} + +func (x *DeleteDeploymentResponse) Reset() { + *x = DeleteDeploymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDeploymentResponse) ProtoMessage() {} + +func (x *DeleteDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_definition_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDeploymentResponse.ProtoReflect.Descriptor instead. +func (*DeleteDeploymentResponse) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP(), []int{27} +} + +func (x *DeleteDeploymentResponse) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + var File_integrations_scheduler_v1_definition_definition_proto protoreflect.FileDescriptor var file_integrations_scheduler_v1_definition_definition_proto_rawDesc = []byte{ @@ -1017,148 +1515,226 @@ var file_integrations_scheduler_v1_definition_definition_proto_rawDesc = []byte{ 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x32, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x63, 0x72, 0x6f, 0x6e, 0x6a, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x72, - 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x72, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x34, 0x0a, 0x09, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x52, 0x08, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, - 0x6f, 0x62, 0x22, 0x48, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x72, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, - 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x48, 0x00, 0x52, - 0x08, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, - 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, 0x6f, 0x62, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, - 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0x35, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, - 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, - 0x63, 0x68, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x62, - 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x22, 0x72, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, - 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x50, - 0x6f, 0x64, 0x73, 0x88, 0x01, 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x64, 0x73, 0x22, 0x30, 0x0a, 0x16, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x6e, - 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, - 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x31, 0x0a, 0x08, 0x63, - 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x22, 0x47, - 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x72, - 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x2f, 0x63, 0x72, 0x6f, 0x6e, 0x6a, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, + 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x72, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, + 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, + 0x70, 0x65, 0x63, 0x12, 0x34, 0x0a, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, 0x6f, 0x62, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x52, + 0x08, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x22, 0x2c, 0x0a, 0x16, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x72, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, + 0x12, 0x35, 0x0a, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x48, 0x00, 0x52, 0x08, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x4a, 0x6f, 0x62, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x6a, 0x6f, 0x62, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x35, 0x0a, 0x14, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, 0x6f, + 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, + 0x6f, 0x62, 0x73, 0x22, 0x72, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x8c, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, - 0x32, 0x0a, 0x08, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, - 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x48, 0x00, 0x52, 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, - 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6a, 0x6f, 0x62, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, - 0x62, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x22, - 0x56, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x73, - 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, - 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x70, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x08, 0x63, 0x72, 0x6f, 0x6e, - 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x48, 0x00, - 0x52, 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, - 0x5f, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x32, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, - 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x72, 0x6f, 0x6e, 0x4a, - 0x6f, 0x62, 0x73, 0x22, 0x71, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x6f, + 0x12, 0x2f, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x5f, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0f, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x50, 0x6f, 0x64, 0x73, 0x88, 0x01, + 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x64, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x6e, 0x0a, 0x14, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x23, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x31, 0x0a, 0x08, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, + 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x22, 0x2b, 0x0a, 0x15, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x2f, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, - 0x70, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x50, 0x6f, 0x64, 0x73, 0x88, 0x01, 0x01, - 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, - 0x64, 0x5f, 0x70, 0x6f, 0x64, 0x73, 0x22, 0x2f, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x6d, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x32, 0x0a, + 0x08, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, + 0x4a, 0x6f, 0x62, 0x48, 0x00, 0x52, 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x88, 0x01, + 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x22, 0x56, + 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x70, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x32, 0x81, 0x06, 0x0a, 0x0b, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x72, 0x56, 0x31, 0x12, 0x57, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x12, 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x08, 0x63, 0x72, 0x6f, 0x6e, 0x5f, + 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x48, 0x00, 0x52, + 0x07, 0x63, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, + 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x32, + 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, + 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, + 0x62, 0x73, 0x22, 0x71, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, + 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x70, + 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x50, 0x6f, 0x64, 0x73, 0x88, 0x01, 0x01, 0x42, + 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x5f, 0x70, 0x6f, 0x64, 0x73, 0x22, 0x2f, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, + 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x79, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x23, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x39, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x22, 0x2e, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x2a, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x7a, 0x0a, + 0x15, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x3a, + 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x64, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x5c, 0x0a, 0x17, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, + 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x7d, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x64, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x3a, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x74, 0x0a, 0x17, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x11, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, + 0x68, 0x69, 0x6c, 0x64, 0x50, 0x6f, 0x64, 0x73, 0x88, 0x01, 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x64, + 0x73, 0x22, 0x32, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, + 0x78, 0x69, 0x73, 0x74, 0x73, 0x32, 0xcd, 0x09, 0x0a, 0x0b, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x72, 0x56, 0x31, 0x12, 0x57, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x12, 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, + 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x4e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x12, - 0x1d, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, - 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x51, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, - 0x12, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x12, 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, + 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x12, 0x1d, 0x2e, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x12, 0x1e, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x4a, 0x6f, 0x62, 0x12, 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4a, - 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x1f, 0x2e, - 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, - 0x12, 0x1c, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x1f, 0x2e, 0x73, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, + 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x1c, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x72, - 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x54, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, - 0x12, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x6f, - 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x1d, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, - 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, - 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x48, 0x5a, 0x46, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, - 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x72, 0x6f, 0x6e, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, + 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x1f, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, + 0x6f, 0x62, 0x12, 0x1d, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x6f, + 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x22, 0x2e, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, + 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, + 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x20, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, + 0x65, 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1173,64 +1749,91 @@ func file_integrations_scheduler_v1_definition_definition_proto_rawDescGZIP() [] return file_integrations_scheduler_v1_definition_definition_proto_rawDescData } -var file_integrations_scheduler_v1_definition_definition_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_integrations_scheduler_v1_definition_definition_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_integrations_scheduler_v1_definition_definition_proto_goTypes = []interface{}{ - (*CreateBatchJobRequest)(nil), // 0: scheduler.CreateBatchJobRequest - (*CreateBatchJobResponse)(nil), // 1: scheduler.CreateBatchJobResponse - (*GetBatchJobRequest)(nil), // 2: scheduler.GetBatchJobRequest - (*GetBatchJobResponse)(nil), // 3: scheduler.GetBatchJobResponse - (*ListBatchJobRequest)(nil), // 4: scheduler.ListBatchJobRequest - (*ListBatchJobResponse)(nil), // 5: scheduler.ListBatchJobResponse - (*DeleteBatchJobRequest)(nil), // 6: scheduler.DeleteBatchJobRequest - (*DeleteBatchJobResponse)(nil), // 7: scheduler.DeleteBatchJobResponse - (*CreateCronJobRequest)(nil), // 8: scheduler.CreateCronJobRequest - (*CreateCronJobResponse)(nil), // 9: scheduler.CreateCronJobResponse - (*GetCronJobRequest)(nil), // 10: scheduler.GetCronJobRequest - (*GetCronJobResponse)(nil), // 11: scheduler.GetCronJobResponse - (*UpdateCronJobRequest)(nil), // 12: scheduler.UpdateCronJobRequest - (*UpdateCronJobResponse)(nil), // 13: scheduler.UpdateCronJobResponse - (*ListCronJobRequest)(nil), // 14: scheduler.ListCronJobRequest - (*ListCronJobResponse)(nil), // 15: scheduler.ListCronJobResponse - (*DeleteCronJobRequest)(nil), // 16: scheduler.DeleteCronJobRequest - (*DeleteCronJobResponse)(nil), // 17: scheduler.DeleteCronJobResponse - (*Spec)(nil), // 18: scheduler.Spec - (*BatchJobSpec)(nil), // 19: scheduler.BatchJobSpec - (*BatchJob)(nil), // 20: scheduler.BatchJob - (*CronJobSpec)(nil), // 21: scheduler.CronJobSpec - (*CronJob)(nil), // 22: scheduler.CronJob + (*CreateBatchJobRequest)(nil), // 0: scheduler.CreateBatchJobRequest + (*CreateBatchJobResponse)(nil), // 1: scheduler.CreateBatchJobResponse + (*GetBatchJobRequest)(nil), // 2: scheduler.GetBatchJobRequest + (*GetBatchJobResponse)(nil), // 3: scheduler.GetBatchJobResponse + (*ListBatchJobRequest)(nil), // 4: scheduler.ListBatchJobRequest + (*ListBatchJobResponse)(nil), // 5: scheduler.ListBatchJobResponse + (*DeleteBatchJobRequest)(nil), // 6: scheduler.DeleteBatchJobRequest + (*DeleteBatchJobResponse)(nil), // 7: scheduler.DeleteBatchJobResponse + (*CreateCronJobRequest)(nil), // 8: scheduler.CreateCronJobRequest + (*CreateCronJobResponse)(nil), // 9: scheduler.CreateCronJobResponse + (*GetCronJobRequest)(nil), // 10: scheduler.GetCronJobRequest + (*GetCronJobResponse)(nil), // 11: scheduler.GetCronJobResponse + (*UpdateCronJobRequest)(nil), // 12: scheduler.UpdateCronJobRequest + (*UpdateCronJobResponse)(nil), // 13: scheduler.UpdateCronJobResponse + (*ListCronJobRequest)(nil), // 14: scheduler.ListCronJobRequest + (*ListCronJobResponse)(nil), // 15: scheduler.ListCronJobResponse + (*DeleteCronJobRequest)(nil), // 16: scheduler.DeleteCronJobRequest + (*DeleteCronJobResponse)(nil), // 17: scheduler.DeleteCronJobResponse + (*CreateDeploymentRequest)(nil), // 18: scheduler.CreateDeploymentRequest + (*CreateDeploymentResponse)(nil), // 19: scheduler.CreateDeploymentResponse + (*GetDeploymentRequest)(nil), // 20: scheduler.GetDeploymentRequest + (*GetDeploymentResponse)(nil), // 21: scheduler.GetDeploymentResponse + (*UpdateDeploymentRequest)(nil), // 22: scheduler.UpdateDeploymentRequest + (*UpdateDeploymentResponse)(nil), // 23: scheduler.UpdateDeploymentResponse + (*ListDeploymentRequest)(nil), // 24: scheduler.ListDeploymentRequest + (*ListDeploymentResponse)(nil), // 25: scheduler.ListDeploymentResponse + (*DeleteDeploymentRequest)(nil), // 26: scheduler.DeleteDeploymentRequest + (*DeleteDeploymentResponse)(nil), // 27: scheduler.DeleteDeploymentResponse + (*Spec)(nil), // 28: scheduler.Spec + (*BatchJobSpec)(nil), // 29: scheduler.BatchJobSpec + (*BatchJob)(nil), // 30: scheduler.BatchJob + (*CronJobSpec)(nil), // 31: scheduler.CronJobSpec + (*CronJob)(nil), // 32: scheduler.CronJob + (*DeploymentSpec)(nil), // 33: scheduler.DeploymentSpec + (*Deployment)(nil), // 34: scheduler.Deployment } var file_integrations_scheduler_v1_definition_definition_proto_depIdxs = []int32{ - 18, // 0: scheduler.CreateBatchJobRequest.spec:type_name -> scheduler.Spec - 19, // 1: scheduler.CreateBatchJobRequest.batch_job:type_name -> scheduler.BatchJobSpec - 20, // 2: scheduler.GetBatchJobResponse.batch_job:type_name -> scheduler.BatchJob - 18, // 3: scheduler.CreateCronJobRequest.spec:type_name -> scheduler.Spec - 21, // 4: scheduler.CreateCronJobRequest.cron_job:type_name -> scheduler.CronJobSpec - 22, // 5: scheduler.GetCronJobResponse.cron_job:type_name -> scheduler.CronJob - 21, // 6: scheduler.UpdateCronJobRequest.spec:type_name -> scheduler.CronJobSpec - 22, // 7: scheduler.UpdateCronJobResponse.cron_job:type_name -> scheduler.CronJob - 0, // 8: scheduler.SchedulerV1.CreateBatchJob:input_type -> scheduler.CreateBatchJobRequest - 2, // 9: scheduler.SchedulerV1.GetBatchJob:input_type -> scheduler.GetBatchJobRequest - 4, // 10: scheduler.SchedulerV1.ListBatchJob:input_type -> scheduler.ListBatchJobRequest - 6, // 11: scheduler.SchedulerV1.DeleteBatchJob:input_type -> scheduler.DeleteBatchJobRequest - 8, // 12: scheduler.SchedulerV1.CreateCronJob:input_type -> scheduler.CreateCronJobRequest - 10, // 13: scheduler.SchedulerV1.GetCronJob:input_type -> scheduler.GetCronJobRequest - 12, // 14: scheduler.SchedulerV1.UpdateCronJob:input_type -> scheduler.UpdateCronJobRequest - 14, // 15: scheduler.SchedulerV1.ListCronJob:input_type -> scheduler.ListCronJobRequest - 16, // 16: scheduler.SchedulerV1.DeleteCronJob:input_type -> scheduler.DeleteCronJobRequest - 1, // 17: scheduler.SchedulerV1.CreateBatchJob:output_type -> scheduler.CreateBatchJobResponse - 3, // 18: scheduler.SchedulerV1.GetBatchJob:output_type -> scheduler.GetBatchJobResponse - 5, // 19: scheduler.SchedulerV1.ListBatchJob:output_type -> scheduler.ListBatchJobResponse - 7, // 20: scheduler.SchedulerV1.DeleteBatchJob:output_type -> scheduler.DeleteBatchJobResponse - 9, // 21: scheduler.SchedulerV1.CreateCronJob:output_type -> scheduler.CreateCronJobResponse - 11, // 22: scheduler.SchedulerV1.GetCronJob:output_type -> scheduler.GetCronJobResponse - 13, // 23: scheduler.SchedulerV1.UpdateCronJob:output_type -> scheduler.UpdateCronJobResponse - 15, // 24: scheduler.SchedulerV1.ListCronJob:output_type -> scheduler.ListCronJobResponse - 17, // 25: scheduler.SchedulerV1.DeleteCronJob:output_type -> scheduler.DeleteCronJobResponse - 17, // [17:26] is the sub-list for method output_type - 8, // [8:17] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 28, // 0: scheduler.CreateBatchJobRequest.spec:type_name -> scheduler.Spec + 29, // 1: scheduler.CreateBatchJobRequest.batch_job:type_name -> scheduler.BatchJobSpec + 30, // 2: scheduler.GetBatchJobResponse.batch_job:type_name -> scheduler.BatchJob + 28, // 3: scheduler.CreateCronJobRequest.spec:type_name -> scheduler.Spec + 31, // 4: scheduler.CreateCronJobRequest.cron_job:type_name -> scheduler.CronJobSpec + 32, // 5: scheduler.GetCronJobResponse.cron_job:type_name -> scheduler.CronJob + 31, // 6: scheduler.UpdateCronJobRequest.spec:type_name -> scheduler.CronJobSpec + 32, // 7: scheduler.UpdateCronJobResponse.cron_job:type_name -> scheduler.CronJob + 28, // 8: scheduler.CreateDeploymentRequest.spec:type_name -> scheduler.Spec + 33, // 9: scheduler.CreateDeploymentRequest.deployment:type_name -> scheduler.DeploymentSpec + 34, // 10: scheduler.GetDeploymentResponse.deployment:type_name -> scheduler.Deployment + 33, // 11: scheduler.UpdateDeploymentRequest.spec:type_name -> scheduler.DeploymentSpec + 34, // 12: scheduler.UpdateDeploymentResponse.deployment:type_name -> scheduler.Deployment + 0, // 13: scheduler.SchedulerV1.CreateBatchJob:input_type -> scheduler.CreateBatchJobRequest + 2, // 14: scheduler.SchedulerV1.GetBatchJob:input_type -> scheduler.GetBatchJobRequest + 4, // 15: scheduler.SchedulerV1.ListBatchJob:input_type -> scheduler.ListBatchJobRequest + 6, // 16: scheduler.SchedulerV1.DeleteBatchJob:input_type -> scheduler.DeleteBatchJobRequest + 8, // 17: scheduler.SchedulerV1.CreateCronJob:input_type -> scheduler.CreateCronJobRequest + 10, // 18: scheduler.SchedulerV1.GetCronJob:input_type -> scheduler.GetCronJobRequest + 12, // 19: scheduler.SchedulerV1.UpdateCronJob:input_type -> scheduler.UpdateCronJobRequest + 14, // 20: scheduler.SchedulerV1.ListCronJob:input_type -> scheduler.ListCronJobRequest + 16, // 21: scheduler.SchedulerV1.DeleteCronJob:input_type -> scheduler.DeleteCronJobRequest + 18, // 22: scheduler.SchedulerV1.CreateDeployment:input_type -> scheduler.CreateDeploymentRequest + 20, // 23: scheduler.SchedulerV1.GetDeployment:input_type -> scheduler.GetDeploymentRequest + 22, // 24: scheduler.SchedulerV1.UpdateDeployment:input_type -> scheduler.UpdateDeploymentRequest + 24, // 25: scheduler.SchedulerV1.ListDeployment:input_type -> scheduler.ListDeploymentRequest + 26, // 26: scheduler.SchedulerV1.DeleteDeployment:input_type -> scheduler.DeleteDeploymentRequest + 1, // 27: scheduler.SchedulerV1.CreateBatchJob:output_type -> scheduler.CreateBatchJobResponse + 3, // 28: scheduler.SchedulerV1.GetBatchJob:output_type -> scheduler.GetBatchJobResponse + 5, // 29: scheduler.SchedulerV1.ListBatchJob:output_type -> scheduler.ListBatchJobResponse + 7, // 30: scheduler.SchedulerV1.DeleteBatchJob:output_type -> scheduler.DeleteBatchJobResponse + 9, // 31: scheduler.SchedulerV1.CreateCronJob:output_type -> scheduler.CreateCronJobResponse + 11, // 32: scheduler.SchedulerV1.GetCronJob:output_type -> scheduler.GetCronJobResponse + 13, // 33: scheduler.SchedulerV1.UpdateCronJob:output_type -> scheduler.UpdateCronJobResponse + 15, // 34: scheduler.SchedulerV1.ListCronJob:output_type -> scheduler.ListCronJobResponse + 17, // 35: scheduler.SchedulerV1.DeleteCronJob:output_type -> scheduler.DeleteCronJobResponse + 19, // 36: scheduler.SchedulerV1.CreateDeployment:output_type -> scheduler.CreateDeploymentResponse + 21, // 37: scheduler.SchedulerV1.GetDeployment:output_type -> scheduler.GetDeploymentResponse + 23, // 38: scheduler.SchedulerV1.UpdateDeployment:output_type -> scheduler.UpdateDeploymentResponse + 25, // 39: scheduler.SchedulerV1.ListDeployment:output_type -> scheduler.ListDeploymentResponse + 27, // 40: scheduler.SchedulerV1.DeleteDeployment:output_type -> scheduler.DeleteDeploymentResponse + 27, // [27:41] is the sub-list for method output_type + 13, // [13:27] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_integrations_scheduler_v1_definition_definition_proto_init() } @@ -1241,6 +1844,7 @@ func file_integrations_scheduler_v1_definition_definition_proto_init() { file_integrations_scheduler_v1_definition_batchjob_proto_init() file_integrations_scheduler_v1_definition_common_proto_init() file_integrations_scheduler_v1_definition_cronjob_proto_init() + file_integrations_scheduler_v1_definition_deployment_proto_init() if !protoimpl.UnsafeEnabled { file_integrations_scheduler_v1_definition_definition_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateBatchJobRequest); i { @@ -1458,19 +2062,142 @@ func file_integrations_scheduler_v1_definition_definition_proto_init() { return nil } } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDeploymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDeploymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDeploymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDeploymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDeploymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDeploymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDeploymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDeploymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDeploymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDeploymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_integrations_scheduler_v1_definition_definition_proto_msgTypes[3].OneofWrappers = []interface{}{} file_integrations_scheduler_v1_definition_definition_proto_msgTypes[6].OneofWrappers = []interface{}{} file_integrations_scheduler_v1_definition_definition_proto_msgTypes[11].OneofWrappers = []interface{}{} file_integrations_scheduler_v1_definition_definition_proto_msgTypes[13].OneofWrappers = []interface{}{} file_integrations_scheduler_v1_definition_definition_proto_msgTypes[16].OneofWrappers = []interface{}{} + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[21].OneofWrappers = []interface{}{} + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[23].OneofWrappers = []interface{}{} + file_integrations_scheduler_v1_definition_definition_proto_msgTypes[26].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_integrations_scheduler_v1_definition_definition_proto_rawDesc, NumEnums: 0, - NumMessages: 18, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, diff --git a/integrations/scheduler/v1/definition/definition.proto b/integrations/scheduler/v1/definition/definition.proto index 71d8aec9b..bffc6fe75 100644 --- a/integrations/scheduler/v1/definition/definition.proto +++ b/integrations/scheduler/v1/definition/definition.proto @@ -25,6 +25,7 @@ package scheduler; import "integrations/scheduler/v1/definition/batchjob.proto"; import "integrations/scheduler/v1/definition/common.proto"; import "integrations/scheduler/v1/definition/cronjob.proto"; +import "integrations/scheduler/v1/definition/deployment.proto"; option go_package = "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition"; @@ -60,6 +61,23 @@ service SchedulerV1 { // Deletes CronJob. If job does not exists, Exists flag is set to false rpc DeleteCronJob(DeleteCronJobRequest) returns (DeleteCronJobResponse) {}; + + // Deployment + + // Creates Deployment from specification + rpc CreateDeployment(CreateDeploymentRequest) returns (CreateDeploymentResponse) {}; + + // Returns Deployment. If job does not exists, Exists flag is set to false + rpc GetDeployment(GetDeploymentRequest) returns (GetDeploymentResponse) {}; + + // Updates Deployment from specification + rpc UpdateDeployment(UpdateDeploymentRequest) returns (UpdateDeploymentResponse) {}; + + // Returns list of the Deployments + rpc ListDeployment(ListDeploymentRequest) returns (ListDeploymentResponse) {}; + + // Deletes Deployment. If job does not exists, Exists flag is set to false + rpc DeleteDeployment(DeleteDeploymentRequest) returns (DeleteDeploymentResponse) {}; } // BatchJob @@ -77,9 +95,6 @@ message CreateBatchJobRequest { message CreateBatchJobResponse { // Name of the scheduled job string name = 1; - - // List of the assigned profiles - repeated string profiles = 2; } // Get Request @@ -138,9 +153,6 @@ message CreateCronJobRequest { message CreateCronJobResponse { // Name of the scheduled job string name = 1; - - // List of the assigned profiles - repeated string profiles = 2; } // Get Request @@ -156,9 +168,6 @@ message GetCronJobResponse { // CronJob run settings and current status optional CronJob cron_job = 2; - - // Keeps list of created BatchJobs - repeated string batch_jobs = 3; } // Update Request @@ -202,4 +211,79 @@ message DeleteCronJobRequest { message DeleteCronJobResponse { // Defines if job was found bool exists = 1; +} + +// Deployment + +// Create Request +message CreateDeploymentRequest { + // Spec of the Schedule request + Spec spec = 1; + + // Deployment run settings + DeploymentSpec deployment = 2; +} + +// Create Response +message CreateDeploymentResponse { + // Name of the scheduled deployment + string name = 1; +} + +// Get Request +message GetDeploymentRequest { + // Name of the scheduled deployment + string name = 1; +} + +// Get Response +message GetDeploymentResponse { + // Defines if deployment was found + bool exists = 1; + + // Deployment run settings and current status + optional Deployment deployment = 2; +} + +// Update Request +message UpdateDeploymentRequest { + // Name of the scheduled deployment + string name = 1; + + // Deployment spec to be updated + DeploymentSpec spec = 2; +} + +// Update Response +message UpdateDeploymentResponse { + // Defines if deployment was found + bool exists = 1; + + // Deployment run settings and current status + optional Deployment deployment = 2; +} + +// List Request +message ListDeploymentRequest { +} + +// List Response +message ListDeploymentResponse { + // List of the Deployments + repeated string deployments = 1; +} + +// Delete Request +message DeleteDeploymentRequest { + // Name of the scheduled deployment + string name = 1; + + // Defines if all child containers/pods should be removed together with deployment + optional bool delete_child_pods = 2; +} + +// Delete Response +message DeleteDeploymentResponse { + // Defines if deployment was found + bool exists = 1; } \ No newline at end of file diff --git a/integrations/scheduler/v1/definition/definition_grpc.pb.go b/integrations/scheduler/v1/definition/definition_grpc.pb.go index 5d86fd505..528c0c308 100644 --- a/integrations/scheduler/v1/definition/definition_grpc.pb.go +++ b/integrations/scheduler/v1/definition/definition_grpc.pb.go @@ -40,6 +40,16 @@ type SchedulerV1Client interface { ListCronJob(ctx context.Context, in *ListCronJobRequest, opts ...grpc.CallOption) (*ListCronJobResponse, error) // Deletes CronJob. If job does not exists, Exists flag is set to false DeleteCronJob(ctx context.Context, in *DeleteCronJobRequest, opts ...grpc.CallOption) (*DeleteCronJobResponse, error) + // Creates Deployment from specification + CreateDeployment(ctx context.Context, in *CreateDeploymentRequest, opts ...grpc.CallOption) (*CreateDeploymentResponse, error) + // Returns Deployment. If job does not exists, Exists flag is set to false + GetDeployment(ctx context.Context, in *GetDeploymentRequest, opts ...grpc.CallOption) (*GetDeploymentResponse, error) + // Updates Deployment from specification + UpdateDeployment(ctx context.Context, in *UpdateDeploymentRequest, opts ...grpc.CallOption) (*UpdateDeploymentResponse, error) + // Returns list of the Deployments + ListDeployment(ctx context.Context, in *ListDeploymentRequest, opts ...grpc.CallOption) (*ListDeploymentResponse, error) + // Deletes Deployment. If job does not exists, Exists flag is set to false + DeleteDeployment(ctx context.Context, in *DeleteDeploymentRequest, opts ...grpc.CallOption) (*DeleteDeploymentResponse, error) } type schedulerV1Client struct { @@ -131,6 +141,51 @@ func (c *schedulerV1Client) DeleteCronJob(ctx context.Context, in *DeleteCronJob return out, nil } +func (c *schedulerV1Client) CreateDeployment(ctx context.Context, in *CreateDeploymentRequest, opts ...grpc.CallOption) (*CreateDeploymentResponse, error) { + out := new(CreateDeploymentResponse) + err := c.cc.Invoke(ctx, "/scheduler.SchedulerV1/CreateDeployment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *schedulerV1Client) GetDeployment(ctx context.Context, in *GetDeploymentRequest, opts ...grpc.CallOption) (*GetDeploymentResponse, error) { + out := new(GetDeploymentResponse) + err := c.cc.Invoke(ctx, "/scheduler.SchedulerV1/GetDeployment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *schedulerV1Client) UpdateDeployment(ctx context.Context, in *UpdateDeploymentRequest, opts ...grpc.CallOption) (*UpdateDeploymentResponse, error) { + out := new(UpdateDeploymentResponse) + err := c.cc.Invoke(ctx, "/scheduler.SchedulerV1/UpdateDeployment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *schedulerV1Client) ListDeployment(ctx context.Context, in *ListDeploymentRequest, opts ...grpc.CallOption) (*ListDeploymentResponse, error) { + out := new(ListDeploymentResponse) + err := c.cc.Invoke(ctx, "/scheduler.SchedulerV1/ListDeployment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *schedulerV1Client) DeleteDeployment(ctx context.Context, in *DeleteDeploymentRequest, opts ...grpc.CallOption) (*DeleteDeploymentResponse, error) { + out := new(DeleteDeploymentResponse) + err := c.cc.Invoke(ctx, "/scheduler.SchedulerV1/DeleteDeployment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // SchedulerV1Server is the server API for SchedulerV1 service. // All implementations must embed UnimplementedSchedulerV1Server // for forward compatibility @@ -153,6 +208,16 @@ type SchedulerV1Server interface { ListCronJob(context.Context, *ListCronJobRequest) (*ListCronJobResponse, error) // Deletes CronJob. If job does not exists, Exists flag is set to false DeleteCronJob(context.Context, *DeleteCronJobRequest) (*DeleteCronJobResponse, error) + // Creates Deployment from specification + CreateDeployment(context.Context, *CreateDeploymentRequest) (*CreateDeploymentResponse, error) + // Returns Deployment. If job does not exists, Exists flag is set to false + GetDeployment(context.Context, *GetDeploymentRequest) (*GetDeploymentResponse, error) + // Updates Deployment from specification + UpdateDeployment(context.Context, *UpdateDeploymentRequest) (*UpdateDeploymentResponse, error) + // Returns list of the Deployments + ListDeployment(context.Context, *ListDeploymentRequest) (*ListDeploymentResponse, error) + // Deletes Deployment. If job does not exists, Exists flag is set to false + DeleteDeployment(context.Context, *DeleteDeploymentRequest) (*DeleteDeploymentResponse, error) mustEmbedUnimplementedSchedulerV1Server() } @@ -187,6 +252,21 @@ func (UnimplementedSchedulerV1Server) ListCronJob(context.Context, *ListCronJobR func (UnimplementedSchedulerV1Server) DeleteCronJob(context.Context, *DeleteCronJobRequest) (*DeleteCronJobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteCronJob not implemented") } +func (UnimplementedSchedulerV1Server) CreateDeployment(context.Context, *CreateDeploymentRequest) (*CreateDeploymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDeployment not implemented") +} +func (UnimplementedSchedulerV1Server) GetDeployment(context.Context, *GetDeploymentRequest) (*GetDeploymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeployment not implemented") +} +func (UnimplementedSchedulerV1Server) UpdateDeployment(context.Context, *UpdateDeploymentRequest) (*UpdateDeploymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDeployment not implemented") +} +func (UnimplementedSchedulerV1Server) ListDeployment(context.Context, *ListDeploymentRequest) (*ListDeploymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDeployment not implemented") +} +func (UnimplementedSchedulerV1Server) DeleteDeployment(context.Context, *DeleteDeploymentRequest) (*DeleteDeploymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDeployment not implemented") +} func (UnimplementedSchedulerV1Server) mustEmbedUnimplementedSchedulerV1Server() {} // UnsafeSchedulerV1Server may be embedded to opt out of forward compatibility for this service. @@ -362,6 +442,96 @@ func _SchedulerV1_DeleteCronJob_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _SchedulerV1_CreateDeployment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDeploymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SchedulerV1Server).CreateDeployment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/scheduler.SchedulerV1/CreateDeployment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SchedulerV1Server).CreateDeployment(ctx, req.(*CreateDeploymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SchedulerV1_GetDeployment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDeploymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SchedulerV1Server).GetDeployment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/scheduler.SchedulerV1/GetDeployment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SchedulerV1Server).GetDeployment(ctx, req.(*GetDeploymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SchedulerV1_UpdateDeployment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDeploymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SchedulerV1Server).UpdateDeployment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/scheduler.SchedulerV1/UpdateDeployment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SchedulerV1Server).UpdateDeployment(ctx, req.(*UpdateDeploymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SchedulerV1_ListDeployment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDeploymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SchedulerV1Server).ListDeployment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/scheduler.SchedulerV1/ListDeployment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SchedulerV1Server).ListDeployment(ctx, req.(*ListDeploymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SchedulerV1_DeleteDeployment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDeploymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SchedulerV1Server).DeleteDeployment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/scheduler.SchedulerV1/DeleteDeployment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SchedulerV1Server).DeleteDeployment(ctx, req.(*DeleteDeploymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + // SchedulerV1_ServiceDesc is the grpc.ServiceDesc for SchedulerV1 service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -405,6 +575,26 @@ var SchedulerV1_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteCronJob", Handler: _SchedulerV1_DeleteCronJob_Handler, }, + { + MethodName: "CreateDeployment", + Handler: _SchedulerV1_CreateDeployment_Handler, + }, + { + MethodName: "GetDeployment", + Handler: _SchedulerV1_GetDeployment_Handler, + }, + { + MethodName: "UpdateDeployment", + Handler: _SchedulerV1_UpdateDeployment_Handler, + }, + { + MethodName: "ListDeployment", + Handler: _SchedulerV1_ListDeployment_Handler, + }, + { + MethodName: "DeleteDeployment", + Handler: _SchedulerV1_DeleteDeployment_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "integrations/scheduler/v1/definition/definition.proto", diff --git a/integrations/scheduler/v1/definition/deployment.pb.go b/integrations/scheduler/v1/definition/deployment.pb.go new file mode 100644 index 000000000..1016d0d50 --- /dev/null +++ b/integrations/scheduler/v1/definition/deployment.pb.go @@ -0,0 +1,388 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.21.1 +// source: integrations/scheduler/v1/definition/deployment.proto + +package definition + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Keeps information about Kubernetes Batch/V1 Job +type Deployment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // defines object status metadate + Metadata *StatusMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Keeps Deployment settings + Spec *DeploymentSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + // Keeps current Deployment Status + Status *DeploymentStatus `protobuf:"bytes,3,opt,name=status,proto3,oneof" json:"status,omitempty"` +} + +func (x *Deployment) Reset() { + *x = Deployment{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deployment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deployment) ProtoMessage() {} + +func (x *Deployment) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Deployment.ProtoReflect.Descriptor instead. +func (*Deployment) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_deployment_proto_rawDescGZIP(), []int{0} +} + +func (x *Deployment) GetMetadata() *StatusMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Deployment) GetSpec() *DeploymentSpec { + if x != nil { + return x.Spec + } + return nil +} + +func (x *Deployment) GetStatus() *DeploymentStatus { + if x != nil { + return x.Status + } + return nil +} + +// Information about Deployment run settings +type DeploymentSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Number of Pods which are started within a deployment. Defaults to 1 + Replicas *int32 `protobuf:"varint,1,opt,name=replicas,proto3,oneof" json:"replicas,omitempty"` +} + +func (x *DeploymentSpec) Reset() { + *x = DeploymentSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeploymentSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeploymentSpec) ProtoMessage() {} + +func (x *DeploymentSpec) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeploymentSpec.ProtoReflect.Descriptor instead. +func (*DeploymentSpec) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_deployment_proto_rawDescGZIP(), []int{1} +} + +func (x *DeploymentSpec) GetReplicas() int32 { + if x != nil && x.Replicas != nil { + return *x.Replicas + } + return 0 +} + +// Information about Deployment Status +type DeploymentStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + Replicas int32 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"` + // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + UpdatedReplicas int32 `protobuf:"varint,2,opt,name=updated_replicas,json=updatedReplicas,proto3" json:"updated_replicas,omitempty"` + // readyReplicas is the number of pods targeted by this Deployment with a Ready Condition. + ReadyReplicas int32 `protobuf:"varint,3,opt,name=ready_replicas,json=readyReplicas,proto3" json:"ready_replicas,omitempty"` + // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + AvailableReplicas int32 `protobuf:"varint,4,opt,name=available_replicas,json=availableReplicas,proto3" json:"available_replicas,omitempty"` + // Total number of unavailable pods targeted by this deployment. This is the total number of + // pods that are still required for the deployment to have 100% available capacity. They may + // either be pods that are running but not yet available or pods that still have not been created. + UnavailableReplicas int32 `protobuf:"varint,5,opt,name=unavailable_replicas,json=unavailableReplicas,proto3" json:"unavailable_replicas,omitempty"` +} + +func (x *DeploymentStatus) Reset() { + *x = DeploymentStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeploymentStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeploymentStatus) ProtoMessage() {} + +func (x *DeploymentStatus) ProtoReflect() protoreflect.Message { + mi := &file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeploymentStatus.ProtoReflect.Descriptor instead. +func (*DeploymentStatus) Descriptor() ([]byte, []int) { + return file_integrations_scheduler_v1_definition_deployment_proto_rawDescGZIP(), []int{2} +} + +func (x *DeploymentStatus) GetReplicas() int32 { + if x != nil { + return x.Replicas + } + return 0 +} + +func (x *DeploymentStatus) GetUpdatedReplicas() int32 { + if x != nil { + return x.UpdatedReplicas + } + return 0 +} + +func (x *DeploymentStatus) GetReadyReplicas() int32 { + if x != nil { + return x.ReadyReplicas + } + return 0 +} + +func (x *DeploymentStatus) GetAvailableReplicas() int32 { + if x != nil { + return x.AvailableReplicas + } + return 0 +} + +func (x *DeploymentStatus) GetUnavailableReplicas() int32 { + if x != nil { + return x.UnavailableReplicas + } + return 0 +} + +var File_integrations_scheduler_v1_definition_deployment_proto protoreflect.FileDescriptor + +var file_integrations_scheduler_v1_definition_deployment_proto_rawDesc = []byte{ + 0x0a, 0x35, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x1a, 0x31, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x04, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0x3e, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, + 0x63, 0x12, 0x1f, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x88, + 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x22, + 0xe2, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, + 0x12, 0x29, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x72, + 0x65, 0x61, 0x64, 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x65, 0x61, 0x64, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, + 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x73, 0x12, 0x31, 0x0a, 0x14, 0x75, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x13, 0x75, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x73, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, + 0x2d, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, + 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_integrations_scheduler_v1_definition_deployment_proto_rawDescOnce sync.Once + file_integrations_scheduler_v1_definition_deployment_proto_rawDescData = file_integrations_scheduler_v1_definition_deployment_proto_rawDesc +) + +func file_integrations_scheduler_v1_definition_deployment_proto_rawDescGZIP() []byte { + file_integrations_scheduler_v1_definition_deployment_proto_rawDescOnce.Do(func() { + file_integrations_scheduler_v1_definition_deployment_proto_rawDescData = protoimpl.X.CompressGZIP(file_integrations_scheduler_v1_definition_deployment_proto_rawDescData) + }) + return file_integrations_scheduler_v1_definition_deployment_proto_rawDescData +} + +var file_integrations_scheduler_v1_definition_deployment_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_integrations_scheduler_v1_definition_deployment_proto_goTypes = []interface{}{ + (*Deployment)(nil), // 0: scheduler.Deployment + (*DeploymentSpec)(nil), // 1: scheduler.DeploymentSpec + (*DeploymentStatus)(nil), // 2: scheduler.DeploymentStatus + (*StatusMetadata)(nil), // 3: scheduler.StatusMetadata +} +var file_integrations_scheduler_v1_definition_deployment_proto_depIdxs = []int32{ + 3, // 0: scheduler.Deployment.metadata:type_name -> scheduler.StatusMetadata + 1, // 1: scheduler.Deployment.spec:type_name -> scheduler.DeploymentSpec + 2, // 2: scheduler.Deployment.status:type_name -> scheduler.DeploymentStatus + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_integrations_scheduler_v1_definition_deployment_proto_init() } +func file_integrations_scheduler_v1_definition_deployment_proto_init() { + if File_integrations_scheduler_v1_definition_deployment_proto != nil { + return + } + file_integrations_scheduler_v1_definition_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Deployment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeploymentSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeploymentStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_integrations_scheduler_v1_definition_deployment_proto_msgTypes[1].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_integrations_scheduler_v1_definition_deployment_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_integrations_scheduler_v1_definition_deployment_proto_goTypes, + DependencyIndexes: file_integrations_scheduler_v1_definition_deployment_proto_depIdxs, + MessageInfos: file_integrations_scheduler_v1_definition_deployment_proto_msgTypes, + }.Build() + File_integrations_scheduler_v1_definition_deployment_proto = out.File + file_integrations_scheduler_v1_definition_deployment_proto_rawDesc = nil + file_integrations_scheduler_v1_definition_deployment_proto_goTypes = nil + file_integrations_scheduler_v1_definition_deployment_proto_depIdxs = nil +} diff --git a/integrations/scheduler/v1/definition/deployment.proto b/integrations/scheduler/v1/definition/deployment.proto new file mode 100644 index 000000000..60b798ea7 --- /dev/null +++ b/integrations/scheduler/v1/definition/deployment.proto @@ -0,0 +1,66 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +syntax = "proto3"; + +package scheduler; + +import "integrations/scheduler/v1/definition/common.proto"; + +option go_package = "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition"; + +// Keeps information about Kubernetes Batch/V1 Job +message Deployment { + // defines object status metadate + StatusMetadata metadata = 1; + + // Keeps Deployment settings + DeploymentSpec spec = 2; + + // Keeps current Deployment Status + optional DeploymentStatus status = 3; +} + +// Information about Deployment run settings +message DeploymentSpec { + // Number of Pods which are started within a deployment. Defaults to 1 + optional int32 replicas = 1; +} + +// Information about Deployment Status +message DeploymentStatus { + + // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + int32 replicas=1; + + // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + int32 updated_replicas = 2; + + // readyReplicas is the number of pods targeted by this Deployment with a Ready Condition. + int32 ready_replicas = 3; + + // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + int32 available_replicas = 4; + + // Total number of unavailable pods targeted by this deployment. This is the total number of + // pods that are still required for the deployment to have 100% available capacity. They may + // either be pods that are running but not yet available or pods that still have not been created. + int32 unavailable_replicas = 5; +} diff --git a/integrations/scheduler/v1/deployment.go b/integrations/scheduler/v1/deployment.go new file mode 100644 index 000000000..f342c44c8 --- /dev/null +++ b/integrations/scheduler/v1/deployment.go @@ -0,0 +1,210 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/generators/kubernetes" + "github.com/arangodb/kube-arangodb/pkg/scheduler" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" +) + +func (i *implementation) CreateDeployment(ctx context.Context, request *pbSchedulerV1.CreateDeploymentRequest) (*pbSchedulerV1.CreateDeploymentResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + template := scheduler.SpecAsTemplate(request.GetSpec()) + + var spec schedulerApi.ArangoSchedulerDeployment + + spec.Namespace = i.cfg.Namespace + + if meta := request.GetSpec().GetMetadata(); meta != nil { + if util.TypeOrDefault(meta.GenerateName, false) { + spec.GenerateName = meta.Name + } else { + spec.Name = meta.Name + } + } + + spec.Spec.Template = *template + + if deployment := request.GetDeployment(); deployment != nil { + spec.Spec.Replicas = deployment.Replicas + } + + if jobSpec := request.GetSpec(); jobSpec != nil { + if base := jobSpec.Base; base != nil { + spec.Labels = base.Labels + spec.Spec.Template.Labels = base.Labels + } + } + + job, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(i.cfg.Namespace).Create(ctx, &spec, meta.CreateOptions{}) + + if err != nil { + return nil, err + } + + return &pbSchedulerV1.CreateDeploymentResponse{ + Name: job.Name, + }, nil +} + +func (i *implementation) GetDeployment(ctx context.Context, request *pbSchedulerV1.GetDeploymentRequest) (*pbSchedulerV1.GetDeploymentResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + deployment, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.GetDeploymentResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.GetDeploymentResponse{ + Exists: true, + + Deployment: &pbSchedulerV1.Deployment{ + Metadata: ExtractStatusMetadata(deployment.Status.ArangoSchedulerStatusMetadata), + Spec: &pbSchedulerV1.DeploymentSpec{ + Replicas: deployment.Spec.Replicas, + }, + Status: &pbSchedulerV1.DeploymentStatus{ + Replicas: deployment.Status.DeploymentStatus.Replicas, + UpdatedReplicas: deployment.Status.DeploymentStatus.UpdatedReplicas, + ReadyReplicas: deployment.Status.DeploymentStatus.ReadyReplicas, + AvailableReplicas: deployment.Status.DeploymentStatus.AvailableReplicas, + UnavailableReplicas: deployment.Status.DeploymentStatus.UnavailableReplicas, + }, + }, + }, nil +} + +func (i *implementation) UpdateDeployment(ctx context.Context, request *pbSchedulerV1.UpdateDeploymentRequest) (*pbSchedulerV1.UpdateDeploymentResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + job, err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.UpdateDeploymentResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + if deployment := request.GetSpec(); deployment != nil { + job.Spec.Replicas = deployment.Replicas + } + + job, err = i.client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(i.cfg.Namespace).Update(ctx, job, meta.UpdateOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.UpdateDeploymentResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.UpdateDeploymentResponse{ + Exists: true, + + Deployment: &pbSchedulerV1.Deployment{ + Spec: &pbSchedulerV1.DeploymentSpec{ + Replicas: job.Spec.Replicas, + }, + }, + }, nil +} + +func (i *implementation) ListDeployment(ctx context.Context, request *pbSchedulerV1.ListDeploymentRequest) (*pbSchedulerV1.ListDeploymentResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + objects, err := kubernetes.ListObjects[*schedulerApi.ArangoSchedulerDeploymentList, *schedulerApi.ArangoSchedulerDeployment](ctx, i.client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(i.cfg.Namespace), func(result *schedulerApi.ArangoSchedulerDeploymentList) []*schedulerApi.ArangoSchedulerDeployment { + r := make([]*schedulerApi.ArangoSchedulerDeployment, len(result.Items)) + + for id := range result.Items { + r[id] = result.Items[id].DeepCopy() + } + + return r + }) + + if err != nil { + return nil, err + } + + return &pbSchedulerV1.ListDeploymentResponse{ + Deployments: util.FormatList(objects, func(in *schedulerApi.ArangoSchedulerDeployment) string { + return in.GetName() + }), + }, nil +} + +func (i *implementation) DeleteDeployment(ctx context.Context, request *pbSchedulerV1.DeleteDeploymentRequest) (*pbSchedulerV1.DeleteDeploymentResponse, error) { + if request == nil { + return nil, errors.Errorf("Request is nil") + } + + var d meta.DeleteOptions + + if v := request.DeleteChildPods; v != nil { + if *v { + d.PropagationPolicy = util.NewType(meta.DeletePropagationBackground) + } else { + d.PropagationPolicy = util.NewType(meta.DeletePropagationOrphan) + } + } + + err := i.client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(i.cfg.Namespace).Delete(ctx, request.GetName(), d) + if err != nil { + if kerrors.IsNotFound(err) { + return &pbSchedulerV1.DeleteDeploymentResponse{ + Exists: false, + }, nil + } + + return nil, err + } + + return &pbSchedulerV1.DeleteDeploymentResponse{Exists: true}, nil +} diff --git a/integrations/scheduler/v1/deployment_test.go b/integrations/scheduler/v1/deployment_test.go new file mode 100644 index 000000000..2c675a39d --- /dev/null +++ b/integrations/scheduler/v1/deployment_test.go @@ -0,0 +1,199 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Deployment(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + client := kclient.NewFakeClientBuilder().Add( + tests.NewMetaObject(t, tests.FakeNamespace, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { + obj.Spec = schedulerApi.ProfileSpec{} + }, tests.MarkArangoProfileAsReady), + tests.NewMetaObject(t, tests.FakeNamespace, "test-select-all", func(t *testing.T, obj *schedulerApi.ArangoProfile) { + obj.Spec = schedulerApi.ProfileSpec{ + Selectors: &schedulerApi.ProfileSelectors{ + Label: &meta.LabelSelector{}, + }, + Template: &schedulerApi.ProfileTemplate{}, + } + }, tests.MarkArangoProfileAsReady), + tests.NewMetaObject(t, tests.FakeNamespace, "test-select-specific", func(t *testing.T, obj *schedulerApi.ArangoProfile) { + obj.Spec = schedulerApi.ProfileSpec{ + Selectors: &schedulerApi.ProfileSelectors{ + Label: &meta.LabelSelector{ + MatchLabels: map[string]string{ + "A": "B", + }, + }, + }, + Template: &schedulerApi.ProfileTemplate{}, + } + }, tests.MarkArangoProfileAsReady), + ).Client() + + scheduler := Client(t, ctx, client, func(c Configuration) Configuration { + c.Namespace = tests.FakeNamespace + c.VerifyAccess = false + return c + }) + + t.Run("Ensure job does not exist - get", func(t *testing.T) { + resp, err := scheduler.GetDeployment(context.Background(), &pbSchedulerV1.GetDeploymentRequest{ + Name: "test", + }) + require.NoError(t, err) + + require.False(t, resp.GetExists()) + }) + + t.Run("Ensure job does not exist - list", func(t *testing.T) { + resp, err := scheduler.ListDeployment(context.Background(), &pbSchedulerV1.ListDeploymentRequest{}) + require.NoError(t, err) + + require.Len(t, resp.GetDeployments(), 0) + }) + + t.Run("Schedule Job", func(t *testing.T) { + resp, err := scheduler.CreateDeployment(context.Background(), &pbSchedulerV1.CreateDeploymentRequest{ + Spec: &pbSchedulerV1.Spec{ + Metadata: &pbSchedulerV1.Metadata{ + Name: "test", + }, + Base: &pbSchedulerV1.ObjectBase{ + Labels: nil, + Profiles: []string{ + "test", + }, + }, + Containers: map[string]*pbSchedulerV1.ContainerBase{ + "example": { + Image: util.NewType("ubuntu:20.04"), + Args: []string{ + "/bin/bash", + "-c", + "true", + }, + }, + }, + }, + Deployment: &pbSchedulerV1.DeploymentSpec{ + Replicas: util.NewType[int32](5), + }, + }) + require.NoError(t, err) + + require.EqualValues(t, "test", resp.GetName()) + }) + + t.Run("Ensure job exist - get", func(t *testing.T) { + resp, err := scheduler.GetDeployment(context.Background(), &pbSchedulerV1.GetDeploymentRequest{ + Name: "test", + }) + require.NoError(t, err) + + require.True(t, resp.GetExists()) + }) + + t.Run("Ensure job exist - list", func(t *testing.T) { + resp, err := scheduler.ListDeployment(context.Background(), &pbSchedulerV1.ListDeploymentRequest{}) + require.NoError(t, err) + + require.Len(t, resp.GetDeployments(), 1) + require.Contains(t, resp.GetDeployments(), "test") + }) + + t.Run("Ensure job details - pre", func(t *testing.T) { + resp, err := scheduler.GetDeployment(context.Background(), &pbSchedulerV1.GetDeploymentRequest{ + Name: "test", + }) + require.NoError(t, err) + + require.True(t, resp.GetExists()) + require.EqualValues(t, 0, resp.GetDeployment().GetStatus().GetReplicas()) + }) + + t.Run("Ensure job details - update", func(t *testing.T) { + job := tests.NewMetaObject[*schedulerApi.ArangoSchedulerDeployment](t, tests.FakeNamespace, "test") + + tests.RefreshObjectsC(t, client, &job) + + job.Status.Replicas = 1 + + tests.UpdateObjectsC(t, client, &job) + }) + + t.Run("Ensure job details - post", func(t *testing.T) { + resp, err := scheduler.GetDeployment(context.Background(), &pbSchedulerV1.GetDeploymentRequest{ + Name: "test", + }) + require.NoError(t, err) + + require.True(t, resp.GetExists()) + require.EqualValues(t, 1, resp.GetDeployment().GetStatus().GetReplicas()) + }) + + t.Run("Delete Job", func(t *testing.T) { + resp, err := scheduler.DeleteDeployment(context.Background(), &pbSchedulerV1.DeleteDeploymentRequest{ + Name: "test", + }) + require.NoError(t, err) + require.True(t, resp.GetExists()) + }) + + t.Run("Re-Delete Job", func(t *testing.T) { + resp, err := scheduler.DeleteDeployment(context.Background(), &pbSchedulerV1.DeleteDeploymentRequest{ + Name: "test", + }) + require.NoError(t, err) + require.False(t, resp.GetExists()) + }) + + t.Run("Ensure job does not exist after deletion - get", func(t *testing.T) { + resp, err := scheduler.GetDeployment(context.Background(), &pbSchedulerV1.GetDeploymentRequest{ + Name: "test", + }) + require.NoError(t, err) + + require.False(t, resp.GetExists()) + }) + + t.Run("Ensure job does not exist after deletion - list", func(t *testing.T) { + resp, err := scheduler.ListDeployment(context.Background(), &pbSchedulerV1.ListDeploymentRequest{}) + require.NoError(t, err) + + require.Len(t, resp.GetDeployments(), 0) + }) +} diff --git a/integrations/scheduler/v1/helpers.go b/integrations/scheduler/v1/helpers.go new file mode 100644 index 000000000..0cb628333 --- /dev/null +++ b/integrations/scheduler/v1/helpers.go @@ -0,0 +1,43 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func ExtractStatusMetadata(mt schedulerApi.ArangoSchedulerStatusMetadata) *pbSchedulerV1.StatusMetadata { + var r pbSchedulerV1.StatusMetadata + + r.Profiles = mt.Profiles + + if obj := mt.Object; obj == nil { + r.Created = false + } else { + r.Created = true + r.Checksum = util.NewType(obj.GetChecksum()) + r.Uid = util.NewType(obj.GetChecksum()) + } + + return &r +} diff --git a/integrations/scheduler/v1/implementation.go b/integrations/scheduler/v1/implementation.go index 0eec1473e..50eb509f6 100644 --- a/integrations/scheduler/v1/implementation.go +++ b/integrations/scheduler/v1/implementation.go @@ -24,16 +24,9 @@ import ( "context" "google.golang.org/grpc" - batch "k8s.io/api/batch/v1" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" - "github.com/arangodb/kube-arangodb/pkg/debug_package/generators/kubernetes" - "github.com/arangodb/kube-arangodb/pkg/scheduler" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources" "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/arangodb/kube-arangodb/pkg/util/svc" @@ -52,58 +45,114 @@ func newInternal(ctx context.Context, client kclient.Client, cfg Configuration) if err := kresources.VerifyAll(ctx, client.Kubernetes(), kresources.AccessRequest{ Verb: "create", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "jobs", + Resource: "arangoschedulerbatchjobs", Namespace: cfg.Namespace, }, kresources.AccessRequest{ Verb: "list", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "jobs", + Resource: "arangoschedulerbatchjobs", Namespace: cfg.Namespace, }, kresources.AccessRequest{ Verb: "delete", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "jobs", + Resource: "arangoschedulerbatchjobs", Namespace: cfg.Namespace, }, kresources.AccessRequest{ Verb: "get", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "jobs", + Resource: "arangoschedulerbatchjobs", Namespace: cfg.Namespace, }, kresources.AccessRequest{ Verb: "create", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "cronjobs", + Resource: "arangoschedulercronjobs", Namespace: cfg.Namespace, }, kresources.AccessRequest{ Verb: "list", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "cronjobs", + Resource: "arangoschedulercronjobs", Namespace: cfg.Namespace, }, kresources.AccessRequest{ Verb: "delete", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "cronjobs", + Resource: "arangoschedulercronjobs", Namespace: cfg.Namespace, }, kresources.AccessRequest{ Verb: "get", - Group: "batch", + Group: "scheduler.arangodb.com", Version: "v1", - Resource: "cronjobs", + Resource: "arangoschedulercronjobs", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "create", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerpods", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "list", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerpods", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "delete", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerpods", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "get", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerpods", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "create", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerdeployments", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "list", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerdeployments", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "delete", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerdeployments", + Namespace: cfg.Namespace, + }, + kresources.AccessRequest{ + Verb: "get", + Group: "scheduler.arangodb.com", + Version: "v1", + Resource: "arangoschedulerdeployments", Namespace: cfg.Namespace, }, ); err != nil { @@ -112,17 +161,15 @@ func newInternal(ctx context.Context, client kclient.Client, cfg Configuration) } return &implementation{ - cfg: cfg, - client: client, - scheduler: scheduler.NewScheduler(client, cfg.Namespace), + cfg: cfg, + client: client, }, nil } type implementation struct { cfg Configuration - client kclient.Client - scheduler scheduler.Scheduler + client kclient.Client pbSchedulerV1.UnimplementedSchedulerV1Server } @@ -138,367 +185,3 @@ func (i *implementation) Register(registrar *grpc.Server) { func (i *implementation) Health() svc.HealthState { return svc.Healthy } - -func (i *implementation) CreateBatchJob(ctx context.Context, request *pbSchedulerV1.CreateBatchJobRequest) (*pbSchedulerV1.CreateBatchJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - rendered, profiles, err := i.scheduler.Render(ctx, request.GetSpec()) - if err != nil { - return nil, err - } - - rendered.Spec.RestartPolicy = core.RestartPolicyNever - - var spec batch.Job - - spec.Namespace = i.cfg.Namespace - - if meta := request.GetSpec().GetMetadata(); meta != nil { - if util.TypeOrDefault(meta.GenerateName, false) { - spec.GenerateName = meta.Name - } else { - spec.Name = meta.Name - } - } - - spec.Spec.Template = *rendered - - if batchJob := request.GetBatchJob(); batchJob != nil { - if v := batchJob.Completions; v != nil { - spec.Spec.Completions = v - } - - if v := batchJob.Parallelism; v != nil { - spec.Spec.Parallelism = v - } - - if v := batchJob.BackoffLimit; v != nil { - spec.Spec.BackoffLimit = v - } - } - - if batchJobSpec := request.GetSpec(); batchJobSpec != nil { - if job := batchJobSpec.Job; job != nil { - spec.Labels = job.Labels - } - } - - job, err := i.client.Kubernetes().BatchV1().Jobs(i.cfg.Namespace).Create(ctx, &spec, meta.CreateOptions{}) - - if err != nil { - return nil, err - } - - return &pbSchedulerV1.CreateBatchJobResponse{ - Name: job.Name, - Profiles: profiles, - }, nil -} - -func (i *implementation) GetBatchJob(ctx context.Context, request *pbSchedulerV1.GetBatchJobRequest) (*pbSchedulerV1.GetBatchJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - job, err := i.client.Kubernetes().BatchV1().Jobs(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) - if err != nil { - if kerrors.IsNotFound(err) { - return &pbSchedulerV1.GetBatchJobResponse{ - Exists: false, - }, nil - } - - return nil, err - } - - return &pbSchedulerV1.GetBatchJobResponse{ - Exists: true, - - BatchJob: &pbSchedulerV1.BatchJob{ - Spec: &pbSchedulerV1.BatchJobSpec{ - Parallelism: job.Spec.Parallelism, - Completions: job.Spec.Completions, - BackoffLimit: job.Spec.BackoffLimit, - }, - Status: &pbSchedulerV1.BatchJobStatus{ - Active: job.Status.Active, - Succeeded: job.Status.Succeeded, - Failed: job.Status.Failed, - }, - }, - }, nil -} - -func (i *implementation) DeleteBatchJob(ctx context.Context, request *pbSchedulerV1.DeleteBatchJobRequest) (*pbSchedulerV1.DeleteBatchJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - var d meta.DeleteOptions - - if v := request.DeleteChildPods; v != nil { - if *v { - d.PropagationPolicy = util.NewType(meta.DeletePropagationBackground) - } else { - d.PropagationPolicy = util.NewType(meta.DeletePropagationOrphan) - } - } - - err := i.client.Kubernetes().BatchV1().Jobs(i.cfg.Namespace).Delete(ctx, request.GetName(), d) - if err != nil { - if kerrors.IsNotFound(err) { - return &pbSchedulerV1.DeleteBatchJobResponse{ - Exists: false, - }, nil - } - - return nil, err - } - - return &pbSchedulerV1.DeleteBatchJobResponse{Exists: true}, nil -} - -func (i *implementation) ListBatchJob(ctx context.Context, request *pbSchedulerV1.ListBatchJobRequest) (*pbSchedulerV1.ListBatchJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - objects, err := kubernetes.ListObjects[*batch.JobList, *batch.Job](ctx, i.client.Kubernetes().BatchV1().Jobs(i.cfg.Namespace), func(result *batch.JobList) []*batch.Job { - r := make([]*batch.Job, len(result.Items)) - - for id := range result.Items { - r[id] = result.Items[id].DeepCopy() - } - - return r - }) - - if err != nil { - return nil, err - } - - return &pbSchedulerV1.ListBatchJobResponse{ - BatchJobs: kubernetes.Extract(objects, func(in *batch.Job) string { - return in.GetName() - }), - }, nil -} - -func (i *implementation) CreateCronJob(ctx context.Context, request *pbSchedulerV1.CreateCronJobRequest) (*pbSchedulerV1.CreateCronJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - rendered, profiles, err := i.scheduler.Render(ctx, request.GetSpec()) - if err != nil { - return nil, err - } - - rendered.Spec.RestartPolicy = core.RestartPolicyNever - - var spec batch.CronJob - - spec.Namespace = i.cfg.Namespace - - if meta := request.GetSpec().GetMetadata(); meta != nil { - if util.TypeOrDefault(meta.GenerateName, false) { - spec.GenerateName = meta.Name - } else { - spec.Name = meta.Name - } - } - - spec.Spec.JobTemplate.Spec.Template = *rendered - - if cronJob := request.GetCronJob(); cronJob != nil { - spec.Spec.Schedule = cronJob.Schedule - - if batchJob := cronJob.GetJob(); batchJob != nil { - if v := batchJob.Completions; v != nil { - spec.Spec.JobTemplate.Spec.Completions = v - } - - if v := batchJob.Parallelism; v != nil { - spec.Spec.JobTemplate.Spec.Parallelism = v - } - - if v := batchJob.BackoffLimit; v != nil { - spec.Spec.JobTemplate.Spec.BackoffLimit = v - } - } - } - - if batchJobSpec := request.GetSpec(); batchJobSpec != nil { - if job := batchJobSpec.Job; job != nil { - spec.Labels = job.Labels - spec.Spec.JobTemplate.Labels = job.Labels - } - } - - job, err := i.client.Kubernetes().BatchV1().CronJobs(i.cfg.Namespace).Create(ctx, &spec, meta.CreateOptions{}) - - if err != nil { - return nil, err - } - - return &pbSchedulerV1.CreateCronJobResponse{ - Name: job.Name, - Profiles: profiles, - }, nil -} - -func (i *implementation) GetCronJob(ctx context.Context, request *pbSchedulerV1.GetCronJobRequest) (*pbSchedulerV1.GetCronJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - job, err := i.client.Kubernetes().BatchV1().CronJobs(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) - if err != nil { - if kerrors.IsNotFound(err) { - return &pbSchedulerV1.GetCronJobResponse{ - Exists: false, - }, nil - } - - return nil, err - } - - return &pbSchedulerV1.GetCronJobResponse{ - Exists: true, - - CronJob: &pbSchedulerV1.CronJob{ - Spec: &pbSchedulerV1.CronJobSpec{ - Schedule: job.Spec.Schedule, - - Job: &pbSchedulerV1.BatchJobSpec{ - Parallelism: job.Spec.JobTemplate.Spec.Parallelism, - Completions: job.Spec.JobTemplate.Spec.Completions, - BackoffLimit: job.Spec.JobTemplate.Spec.BackoffLimit, - }, - }, - }, - - BatchJobs: kubernetes.Extract(job.Status.Active, func(in core.ObjectReference) string { - return in.Name - }), - }, nil -} - -func (i *implementation) UpdateCronJob(ctx context.Context, request *pbSchedulerV1.UpdateCronJobRequest) (*pbSchedulerV1.UpdateCronJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - job, err := i.client.Kubernetes().BatchV1().CronJobs(i.cfg.Namespace).Get(ctx, request.GetName(), meta.GetOptions{}) - if err != nil { - if kerrors.IsNotFound(err) { - return &pbSchedulerV1.UpdateCronJobResponse{ - Exists: false, - }, nil - } - - return nil, err - } - - if cronJob := request.GetSpec(); cronJob != nil { - job.Spec.Schedule = cronJob.Schedule - - if batchJob := cronJob.GetJob(); batchJob != nil { - if v := batchJob.Completions; v != nil { - job.Spec.JobTemplate.Spec.Completions = v - } - - if v := batchJob.Parallelism; v != nil { - job.Spec.JobTemplate.Spec.Parallelism = v - } - - if v := batchJob.BackoffLimit; v != nil { - job.Spec.JobTemplate.Spec.BackoffLimit = v - } - } - } - - job, err = i.client.Kubernetes().BatchV1().CronJobs(i.cfg.Namespace).Update(ctx, job, meta.UpdateOptions{}) - if err != nil { - if kerrors.IsNotFound(err) { - return &pbSchedulerV1.UpdateCronJobResponse{ - Exists: false, - }, nil - } - - return nil, err - } - - return &pbSchedulerV1.UpdateCronJobResponse{ - Exists: true, - - CronJob: &pbSchedulerV1.CronJob{ - Spec: &pbSchedulerV1.CronJobSpec{ - Schedule: job.Spec.Schedule, - - Job: &pbSchedulerV1.BatchJobSpec{ - Parallelism: job.Spec.JobTemplate.Spec.Parallelism, - Completions: job.Spec.JobTemplate.Spec.Completions, - BackoffLimit: job.Spec.JobTemplate.Spec.BackoffLimit, - }, - }, - }, - }, nil -} - -func (i *implementation) ListCronJob(ctx context.Context, request *pbSchedulerV1.ListCronJobRequest) (*pbSchedulerV1.ListCronJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - objects, err := kubernetes.ListObjects[*batch.CronJobList, *batch.CronJob](ctx, i.client.Kubernetes().BatchV1().CronJobs(i.cfg.Namespace), func(result *batch.CronJobList) []*batch.CronJob { - r := make([]*batch.CronJob, len(result.Items)) - - for id := range result.Items { - r[id] = result.Items[id].DeepCopy() - } - - return r - }) - - if err != nil { - return nil, err - } - - return &pbSchedulerV1.ListCronJobResponse{ - CronJobs: kubernetes.Extract(objects, func(in *batch.CronJob) string { - return in.GetName() - }), - }, nil -} - -func (i *implementation) DeleteCronJob(ctx context.Context, request *pbSchedulerV1.DeleteCronJobRequest) (*pbSchedulerV1.DeleteCronJobResponse, error) { - if request == nil { - return nil, errors.Errorf("Request is nil") - } - - var d meta.DeleteOptions - - if v := request.DeleteChildPods; v != nil { - if *v { - d.PropagationPolicy = util.NewType(meta.DeletePropagationBackground) - } else { - d.PropagationPolicy = util.NewType(meta.DeletePropagationOrphan) - } - } - - err := i.client.Kubernetes().BatchV1().CronJobs(i.cfg.Namespace).Delete(ctx, request.GetName(), d) - if err != nil { - if kerrors.IsNotFound(err) { - return &pbSchedulerV1.DeleteCronJobResponse{ - Exists: false, - }, nil - } - - return nil, err - } - - return &pbSchedulerV1.DeleteCronJobResponse{Exists: true}, nil -} diff --git a/internal/cr_validation_test.go b/internal/cr_validation_test.go index b5d8dc04c..c376d4c4d 100644 --- a/internal/cr_validation_test.go +++ b/internal/cr_validation_test.go @@ -229,6 +229,42 @@ func Test_GenerateCRValidationSchemas(t *testing.T) { }, }, }, + "scheduler-pod": { + fmt.Sprintf("%s/pkg/apis/scheduler/v1alpha1", root): { + "v1beta1": { + objects: map[string]interface{}{ + "spec": schedulerApi.ArangoSchedulerPod{}.Spec, + }, + }, + }, + }, + "scheduler-deployment": { + fmt.Sprintf("%s/pkg/apis/scheduler/v1alpha1", root): { + "v1beta1": { + objects: map[string]interface{}{ + "spec": schedulerApi.ArangoSchedulerDeployment{}.Spec, + }, + }, + }, + }, + "scheduler-batchjob": { + fmt.Sprintf("%s/pkg/apis/scheduler/v1alpha1", root): { + "v1beta1": { + objects: map[string]interface{}{ + "spec": schedulerApi.ArangoSchedulerBatchJob{}.Spec, + }, + }, + }, + }, + "scheduler-cronjob": { + fmt.Sprintf("%s/pkg/apis/scheduler/v1alpha1", root): { + "v1beta1": { + objects: map[string]interface{}{ + "spec": schedulerApi.ArangoSchedulerCronJob{}.Spec, + }, + }, + }, + }, "ml-extension": { fmt.Sprintf("%s/pkg/apis/ml/v1alpha1", root): { "v1alpha1": { diff --git a/pkg/apis/scheduler/definitions.go b/pkg/apis/scheduler/definitions.go index af9e57cb9..e472fffbd 100644 --- a/pkg/apis/scheduler/definitions.go +++ b/pkg/apis/scheduler/definitions.go @@ -25,5 +25,21 @@ const ( ArangoProfileResourceKind = "ArangoProfile" ArangoProfileResourcePlural = "arangoprofiles" + PodCRDName = PodResourcePlural + "." + ArangoSchedulerGroupName + PodResourceKind = "ArangoSchedulerPod" + PodResourcePlural = "arangoschedulerpods" + + DeploymentCRDName = DeploymentResourcePlural + "." + ArangoSchedulerGroupName + DeploymentResourceKind = "ArangoSchedulerDeployment" + DeploymentResourcePlural = "arangoschedulerdeployments" + + BatchJobCRDName = BatchJobResourcePlural + "." + ArangoSchedulerGroupName + BatchJobResourceKind = "ArangoSchedulerBatchJob" + BatchJobResourcePlural = "arangoschedulerbatchjobs" + + CronJobCRDName = CronJobResourcePlural + "." + ArangoSchedulerGroupName + CronJobResourceKind = "ArangoSchedulerCronJob" + CronJobResourcePlural = "arangoschedulercronjobs" + ArangoSchedulerGroupName = "scheduler.arangodb.com" ) diff --git a/pkg/apis/scheduler/v1beta1/profile.go b/pkg/apis/scheduler/v1beta1/profile.go index 843c4639c..7cc0a0fe8 100644 --- a/pkg/apis/scheduler/v1beta1/profile.go +++ b/pkg/apis/scheduler/v1beta1/profile.go @@ -20,7 +20,11 @@ package v1beta1 -import meta "k8s.io/apimachinery/pkg/apis/meta/v1" +import ( + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" +) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -44,6 +48,18 @@ type ArangoProfile struct { Status ProfileStatus `json:"status"` } +// AsOwner creates an OwnerReference for the given ArangoSchedulerBatchJob +func (a *ArangoProfile) AsOwner() meta.OwnerReference { + trueVar := true + return meta.OwnerReference{ + APIVersion: SchemeGroupVersion.String(), + Kind: scheduler.ArangoProfileResourceKind, + Name: a.Name, + UID: a.UID, + Controller: &trueVar, + } +} + func (a *ArangoProfile) GetStatus() ProfileStatus { return a.Status } diff --git a/pkg/apis/scheduler/v1beta1/profile_templates.go b/pkg/apis/scheduler/v1beta1/profile_templates.go index c083bc0d5..4e6e45e5f 100644 --- a/pkg/apis/scheduler/v1beta1/profile_templates.go +++ b/pkg/apis/scheduler/v1beta1/profile_templates.go @@ -55,19 +55,19 @@ func (p ProfileTemplates) Merge() *ProfileTemplate { func (p ProfileTemplates) RenderOnTemplate(pod *core.PodTemplateSpec) error { t := p.Merge() - // Apply Pod Spec + // Apply ArangoSchedulerPod Spec if err := t.GetPod().Apply(pod); err != nil { - return errors.Wrapf(err, "Error while rendering Pod") + return errors.Wrapf(err, "Error while rendering ArangoSchedulerPod") } // Apply Generic Containers Spec if err := t.GetContainer().ApplyGeneric(pod); err != nil { - return errors.Wrapf(err, "Error while rendering Pod") + return errors.Wrapf(err, "Error while rendering ArangoSchedulerPod") } // Apply Containers Spec if err := t.GetContainer().ApplyContainers(pod); err != nil { - return errors.Wrapf(err, "Error while rendering Pod") + return errors.Wrapf(err, "Error while rendering ArangoSchedulerPod") } return nil diff --git a/pkg/apis/scheduler/v1beta1/register.go b/pkg/apis/scheduler/v1beta1/register.go index 4a05cbf69..be97d2ad4 100644 --- a/pkg/apis/scheduler/v1beta1/register.go +++ b/pkg/apis/scheduler/v1beta1/register.go @@ -50,6 +50,14 @@ func addKnownTypes(s *runtime.Scheme) error { s.AddKnownTypes(SchemeGroupVersion, &ArangoProfile{}, &ArangoProfileList{}, + &ArangoSchedulerPod{}, + &ArangoSchedulerPodList{}, + &ArangoSchedulerDeployment{}, + &ArangoSchedulerDeploymentList{}, + &ArangoSchedulerBatchJob{}, + &ArangoSchedulerBatchJobList{}, + &ArangoSchedulerCronJob{}, + &ArangoSchedulerCronJobList{}, ) meta.AddToGroupVersion(s, SchemeGroupVersion) return nil diff --git a/pkg/apis/scheduler/v1beta1/types.go b/pkg/apis/scheduler/v1beta1/types.go new file mode 100644 index 000000000..67737ec01 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/types.go @@ -0,0 +1,31 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + +type ArangoSchedulerStatusMetadata struct { + // Object keeps the information about object + Object *sharedApi.Object `json:"object,omitempty"` + + // Profiles keeps the information about applied profiles + Profiles []string `json:"profiles,omitempty"` +} diff --git a/pkg/apis/scheduler/v1beta1/types_batchjob.go b/pkg/apis/scheduler/v1beta1/types_batchjob.go new file mode 100644 index 000000000..61abd6eb4 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/types_batchjob.go @@ -0,0 +1,83 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import ( + batch "k8s.io/api/batch/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerBatchJobList is a list of BatchJobs. +type ArangoSchedulerBatchJobList struct { + meta.TypeMeta `json:",inline"` + meta.ListMeta `json:"metadata,omitempty"` + + Items []ArangoSchedulerBatchJob `json:"items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerBatchJob wraps batch. ArangoSchedulerBatchJob with profile details +type ArangoSchedulerBatchJob struct { + meta.TypeMeta `json:",inline"` + meta.ObjectMeta `json:"metadata,omitempty"` + + Spec ArangoSchedulerBatchJobSpec `json:"spec"` + Status ArangoSchedulerBatchJobStatus `json:"status"` +} + +type ArangoSchedulerBatchJobSpec struct { + // Profiles keeps list of the profiles + Profiles []string `json:"profiles,omitempty"` + + batch.JobSpec `json:",inline"` +} + +type ArangoSchedulerBatchJobStatus struct { + ArangoSchedulerStatusMetadata `json:",inline"` + + batch.JobStatus `json:",inline"` +} + +// AsOwner creates an OwnerReference for the given ArangoSchedulerBatchJob +func (d *ArangoSchedulerBatchJob) AsOwner() meta.OwnerReference { + trueVar := true + return meta.OwnerReference{ + APIVersion: SchemeGroupVersion.String(), + Kind: scheduler.BatchJobResourceKind, + Name: d.Name, + UID: d.UID, + Controller: &trueVar, + } +} + +func (d *ArangoSchedulerBatchJob) GetStatus() ArangoSchedulerBatchJobStatus { + return d.Status +} + +func (d *ArangoSchedulerBatchJob) SetStatus(status ArangoSchedulerBatchJobStatus) { + d.Status = status +} diff --git a/pkg/apis/scheduler/v1beta1/types_cronjob.go b/pkg/apis/scheduler/v1beta1/types_cronjob.go new file mode 100644 index 000000000..088f1986b --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/types_cronjob.go @@ -0,0 +1,83 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import ( + batch "k8s.io/api/batch/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerCronJobList is a list of CronJobs. +type ArangoSchedulerCronJobList struct { + meta.TypeMeta `json:",inline"` + meta.ListMeta `json:"metadata,omitempty"` + + Items []ArangoSchedulerCronJob `json:"items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerCronJob wraps batch. ArangoSchedulerCronJob with profile details +type ArangoSchedulerCronJob struct { + meta.TypeMeta `json:",inline"` + meta.ObjectMeta `json:"metadata,omitempty"` + + Spec ArangoSchedulerCronJobSpec `json:"spec"` + Status ArangoSchedulerCronJobStatus `json:"status"` +} + +type ArangoSchedulerCronJobSpec struct { + // Profiles keeps list of the profiles + Profiles []string `json:"profiles,omitempty"` + + batch.CronJobSpec `json:",inline"` +} + +type ArangoSchedulerCronJobStatus struct { + ArangoSchedulerStatusMetadata `json:",inline"` + + batch.CronJobStatus `json:",inline"` +} + +// AsOwner creates an OwnerReference for the given ArangoSchedulerCronJob +func (d *ArangoSchedulerCronJob) AsOwner() meta.OwnerReference { + trueVar := true + return meta.OwnerReference{ + APIVersion: SchemeGroupVersion.String(), + Kind: scheduler.CronJobResourceKind, + Name: d.Name, + UID: d.UID, + Controller: &trueVar, + } +} + +func (d *ArangoSchedulerCronJob) GetStatus() ArangoSchedulerCronJobStatus { + return d.Status +} + +func (d *ArangoSchedulerCronJob) SetStatus(status ArangoSchedulerCronJobStatus) { + d.Status = status +} diff --git a/pkg/apis/scheduler/v1beta1/types_deployment.go b/pkg/apis/scheduler/v1beta1/types_deployment.go new file mode 100644 index 000000000..ea5ffb6c7 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/types_deployment.go @@ -0,0 +1,83 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import ( + apps "k8s.io/api/apps/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerDeploymentList is a list of Deployments. +type ArangoSchedulerDeploymentList struct { + meta.TypeMeta `json:",inline"` + meta.ListMeta `json:"metadata,omitempty"` + + Items []ArangoSchedulerDeployment `json:"items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerDeployment wraps apps. ArangoSchedulerDeployment with profile details +type ArangoSchedulerDeployment struct { + meta.TypeMeta `json:",inline"` + meta.ObjectMeta `json:"metadata,omitempty"` + + Spec ArangoSchedulerDeploymentSpec `json:"spec"` + Status ArangoSchedulerDeploymentStatus `json:"status"` +} + +type ArangoSchedulerDeploymentSpec struct { + // Profiles keeps list of the profiles + Profiles []string `json:"profiles,omitempty"` + + apps.DeploymentSpec `json:",inline"` +} + +type ArangoSchedulerDeploymentStatus struct { + ArangoSchedulerStatusMetadata `json:",inline"` + + apps.DeploymentStatus `json:",inline"` +} + +// AsOwner creates an OwnerReference for the given ArangoSchedulerDeployment +func (d *ArangoSchedulerDeployment) AsOwner() meta.OwnerReference { + trueVar := true + return meta.OwnerReference{ + APIVersion: SchemeGroupVersion.String(), + Kind: scheduler.DeploymentResourceKind, + Name: d.Name, + UID: d.UID, + Controller: &trueVar, + } +} + +func (d *ArangoSchedulerDeployment) GetStatus() ArangoSchedulerDeploymentStatus { + return d.Status +} + +func (d *ArangoSchedulerDeployment) SetStatus(status ArangoSchedulerDeploymentStatus) { + d.Status = status +} diff --git a/pkg/apis/scheduler/v1beta1/types_pod.go b/pkg/apis/scheduler/v1beta1/types_pod.go new file mode 100644 index 000000000..f8be4df60 --- /dev/null +++ b/pkg/apis/scheduler/v1beta1/types_pod.go @@ -0,0 +1,83 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package v1beta1 + +import ( + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerPodList is a list of Pods. +type ArangoSchedulerPodList struct { + meta.TypeMeta `json:",inline"` + meta.ListMeta `json:"metadata,omitempty"` + + Items []ArangoSchedulerPod `json:"items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ArangoSchedulerPod wraps core. ArangoSchedulerPod with profile details +type ArangoSchedulerPod struct { + meta.TypeMeta `json:",inline"` + meta.ObjectMeta `json:"metadata,omitempty"` + + Spec ArangoSchedulerPodSpec `json:"spec"` + Status ArangoSchedulerPodStatus `json:"status"` +} + +type ArangoSchedulerPodSpec struct { + // Profiles keeps list of the profiles + Profiles []string `json:"profiles,omitempty"` + + core.PodSpec `json:",inline"` +} + +type ArangoSchedulerPodStatus struct { + ArangoSchedulerStatusMetadata `json:",inline"` + + core.PodStatus `json:",inline"` +} + +// AsOwner creates an OwnerReference for the given ArangoSchedulerPod +func (d *ArangoSchedulerPod) AsOwner() meta.OwnerReference { + trueVar := true + return meta.OwnerReference{ + APIVersion: SchemeGroupVersion.String(), + Kind: scheduler.PodResourceKind, + Name: d.Name, + UID: d.UID, + Controller: &trueVar, + } +} + +func (d *ArangoSchedulerPod) GetStatus() ArangoSchedulerPodStatus { + return d.Status +} + +func (d *ArangoSchedulerPod) SetStatus(status ArangoSchedulerPodStatus) { + d.Status = status +} diff --git a/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go b/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go index 3b1d48536..798dac8e1 100644 --- a/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/scheduler/v1beta1/zz_generated.deepcopy.go @@ -29,7 +29,8 @@ import ( deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" container "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" pod "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -94,6 +95,436 @@ func (in *ArangoProfileList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerBatchJob) DeepCopyInto(out *ArangoSchedulerBatchJob) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerBatchJob. +func (in *ArangoSchedulerBatchJob) DeepCopy() *ArangoSchedulerBatchJob { + if in == nil { + return nil + } + out := new(ArangoSchedulerBatchJob) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerBatchJob) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerBatchJobList) DeepCopyInto(out *ArangoSchedulerBatchJobList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ArangoSchedulerBatchJob, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerBatchJobList. +func (in *ArangoSchedulerBatchJobList) DeepCopy() *ArangoSchedulerBatchJobList { + if in == nil { + return nil + } + out := new(ArangoSchedulerBatchJobList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerBatchJobList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerBatchJobSpec) DeepCopyInto(out *ArangoSchedulerBatchJobSpec) { + *out = *in + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.JobSpec.DeepCopyInto(&out.JobSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerBatchJobSpec. +func (in *ArangoSchedulerBatchJobSpec) DeepCopy() *ArangoSchedulerBatchJobSpec { + if in == nil { + return nil + } + out := new(ArangoSchedulerBatchJobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerBatchJobStatus) DeepCopyInto(out *ArangoSchedulerBatchJobStatus) { + *out = *in + in.ArangoSchedulerStatusMetadata.DeepCopyInto(&out.ArangoSchedulerStatusMetadata) + in.JobStatus.DeepCopyInto(&out.JobStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerBatchJobStatus. +func (in *ArangoSchedulerBatchJobStatus) DeepCopy() *ArangoSchedulerBatchJobStatus { + if in == nil { + return nil + } + out := new(ArangoSchedulerBatchJobStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerCronJob) DeepCopyInto(out *ArangoSchedulerCronJob) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerCronJob. +func (in *ArangoSchedulerCronJob) DeepCopy() *ArangoSchedulerCronJob { + if in == nil { + return nil + } + out := new(ArangoSchedulerCronJob) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerCronJob) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerCronJobList) DeepCopyInto(out *ArangoSchedulerCronJobList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ArangoSchedulerCronJob, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerCronJobList. +func (in *ArangoSchedulerCronJobList) DeepCopy() *ArangoSchedulerCronJobList { + if in == nil { + return nil + } + out := new(ArangoSchedulerCronJobList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerCronJobList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerCronJobSpec) DeepCopyInto(out *ArangoSchedulerCronJobSpec) { + *out = *in + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.CronJobSpec.DeepCopyInto(&out.CronJobSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerCronJobSpec. +func (in *ArangoSchedulerCronJobSpec) DeepCopy() *ArangoSchedulerCronJobSpec { + if in == nil { + return nil + } + out := new(ArangoSchedulerCronJobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerCronJobStatus) DeepCopyInto(out *ArangoSchedulerCronJobStatus) { + *out = *in + in.ArangoSchedulerStatusMetadata.DeepCopyInto(&out.ArangoSchedulerStatusMetadata) + in.CronJobStatus.DeepCopyInto(&out.CronJobStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerCronJobStatus. +func (in *ArangoSchedulerCronJobStatus) DeepCopy() *ArangoSchedulerCronJobStatus { + if in == nil { + return nil + } + out := new(ArangoSchedulerCronJobStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerDeployment) DeepCopyInto(out *ArangoSchedulerDeployment) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerDeployment. +func (in *ArangoSchedulerDeployment) DeepCopy() *ArangoSchedulerDeployment { + if in == nil { + return nil + } + out := new(ArangoSchedulerDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerDeployment) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerDeploymentList) DeepCopyInto(out *ArangoSchedulerDeploymentList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ArangoSchedulerDeployment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerDeploymentList. +func (in *ArangoSchedulerDeploymentList) DeepCopy() *ArangoSchedulerDeploymentList { + if in == nil { + return nil + } + out := new(ArangoSchedulerDeploymentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerDeploymentList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerDeploymentSpec) DeepCopyInto(out *ArangoSchedulerDeploymentSpec) { + *out = *in + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.DeploymentSpec.DeepCopyInto(&out.DeploymentSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerDeploymentSpec. +func (in *ArangoSchedulerDeploymentSpec) DeepCopy() *ArangoSchedulerDeploymentSpec { + if in == nil { + return nil + } + out := new(ArangoSchedulerDeploymentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerDeploymentStatus) DeepCopyInto(out *ArangoSchedulerDeploymentStatus) { + *out = *in + in.ArangoSchedulerStatusMetadata.DeepCopyInto(&out.ArangoSchedulerStatusMetadata) + in.DeploymentStatus.DeepCopyInto(&out.DeploymentStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerDeploymentStatus. +func (in *ArangoSchedulerDeploymentStatus) DeepCopy() *ArangoSchedulerDeploymentStatus { + if in == nil { + return nil + } + out := new(ArangoSchedulerDeploymentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerPod) DeepCopyInto(out *ArangoSchedulerPod) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerPod. +func (in *ArangoSchedulerPod) DeepCopy() *ArangoSchedulerPod { + if in == nil { + return nil + } + out := new(ArangoSchedulerPod) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerPod) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerPodList) DeepCopyInto(out *ArangoSchedulerPodList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ArangoSchedulerPod, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerPodList. +func (in *ArangoSchedulerPodList) DeepCopy() *ArangoSchedulerPodList { + if in == nil { + return nil + } + out := new(ArangoSchedulerPodList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ArangoSchedulerPodList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerPodSpec) DeepCopyInto(out *ArangoSchedulerPodSpec) { + *out = *in + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.PodSpec.DeepCopyInto(&out.PodSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerPodSpec. +func (in *ArangoSchedulerPodSpec) DeepCopy() *ArangoSchedulerPodSpec { + if in == nil { + return nil + } + out := new(ArangoSchedulerPodSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerPodStatus) DeepCopyInto(out *ArangoSchedulerPodStatus) { + *out = *in + in.ArangoSchedulerStatusMetadata.DeepCopyInto(&out.ArangoSchedulerStatusMetadata) + in.PodStatus.DeepCopyInto(&out.PodStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerPodStatus. +func (in *ArangoSchedulerPodStatus) DeepCopy() *ArangoSchedulerPodStatus { + if in == nil { + return nil + } + out := new(ArangoSchedulerPodStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArangoSchedulerStatusMetadata) DeepCopyInto(out *ArangoSchedulerStatusMetadata) { + *out = *in + if in.Object != nil { + in, out := &in.Object, &out.Object + *out = new(v1.Object) + (*in).DeepCopyInto(*out) + } + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArangoSchedulerStatusMetadata. +func (in *ArangoSchedulerStatusMetadata) DeepCopy() *ArangoSchedulerStatusMetadata { + if in == nil { + return nil + } + out := new(ArangoSchedulerStatusMetadata) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProfileAcceptedTemplate) DeepCopyInto(out *ProfileAcceptedTemplate) { *out = *in @@ -148,7 +579,7 @@ func (in *ProfileSelectors) DeepCopyInto(out *ProfileSelectors) { *out = *in if in.Label != nil { in, out := &in.Label, &out.Label - *out = new(v1.LabelSelector) + *out = new(metav1.LabelSelector) (*in).DeepCopyInto(*out) } return diff --git a/pkg/crd/crds/crds.go b/pkg/crd/crds/crds.go index 8158a8745..7bc20920b 100644 --- a/pkg/crd/crds/crds.go +++ b/pkg/crd/crds/crds.go @@ -87,6 +87,10 @@ func AllDefinitions() []Definition { // Scheduler SchedulerProfileDefinitionWithOptions(), + SchedulerPodDefinitionWithOptions(), + SchedulerDeploymentDefinitionWithOptions(), + SchedulerBatchJobDefinitionWithOptions(), + SchedulerCronJobDefinitionWithOptions(), // Analytics AnalyticsGAEDefinitionWithOptions(), diff --git a/pkg/crd/crds/crds_test.go b/pkg/crd/crds/crds_test.go index 60368f107..e5d4f425f 100644 --- a/pkg/crd/crds/crds_test.go +++ b/pkg/crd/crds/crds_test.go @@ -92,6 +92,10 @@ func Test_CRD(t *testing.T) { {ml.ArangoMLCronJobCRDName, MLCronJobDefinitionWithOptions}, {ml.ArangoMLBatchJobCRDName, MLBatchJobDefinitionWithOptions}, {scheduler.ArangoProfileCRDName, SchedulerProfileDefinitionWithOptions}, + {scheduler.PodCRDName, SchedulerPodDefinitionWithOptions}, + {scheduler.DeploymentCRDName, SchedulerDeploymentDefinitionWithOptions}, + {scheduler.BatchJobCRDName, SchedulerBatchJobDefinitionWithOptions}, + {scheduler.CronJobCRDName, SchedulerCronJobDefinitionWithOptions}, } for _, tc := range testCases { @@ -143,6 +147,10 @@ func Test_CRDGetters(t *testing.T) { ReplicationDeploymentReplicationWithOptions, StorageLocalStorageWithOptions, SchedulerProfileWithOptions, + SchedulerPodWithOptions, + SchedulerDeploymentWithOptions, + SchedulerBatchJobWithOptions, + SchedulerCronJobWithOptions, AnalyticsGAEWithOptions, NetworkingRouteWithOptions, } diff --git a/pkg/crd/crds/scheduler-batchjob.go b/pkg/crd/crds/scheduler-batchjob.go new file mode 100644 index 000000000..acf3d3974 --- /dev/null +++ b/pkg/crd/crds/scheduler-batchjob.go @@ -0,0 +1,51 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package crds + +import ( + _ "embed" + + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +func SchedulerBatchJobWithOptions(opts ...func(*CRDOptions)) *apiextensions.CustomResourceDefinition { + return getCRD(SchedulerBatchJobDefinitionData(), opts...) +} + +func SchedulerBatchJobDefinitionWithOptions(opts ...func(*CRDOptions)) Definition { + return Definition{ + DefinitionData: SchedulerBatchJobDefinitionData(), + CRD: SchedulerBatchJobWithOptions(opts...), + } +} + +func SchedulerBatchJobDefinitionData() DefinitionData { + return DefinitionData{ + definition: schedulerBatchJob, + schemaDefinition: schedulerBatchJobSchemaRaw, + } +} + +//go:embed scheduler-batchjob.yaml +var schedulerBatchJob []byte + +//go:embed scheduler-batchjob.schema.generated.yaml +var schedulerBatchJobSchemaRaw []byte diff --git a/pkg/crd/crds/scheduler-batchjob.schema.generated.yaml b/pkg/crd/crds/scheduler-batchjob.schema.generated.yaml new file mode 100644 index 000000000..ffa23976a --- /dev/null +++ b/pkg/crd/crds/scheduler-batchjob.schema.generated.yaml @@ -0,0 +1,2985 @@ +v1beta1: + openAPIV3Schema: + properties: + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + backoffLimit: + format: int32 + type: integer + backoffLimitPerIndex: + format: int32 + type: integer + completionMode: + type: string + completions: + format: int32 + type: integer + manualSelector: + type: boolean + maxFailedIndexes: + format: int32 + type: integer + parallelism: + format: int32 + type: integer + podFailurePolicy: + properties: + rules: + items: + properties: + action: + type: string + onExitCodes: + properties: + containerName: + type: string + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + type: object + onPodConditions: + items: + properties: + status: + type: string + type: + type: string + type: object + type: array + type: object + type: array + type: object + podReplacementPolicy: + type: string + profiles: + items: + type: string + type: array + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + suspend: + type: boolean + template: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + type: object + automountServiceAccountToken: + type: boolean + containers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + dnsConfig: + properties: + nameservers: + items: + type: string + type: array + options: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + searches: + items: + type: string + type: array + type: object + dnsPolicy: + type: string + enableServiceLinks: + type: boolean + ephemeralContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + targetContainerName: + type: string + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + hostAliases: + items: + properties: + hostnames: + items: + type: string + type: array + ip: + type: string + type: object + type: array + hostIPC: + type: boolean + hostNetwork: + type: boolean + hostPID: + type: boolean + hostUsers: + type: boolean + hostname: + type: string + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + initContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + os: + properties: + name: + type: string + type: object + overhead: + additionalProperties: + type: string + type: object + preemptionPolicy: + type: string + priority: + format: int32 + type: integer + priorityClassName: + type: string + readinessGates: + items: + properties: + conditionType: + type: string + type: object + type: array + resourceClaims: + items: + properties: + name: + type: string + source: + properties: + resourceClaimName: + type: string + resourceClaimTemplateName: + type: string + type: object + type: object + type: array + restartPolicy: + type: string + runtimeClassName: + type: string + schedulerName: + type: string + schedulingGates: + items: + properties: + name: + type: string + type: object + type: array + securityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccount: + type: string + serviceAccountName: + type: string + setHostnameAsFQDN: + type: boolean + shareProcessNamespace: + type: boolean + subdomain: + type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + type: object + type: array + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeID: + type: string + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + type: string + type: object + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + type: string + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + type: object + hostPath: + properties: + path: + type: string + type: + type: string + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + targetPortal: + type: string + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + type: object + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + type: object + type: object + type: array + type: object + type: object + ttlSecondsAfterFinished: + format: int32 + type: integer + type: object + status: + description: Object with preserved fields for backward compatibility + type: object + x-kubernetes-preserve-unknown-fields: true + type: object diff --git a/pkg/crd/crds/scheduler-batchjob.yaml b/pkg/crd/crds/scheduler-batchjob.yaml new file mode 100644 index 000000000..e20a31952 --- /dev/null +++ b/pkg/crd/crds/scheduler-batchjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/pkg/crd/crds/scheduler-cronjob.go b/pkg/crd/crds/scheduler-cronjob.go new file mode 100644 index 000000000..f0e41216d --- /dev/null +++ b/pkg/crd/crds/scheduler-cronjob.go @@ -0,0 +1,51 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package crds + +import ( + _ "embed" + + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +func SchedulerCronJobWithOptions(opts ...func(*CRDOptions)) *apiextensions.CustomResourceDefinition { + return getCRD(SchedulerCronJobDefinitionData(), opts...) +} + +func SchedulerCronJobDefinitionWithOptions(opts ...func(*CRDOptions)) Definition { + return Definition{ + DefinitionData: SchedulerCronJobDefinitionData(), + CRD: SchedulerCronJobWithOptions(opts...), + } +} + +func SchedulerCronJobDefinitionData() DefinitionData { + return DefinitionData{ + definition: schedulerCronJob, + schemaDefinition: schedulerCronJobSchemaRaw, + } +} + +//go:embed scheduler-cronjob.yaml +var schedulerCronJob []byte + +//go:embed scheduler-cronjob.schema.generated.yaml +var schedulerCronJobSchemaRaw []byte diff --git a/pkg/crd/crds/scheduler-cronjob.schema.generated.yaml b/pkg/crd/crds/scheduler-cronjob.schema.generated.yaml new file mode 100644 index 000000000..a37961c59 --- /dev/null +++ b/pkg/crd/crds/scheduler-cronjob.schema.generated.yaml @@ -0,0 +1,3084 @@ +v1beta1: + openAPIV3Schema: + properties: + spec: + properties: + concurrencyPolicy: + type: string + failedJobsHistoryLimit: + format: int32 + type: integer + jobTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + backoffLimit: + format: int32 + type: integer + backoffLimitPerIndex: + format: int32 + type: integer + completionMode: + type: string + completions: + format: int32 + type: integer + manualSelector: + type: boolean + maxFailedIndexes: + format: int32 + type: integer + parallelism: + format: int32 + type: integer + podFailurePolicy: + properties: + rules: + items: + properties: + action: + type: string + onExitCodes: + properties: + containerName: + type: string + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + type: object + onPodConditions: + items: + properties: + status: + type: string + type: + type: string + type: object + type: array + type: object + type: array + type: object + podReplacementPolicy: + type: string + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + suspend: + type: boolean + template: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + type: object + automountServiceAccountToken: + type: boolean + containers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + dnsConfig: + properties: + nameservers: + items: + type: string + type: array + options: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + searches: + items: + type: string + type: array + type: object + dnsPolicy: + type: string + enableServiceLinks: + type: boolean + ephemeralContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + targetContainerName: + type: string + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + hostAliases: + items: + properties: + hostnames: + items: + type: string + type: array + ip: + type: string + type: object + type: array + hostIPC: + type: boolean + hostNetwork: + type: boolean + hostPID: + type: boolean + hostUsers: + type: boolean + hostname: + type: string + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + initContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + os: + properties: + name: + type: string + type: object + overhead: + additionalProperties: + type: string + type: object + preemptionPolicy: + type: string + priority: + format: int32 + type: integer + priorityClassName: + type: string + readinessGates: + items: + properties: + conditionType: + type: string + type: object + type: array + resourceClaims: + items: + properties: + name: + type: string + source: + properties: + resourceClaimName: + type: string + resourceClaimTemplateName: + type: string + type: object + type: object + type: array + restartPolicy: + type: string + runtimeClassName: + type: string + schedulerName: + type: string + schedulingGates: + items: + properties: + name: + type: string + type: object + type: array + securityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccount: + type: string + serviceAccountName: + type: string + setHostnameAsFQDN: + type: boolean + shareProcessNamespace: + type: boolean + subdomain: + type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + type: object + type: array + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeID: + type: string + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + type: string + type: object + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + type: string + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + type: object + hostPath: + properties: + path: + type: string + type: + type: string + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + targetPortal: + type: string + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + type: object + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + type: object + type: object + type: array + type: object + type: object + ttlSecondsAfterFinished: + format: int32 + type: integer + type: object + type: object + profiles: + items: + type: string + type: array + schedule: + type: string + startingDeadlineSeconds: + format: int64 + type: integer + successfulJobsHistoryLimit: + format: int32 + type: integer + suspend: + type: boolean + timeZone: + type: string + type: object + status: + description: Object with preserved fields for backward compatibility + type: object + x-kubernetes-preserve-unknown-fields: true + type: object diff --git a/pkg/crd/crds/scheduler-cronjob.yaml b/pkg/crd/crds/scheduler-cronjob.yaml new file mode 100644 index 000000000..7c6b02d9b --- /dev/null +++ b/pkg/crd/crds/scheduler-cronjob.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/pkg/crd/crds/scheduler-deployment.go b/pkg/crd/crds/scheduler-deployment.go new file mode 100644 index 000000000..4e0557372 --- /dev/null +++ b/pkg/crd/crds/scheduler-deployment.go @@ -0,0 +1,51 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package crds + +import ( + _ "embed" + + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +func SchedulerDeploymentWithOptions(opts ...func(*CRDOptions)) *apiextensions.CustomResourceDefinition { + return getCRD(SchedulerDeploymentDefinitionData(), opts...) +} + +func SchedulerDeploymentDefinitionWithOptions(opts ...func(*CRDOptions)) Definition { + return Definition{ + DefinitionData: SchedulerDeploymentDefinitionData(), + CRD: SchedulerDeploymentWithOptions(opts...), + } +} + +func SchedulerDeploymentDefinitionData() DefinitionData { + return DefinitionData{ + definition: schedulerDeployment, + schemaDefinition: schedulerDeploymentSchemaRaw, + } +} + +//go:embed scheduler-deployment.yaml +var schedulerDeployment []byte + +//go:embed scheduler-deployment.schema.generated.yaml +var schedulerDeploymentSchemaRaw []byte diff --git a/pkg/crd/crds/scheduler-deployment.schema.generated.yaml b/pkg/crd/crds/scheduler-deployment.schema.generated.yaml new file mode 100644 index 000000000..7956b594d --- /dev/null +++ b/pkg/crd/crds/scheduler-deployment.schema.generated.yaml @@ -0,0 +1,2953 @@ +v1beta1: + openAPIV3Schema: + properties: + spec: + properties: + minReadySeconds: + format: int32 + type: integer + paused: + type: boolean + profiles: + items: + type: string + type: array + progressDeadlineSeconds: + format: int32 + type: integer + replicas: + format: int32 + type: integer + revisionHistoryLimit: + format: int32 + type: integer + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + strategy: + properties: + rollingUpdate: + properties: + maxSurge: + type: string + x-kubernetes-int-or-string: true + maxUnavailable: + type: string + x-kubernetes-int-or-string: true + type: object + type: + type: string + type: object + template: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + type: object + automountServiceAccountToken: + type: boolean + containers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + dnsConfig: + properties: + nameservers: + items: + type: string + type: array + options: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + searches: + items: + type: string + type: array + type: object + dnsPolicy: + type: string + enableServiceLinks: + type: boolean + ephemeralContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + targetContainerName: + type: string + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + hostAliases: + items: + properties: + hostnames: + items: + type: string + type: array + ip: + type: string + type: object + type: array + hostIPC: + type: boolean + hostNetwork: + type: boolean + hostPID: + type: boolean + hostUsers: + type: boolean + hostname: + type: string + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + initContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + os: + properties: + name: + type: string + type: object + overhead: + additionalProperties: + type: string + type: object + preemptionPolicy: + type: string + priority: + format: int32 + type: integer + priorityClassName: + type: string + readinessGates: + items: + properties: + conditionType: + type: string + type: object + type: array + resourceClaims: + items: + properties: + name: + type: string + source: + properties: + resourceClaimName: + type: string + resourceClaimTemplateName: + type: string + type: object + type: object + type: array + restartPolicy: + type: string + runtimeClassName: + type: string + schedulerName: + type: string + schedulingGates: + items: + properties: + name: + type: string + type: object + type: array + securityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccount: + type: string + serviceAccountName: + type: string + setHostnameAsFQDN: + type: boolean + shareProcessNamespace: + type: boolean + subdomain: + type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + type: object + type: array + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeID: + type: string + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + type: string + type: object + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + type: string + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + type: object + hostPath: + properties: + path: + type: string + type: + type: string + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + targetPortal: + type: string + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + type: object + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + type: object + type: object + type: array + type: object + type: object + type: object + status: + description: Object with preserved fields for backward compatibility + type: object + x-kubernetes-preserve-unknown-fields: true + type: object diff --git a/pkg/crd/crds/scheduler-deployment.yaml b/pkg/crd/crds/scheduler-deployment.yaml new file mode 100644 index 000000000..0178e1c89 --- /dev/null +++ b/pkg/crd/crds/scheduler-deployment.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/pkg/crd/crds/scheduler-pod.go b/pkg/crd/crds/scheduler-pod.go new file mode 100644 index 000000000..2052e705c --- /dev/null +++ b/pkg/crd/crds/scheduler-pod.go @@ -0,0 +1,51 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package crds + +import ( + _ "embed" + + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +func SchedulerPodWithOptions(opts ...func(*CRDOptions)) *apiextensions.CustomResourceDefinition { + return getCRD(SchedulerPodDefinitionData(), opts...) +} + +func SchedulerPodDefinitionWithOptions(opts ...func(*CRDOptions)) Definition { + return Definition{ + DefinitionData: SchedulerPodDefinitionData(), + CRD: SchedulerPodWithOptions(opts...), + } +} + +func SchedulerPodDefinitionData() DefinitionData { + return DefinitionData{ + definition: schedulerPod, + schemaDefinition: schedulerPodSchemaRaw, + } +} + +//go:embed scheduler-pod.yaml +var schedulerPod []byte + +//go:embed scheduler-pod.schema.generated.yaml +var schedulerPodSchemaRaw []byte diff --git a/pkg/crd/crds/scheduler-pod.schema.generated.yaml b/pkg/crd/crds/scheduler-pod.schema.generated.yaml new file mode 100644 index 000000000..d38077167 --- /dev/null +++ b/pkg/crd/crds/scheduler-pod.schema.generated.yaml @@ -0,0 +1,2823 @@ +v1beta1: + openAPIV3Schema: + properties: + spec: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + type: object + type: array + type: object + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + weight: + format: int32 + type: integer + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + mismatchLabelKeys: + items: + type: string + type: array + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + namespaces: + items: + type: string + type: array + topologyKey: + type: string + type: object + type: array + type: object + type: object + automountServiceAccountToken: + type: boolean + containers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + dnsConfig: + properties: + nameservers: + items: + type: string + type: array + options: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + searches: + items: + type: string + type: array + type: object + dnsPolicy: + type: string + enableServiceLinks: + type: boolean + ephemeralContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + targetContainerName: + type: string + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + hostAliases: + items: + properties: + hostnames: + items: + type: string + type: array + ip: + type: string + type: object + type: array + hostIPC: + type: boolean + hostNetwork: + type: boolean + hostPID: + type: boolean + hostUsers: + type: boolean + hostname: + type: string + imagePullSecrets: + items: + properties: + name: + type: string + type: object + type: array + initContainers: + items: + properties: + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + type: object + type: object + type: object + type: array + envFrom: + items: + properties: + configMapRef: + properties: + name: + type: string + optional: + type: boolean + type: object + prefix: + type: string + secretRef: + properties: + name: + type: string + optional: + type: boolean + type: object + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + type: object + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + type: object + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + type: string + type: object + type: array + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + type: object + type: array + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + capabilities: + properties: + add: + items: + type: string + type: array + drop: + items: + type: string + type: array + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + port: + format: int32 + type: integer + service: + type: string + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + path: + type: string + port: + type: string + x-kubernetes-int-or-string: true + scheme: + type: string + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + type: string + x-kubernetes-int-or-string: true + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + type: object + type: array + volumeMounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + type: object + type: array + workingDir: + type: string + type: object + type: array + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + os: + properties: + name: + type: string + type: object + overhead: + additionalProperties: + type: string + type: object + preemptionPolicy: + type: string + priority: + format: int32 + type: integer + priorityClassName: + type: string + profiles: + items: + type: string + type: array + readinessGates: + items: + properties: + conditionType: + type: string + type: object + type: array + resourceClaims: + items: + properties: + name: + type: string + source: + properties: + resourceClaimName: + type: string + resourceClaimTemplateName: + type: string + type: object + type: object + type: array + restartPolicy: + type: string + runtimeClassName: + type: string + schedulerName: + type: string + schedulingGates: + items: + properties: + name: + type: string + type: object + type: array + securityContext: + properties: + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + sysctls: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccount: + type: string + serviceAccountName: + type: string + setHostnameAsFQDN: + type: boolean + shareProcessNamespace: + type: boolean + subdomain: + type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + type: object + type: array + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeID: + type: string + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + type: string + type: object + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + type: string + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + deletionGracePeriodSeconds: + format: int64 + type: integer + deletionTimestamp: + format: date-time + type: string + finalizers: + items: + type: string + type: array + generateName: + type: string + generation: + format: int64 + type: integer + labels: + additionalProperties: + type: string + type: object + managedFields: + items: + properties: + apiVersion: + type: string + fieldsType: + type: string + fieldsV1: + type: object + manager: + type: string + operation: + type: string + subresource: + type: string + time: + format: date-time + type: string + type: object + type: array + name: + type: string + namespace: + type: string + ownerReferences: + items: + properties: + apiVersion: + type: string + blockOwnerDeletion: + type: boolean + controller: + type: boolean + kind: + type: string + name: + type: string + uid: + type: string + type: object + type: array + resourceVersion: + type: string + selfLink: + type: string + uid: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + type: object + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + type: object + resources: + properties: + limits: + additionalProperties: + type: string + type: object + requests: + additionalProperties: + type: string + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + type: object + hostPath: + properties: + path: + type: string + type: + type: string + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + targetPortal: + type: string + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + type: object + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + type: string + resource: + type: string + type: object + type: object + type: array + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + type: object + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + user: + type: string + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + type: string + type: object + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + type: object + type: object + type: array + type: object + status: + description: Object with preserved fields for backward compatibility + type: object + x-kubernetes-preserve-unknown-fields: true + type: object diff --git a/pkg/crd/crds/scheduler-pod.yaml b/pkg/crd/crds/scheduler-pod.yaml new file mode 100644 index 000000000..97ab5f973 --- /dev/null +++ b/pkg/crd/crds/scheduler-pod.yaml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/pkg/crd/scheduling.go b/pkg/crd/scheduling.go new file mode 100644 index 000000000..37ae6d5c4 --- /dev/null +++ b/pkg/crd/scheduling.go @@ -0,0 +1,58 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package crd + +import ( + "github.com/arangodb/kube-arangodb/pkg/crd/crds" +) + +func init() { + registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition { + return crds.SchedulerProfileDefinitionWithOptions(opts.AsFunc()) + }, &crds.CRDOptions{ + WithSchema: true, + WithPreserve: false, + }) + registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition { + return crds.SchedulerPodDefinitionWithOptions(opts.AsFunc()) + }, &crds.CRDOptions{ + WithSchema: true, + WithPreserve: false, + }) + registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition { + return crds.SchedulerDeploymentDefinitionWithOptions(opts.AsFunc()) + }, &crds.CRDOptions{ + WithSchema: true, + WithPreserve: false, + }) + registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition { + return crds.SchedulerBatchJobDefinitionWithOptions(opts.AsFunc()) + }, &crds.CRDOptions{ + WithSchema: true, + WithPreserve: false, + }) + registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition { + return crds.SchedulerCronJobDefinitionWithOptions(opts.AsFunc()) + }, &crds.CRDOptions{ + WithSchema: true, + WithPreserve: false, + }) +} diff --git a/pkg/debug_package/generators/kubernetes/lister.go b/pkg/debug_package/generators/kubernetes/lister.go index e4c486733..bbde1f949 100644 --- a/pkg/debug_package/generators/kubernetes/lister.go +++ b/pkg/debug_package/generators/kubernetes/lister.go @@ -22,82 +22,15 @@ package kubernetes import ( "context" - "sort" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" ) -func Extract[T1, T2 any](in List[T1], ex func(in T1) T2) List[T2] { - r := make(List[T2], len(in)) - - for id := range r { - r[id] = ex(in[id]) - } - - return r -} - -type List[T any] []T - -func (l List[T]) Sort(pred func(a, b T) bool) List[T] { - sort.Slice(l, func(i, j int) bool { - return pred(l[i], l[j]) - }) - - return l -} - -func (l List[T]) Append(obj ...T) List[T] { - r := make(List[T], 0, len(l)+len(obj)) - - r = append(r, l...) - r = append(r, obj...) - - return r -} - -func (l List[T]) Filter(f func(a T) bool) List[T] { - r := make(List[T], 0, len(l)) - - for _, o := range l { - if !f(o) { - continue - } - - r = append(r, o) - } - - return r -} - -func (l List[T]) Contains(f func(a T) bool) bool { - for _, o := range l { - if f(o) { - return true - } - } - - return false -} - -func (l List[T]) Unique(f func(existing List[T], a T) bool) List[T] { - r := make(List[T], 0, len(l)) - - for _, o := range l { - if f(r, o) { - continue - } - - r = append(r, o) - } - - return r -} - type ObjectList[T meta.Object] map[types.UID]T func (d ObjectList[T]) ByName(name string) (T, bool) { @@ -110,7 +43,7 @@ func (d ObjectList[T]) ByName(name string) (T, bool) { return util.Default[T](), false } -func (d ObjectList[T]) AsList() List[T] { +func (d ObjectList[T]) AsList() util.List[T] { list := make([]T, 0, len(d)) for _, p := range d { list = append(list, p) @@ -119,7 +52,7 @@ func (d ObjectList[T]) AsList() List[T] { return list } -func MapObjects[L k8sutil.ListContinue, T meta.Object](ctx context.Context, k k8sutil.ListAPI[L], extract func(result L) []T) (ObjectList[T], error) { +func MapObjects[L generic.ListContinue, T meta.Object](ctx context.Context, k generic.ListInterface[L], extract func(result L) []T) (ObjectList[T], error) { objects := ObjectList[T]{} if err := k8sutil.APIList[L](ctx, k, meta.ListOptions{}, func(result L, err error) error { @@ -140,7 +73,7 @@ func MapObjects[L k8sutil.ListContinue, T meta.Object](ctx context.Context, k k8 return objects, nil } -func ListObjects[L k8sutil.ListContinue, T meta.Object](ctx context.Context, k k8sutil.ListAPI[L], extract func(result L) []T) ([]T, error) { +func ListObjects[L generic.ListContinue, T meta.Object](ctx context.Context, k generic.ListInterface[L], extract func(result L) []T) ([]T, error) { objects, err := MapObjects[L, T](ctx, k, extract) if err != nil { return nil, err diff --git a/pkg/deployment/images.go b/pkg/deployment/images.go index 21caa5a80..0a06c5f6f 100644 --- a/pkg/deployment/images.go +++ b/pkg/deployment/images.go @@ -153,7 +153,7 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, cac defer cancel() pod, err := ib.Context.ACS().CurrentClusterCache().Pod().V1().Read().Get(ctxChild, podName, meta.GetOptions{}) if err == nil { - // Pod found + // ArangoSchedulerPod found if k8sutil.IsPodFailed(pod, utils.StringList{shared.ServerContainerName}) { // Wait some time before deleting the pod if time.Now().After(pod.GetCreationTimestamp().Add(30 * time.Second)) { @@ -161,14 +161,14 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, cac return ib.Context.ACS().CurrentClusterCache().PodsModInterface().V1().Delete(ctxChild, podName, meta.DeleteOptions{}) }) if err != nil && !kerrors.IsNotFound(err) { - log.Err(err).Warn("Failed to delete Image ID Pod") + log.Err(err).Warn("Failed to delete Image ID ArangoSchedulerPod") return false, nil } } return false, nil } if !k8sutil.IsPodReady(pod) { - log.Debug("Image ID Pod is not yet ready") + log.Debug("Image ID ArangoSchedulerPod is not yet ready") return true, nil } @@ -181,14 +181,14 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, cac // Try fetching the ArangoDB version client, err := arangod.CreateArangodImageIDClient(ctx, ib.APIObject, pod.Status.PodIP, false) if err != nil { - log.Err(err).Warn("Failed to create Image ID Pod client") + log.Err(err).Warn("Failed to create Image ID ArangoSchedulerPod client") return true, nil } ctxChild, cancel = globals.GetGlobalTimeouts().ArangoD().WithTimeout(ctx) defer cancel() v, err := client.Version(ctxChild) if err != nil { - log.Err(err).Debug("Failed to fetch version from Image ID Pod") + log.Err(err).Debug("Failed to fetch version from Image ID ArangoSchedulerPod") return true, nil } version := v.Version @@ -199,7 +199,7 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, cac return ib.Context.ACS().CurrentClusterCache().PodsModInterface().V1().Delete(ctxChild, podName, meta.DeleteOptions{}) }) if err != nil && !kerrors.IsNotFound(err) { - log.Err(err).Warn("Failed to delete Image ID Pod") + log.Err(err).Warn("Failed to delete Image ID ArangoSchedulerPod") return true, nil } diff --git a/pkg/deployment/resources/arango_profiles.go b/pkg/deployment/resources/arango_profiles.go index 99bab20e8..cfa12fdc0 100644 --- a/pkg/deployment/resources/arango_profiles.go +++ b/pkg/deployment/resources/arango_profiles.go @@ -25,6 +25,7 @@ import ( "fmt" "time" + "k8s.io/apimachinery/pkg/api/equality" meta "k8s.io/apimachinery/pkg/apis/meta/v1" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" @@ -33,8 +34,11 @@ import ( "github.com/arangodb/kube-arangodb/pkg/integrations/sidecar" "github.com/arangodb/kube-arangodb/pkg/metrics" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" ) @@ -43,11 +47,22 @@ var ( inspectArangoProfilesDurationGauges = metrics.MustRegisterGaugeVec(metricsComponent, "inspect_arango_profiles_duration", "Amount of time taken by a single inspection of all ArangoProfiles for a deployment (in sec)", metrics.DeploymentName) ) +func matchArangoProfilesLabels(labels map[string]string) *schedulerApi.ProfileSelectors { + if labels == nil { + return nil + } + + return &schedulerApi.ProfileSelectors{ + Label: &meta.LabelSelector{ + MatchLabels: labels, + }, + } +} + // EnsureArangoProfiles creates all ArangoProfiles needed to run the given deployment func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspectorInterface.Inspector) error { start := time.Now() spec := r.context.GetSpec() - arangoProfiles := cachedStatus.ArangoProfileModInterface().V1Beta1() apiObject := r.context.GetAPIObject() deploymentName := apiObject.GetName() @@ -56,74 +71,167 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe reconcileRequired := k8sutil.NewReconcile(cachedStatus) - intName := fmt.Sprintf("%s-int", deploymentName) + gen := func(name, version string, integrations ...sidecar.Integration) func() (string, *schedulerApi.ArangoProfile, error) { + return func() (string, *schedulerApi.ArangoProfile, error) { + counterMetric.Inc() + fullName := fmt.Sprintf("%s-int-%s-%s", deploymentName, name, version) - integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ - Image: util.NewType(r.context.GetOperatorImage()), - }, spec.Integration.GetSidecar()) - if err != nil { - return err - } + integration, err := sidecar.NewIntegrationEnablement(integrations...) + if err != nil { + return "", nil, err + } - integrationChecksum, err := integration.Checksum() - if err != nil { - return err + return fullName, &schedulerApi.ArangoProfile{ + ObjectMeta: meta.ObjectMeta{ + Name: fullName, + Namespace: apiObject.GetNamespace(), + OwnerReferences: []meta.OwnerReference{ + apiObject.AsOwner(), + }, + }, + Spec: schedulerApi.ProfileSpec{ + Selectors: matchArangoProfilesLabels(map[string]string{ + constants.ProfilesDeployment: deploymentName, + fmt.Sprintf("%s/%s", constants.ProfilesIntegrationPrefix, name): version, + }), + Template: integration, + }, + }, nil + } } - if c, err := cachedStatus.ArangoProfile().V1Beta1(); err == nil { - counterMetric.Inc() - if s, ok := c.GetSimple(intName); !ok { - s = &schedulerApi.ArangoProfile{ + if changed, err := r.ensureArangoProfilesFactory(ctx, cachedStatus, + func() (string, *schedulerApi.ArangoProfile, error) { + counterMetric.Inc() + name := fmt.Sprintf("%s-int", deploymentName) + + integration, err := sidecar.NewIntegration(&schedulerContainerResourcesApi.Image{ + Image: util.NewType(r.context.GetOperatorImage()), + }, spec.Integration.GetSidecar()) + if err != nil { + return "", nil, err + } + + return name, &schedulerApi.ArangoProfile{ ObjectMeta: meta.ObjectMeta{ - Name: intName, + Name: name, Namespace: apiObject.GetNamespace(), OwnerReferences: []meta.OwnerReference{ apiObject.AsOwner(), }, }, Spec: schedulerApi.ProfileSpec{ + Selectors: matchArangoProfilesLabels(map[string]string{ + constants.ProfilesDeployment: deploymentName, + }), Template: integration, }, + }, nil + }, + gen("authz", "v0", sidecar.IntegrationAuthorizationV0{}), + gen("authn", "v1", sidecar.IntegrationAuthenticationV1{Spec: spec, DeploymentName: apiObject.GetName()}), + ); err != nil { + return err + } else if changed { + reconcileRequired.Required() + } + + return reconcileRequired.Reconcile(ctx) +} + +func (r *Resources) ensureArangoProfilesFactory(ctx context.Context, cachedStatus inspectorInterface.Inspector, expected ...func() (string, *schedulerApi.ArangoProfile, error)) (bool, error) { + var changed bool + + for _, e := range expected { + name, profile, err := e() + if err != nil { + return false, err + } + if c, err := r.ensureArangoProfile(ctx, cachedStatus, name, profile); err != nil { + return false, err + } else if c { + changed = true + } + } + + return changed, nil +} + +func (r *Resources) ensureArangoProfile(ctx context.Context, cachedStatus inspectorInterface.Inspector, name string, expected *schedulerApi.ArangoProfile) (bool, error) { + arangoProfiles := cachedStatus.ArangoProfileModInterface().V1Beta1() + + if expected.GetName() != name { + return false, errors.Errorf("Name mismatch") + } + + if c, err := cachedStatus.ArangoProfile().V1Beta1(); err == nil { + if s, ok := c.GetSimple(name); !ok { + if expected != nil { + if _, err := arangoProfiles.Create(ctx, expected, meta.CreateOptions{}); err != nil { + return false, err + } + + return true, nil } + } else { + if expected == nil { + if err := arangoProfiles.Delete(ctx, s.GetName(), meta.DeleteOptions{}); err != nil { + if !kerrors.IsNotFound(err) { + return false, err + } + } - if _, err := cachedStatus.ArangoProfileModInterface().V1Beta1().Create(ctx, s, meta.CreateOptions{}); err != nil { - return err + return true, nil + } + expectedChecksum, err := expected.Spec.Template.Checksum() + if err != nil { + return false, err } - reconcileRequired.Required() - } else { currChecksum, err := s.Spec.Template.Checksum() if err != nil { - return err + return false, err } - if s.Spec.Selectors != nil { + if expected.Spec.Selectors == nil && s.Spec.Selectors != nil { + // Remove if _, changed, err := patcher.Patcher[*schedulerApi.ArangoProfile](ctx, arangoProfiles, s, meta.PatchOptions{}, func(in *schedulerApi.ArangoProfile) []patch.Item { return []patch.Item{ patch.ItemRemove(patch.NewPath("spec", "selectors")), } }); err != nil { - return err + return false, err + } else if changed { + return true, nil + } + } else if !equality.Semantic.DeepEqual(expected.Spec.Selectors, s.Spec.Selectors) { + if _, changed, err := patcher.Patcher[*schedulerApi.ArangoProfile](ctx, arangoProfiles, s, meta.PatchOptions{}, + func(in *schedulerApi.ArangoProfile) []patch.Item { + return []patch.Item{ + patch.ItemReplace(patch.NewPath("spec", "selectors"), expected.Spec.Selectors), + } + }); err != nil { + return false, err } else if changed { - reconcileRequired.Required() + return true, nil } } - if currChecksum != integrationChecksum { + if currChecksum != expectedChecksum { if _, changed, err := patcher.Patcher[*schedulerApi.ArangoProfile](ctx, arangoProfiles, s, meta.PatchOptions{}, func(in *schedulerApi.ArangoProfile) []patch.Item { return []patch.Item{ - patch.ItemReplace(patch.NewPath("spec", "template"), integration), + patch.ItemReplace(patch.NewPath("spec", "template"), util.TypeOrDefault(expected.Spec.Template)), } }); err != nil { - return err + return false, err } else if changed { - reconcileRequired.Required() + return true, nil } } } } - return reconcileRequired.Reconcile(ctx) + return false, nil } diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerbatchjob.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerbatchjob.go new file mode 100644 index 000000000..cb6e72dca --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerbatchjob.go @@ -0,0 +1,199 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + scheme "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ArangoSchedulerBatchJobsGetter has a method to return a ArangoSchedulerBatchJobInterface. +// A group's client should implement this interface. +type ArangoSchedulerBatchJobsGetter interface { + ArangoSchedulerBatchJobs(namespace string) ArangoSchedulerBatchJobInterface +} + +// ArangoSchedulerBatchJobInterface has methods to work with ArangoSchedulerBatchJob resources. +type ArangoSchedulerBatchJobInterface interface { + Create(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.CreateOptions) (*v1beta1.ArangoSchedulerBatchJob, error) + Update(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerBatchJob, error) + UpdateStatus(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerBatchJob, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ArangoSchedulerBatchJob, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ArangoSchedulerBatchJobList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerBatchJob, err error) + ArangoSchedulerBatchJobExpansion +} + +// arangoSchedulerBatchJobs implements ArangoSchedulerBatchJobInterface +type arangoSchedulerBatchJobs struct { + client rest.Interface + ns string +} + +// newArangoSchedulerBatchJobs returns a ArangoSchedulerBatchJobs +func newArangoSchedulerBatchJobs(c *SchedulerV1beta1Client, namespace string) *arangoSchedulerBatchJobs { + return &arangoSchedulerBatchJobs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the arangoSchedulerBatchJob, and returns the corresponding arangoSchedulerBatchJob object, and an error if there is any. +func (c *arangoSchedulerBatchJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + result = &v1beta1.ArangoSchedulerBatchJob{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerBatchJobs that match those selectors. +func (c *arangoSchedulerBatchJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerBatchJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ArangoSchedulerBatchJobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerBatchJobs. +func (c *arangoSchedulerBatchJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a arangoSchedulerBatchJob and creates it. Returns the server's representation of the arangoSchedulerBatchJob, and an error, if there is any. +func (c *arangoSchedulerBatchJobs) Create(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + result = &v1beta1.ArangoSchedulerBatchJob{} + err = c.client.Post(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerBatchJob). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a arangoSchedulerBatchJob and updates it. Returns the server's representation of the arangoSchedulerBatchJob, and an error, if there is any. +func (c *arangoSchedulerBatchJobs) Update(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + result = &v1beta1.ArangoSchedulerBatchJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + Name(arangoSchedulerBatchJob.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerBatchJob). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *arangoSchedulerBatchJobs) UpdateStatus(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + result = &v1beta1.ArangoSchedulerBatchJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + Name(arangoSchedulerBatchJob.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerBatchJob). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the arangoSchedulerBatchJob and deletes it. Returns an error if one occurs. +func (c *arangoSchedulerBatchJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *arangoSchedulerBatchJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched arangoSchedulerBatchJob. +func (c *arangoSchedulerBatchJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + result = &v1beta1.ArangoSchedulerBatchJob{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("arangoschedulerbatchjobs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulercronjob.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulercronjob.go new file mode 100644 index 000000000..e0a06dc30 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulercronjob.go @@ -0,0 +1,199 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + scheme "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ArangoSchedulerCronJobsGetter has a method to return a ArangoSchedulerCronJobInterface. +// A group's client should implement this interface. +type ArangoSchedulerCronJobsGetter interface { + ArangoSchedulerCronJobs(namespace string) ArangoSchedulerCronJobInterface +} + +// ArangoSchedulerCronJobInterface has methods to work with ArangoSchedulerCronJob resources. +type ArangoSchedulerCronJobInterface interface { + Create(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.CreateOptions) (*v1beta1.ArangoSchedulerCronJob, error) + Update(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerCronJob, error) + UpdateStatus(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerCronJob, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ArangoSchedulerCronJob, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ArangoSchedulerCronJobList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerCronJob, err error) + ArangoSchedulerCronJobExpansion +} + +// arangoSchedulerCronJobs implements ArangoSchedulerCronJobInterface +type arangoSchedulerCronJobs struct { + client rest.Interface + ns string +} + +// newArangoSchedulerCronJobs returns a ArangoSchedulerCronJobs +func newArangoSchedulerCronJobs(c *SchedulerV1beta1Client, namespace string) *arangoSchedulerCronJobs { + return &arangoSchedulerCronJobs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the arangoSchedulerCronJob, and returns the corresponding arangoSchedulerCronJob object, and an error if there is any. +func (c *arangoSchedulerCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerCronJob, err error) { + result = &v1beta1.ArangoSchedulerCronJob{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerCronJobs that match those selectors. +func (c *arangoSchedulerCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerCronJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ArangoSchedulerCronJobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerCronJobs. +func (c *arangoSchedulerCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a arangoSchedulerCronJob and creates it. Returns the server's representation of the arangoSchedulerCronJob, and an error, if there is any. +func (c *arangoSchedulerCronJobs) Create(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerCronJob, err error) { + result = &v1beta1.ArangoSchedulerCronJob{} + err = c.client.Post(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerCronJob). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a arangoSchedulerCronJob and updates it. Returns the server's representation of the arangoSchedulerCronJob, and an error, if there is any. +func (c *arangoSchedulerCronJobs) Update(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerCronJob, err error) { + result = &v1beta1.ArangoSchedulerCronJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + Name(arangoSchedulerCronJob.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerCronJob). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *arangoSchedulerCronJobs) UpdateStatus(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerCronJob, err error) { + result = &v1beta1.ArangoSchedulerCronJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + Name(arangoSchedulerCronJob.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerCronJob). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the arangoSchedulerCronJob and deletes it. Returns an error if one occurs. +func (c *arangoSchedulerCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *arangoSchedulerCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched arangoSchedulerCronJob. +func (c *arangoSchedulerCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerCronJob, err error) { + result = &v1beta1.ArangoSchedulerCronJob{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("arangoschedulercronjobs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerdeployment.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerdeployment.go new file mode 100644 index 000000000..e2f9cb6af --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerdeployment.go @@ -0,0 +1,199 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + scheme "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ArangoSchedulerDeploymentsGetter has a method to return a ArangoSchedulerDeploymentInterface. +// A group's client should implement this interface. +type ArangoSchedulerDeploymentsGetter interface { + ArangoSchedulerDeployments(namespace string) ArangoSchedulerDeploymentInterface +} + +// ArangoSchedulerDeploymentInterface has methods to work with ArangoSchedulerDeployment resources. +type ArangoSchedulerDeploymentInterface interface { + Create(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.CreateOptions) (*v1beta1.ArangoSchedulerDeployment, error) + Update(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerDeployment, error) + UpdateStatus(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerDeployment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ArangoSchedulerDeployment, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ArangoSchedulerDeploymentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerDeployment, err error) + ArangoSchedulerDeploymentExpansion +} + +// arangoSchedulerDeployments implements ArangoSchedulerDeploymentInterface +type arangoSchedulerDeployments struct { + client rest.Interface + ns string +} + +// newArangoSchedulerDeployments returns a ArangoSchedulerDeployments +func newArangoSchedulerDeployments(c *SchedulerV1beta1Client, namespace string) *arangoSchedulerDeployments { + return &arangoSchedulerDeployments{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the arangoSchedulerDeployment, and returns the corresponding arangoSchedulerDeployment object, and an error if there is any. +func (c *arangoSchedulerDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerDeployment, err error) { + result = &v1beta1.ArangoSchedulerDeployment{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerDeployments that match those selectors. +func (c *arangoSchedulerDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerDeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ArangoSchedulerDeploymentList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerDeployments. +func (c *arangoSchedulerDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a arangoSchedulerDeployment and creates it. Returns the server's representation of the arangoSchedulerDeployment, and an error, if there is any. +func (c *arangoSchedulerDeployments) Create(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerDeployment, err error) { + result = &v1beta1.ArangoSchedulerDeployment{} + err = c.client.Post(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerDeployment). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a arangoSchedulerDeployment and updates it. Returns the server's representation of the arangoSchedulerDeployment, and an error, if there is any. +func (c *arangoSchedulerDeployments) Update(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerDeployment, err error) { + result = &v1beta1.ArangoSchedulerDeployment{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + Name(arangoSchedulerDeployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerDeployment). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *arangoSchedulerDeployments) UpdateStatus(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerDeployment, err error) { + result = &v1beta1.ArangoSchedulerDeployment{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + Name(arangoSchedulerDeployment.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerDeployment). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the arangoSchedulerDeployment and deletes it. Returns an error if one occurs. +func (c *arangoSchedulerDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *arangoSchedulerDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched arangoSchedulerDeployment. +func (c *arangoSchedulerDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerDeployment, err error) { + result = &v1beta1.ArangoSchedulerDeployment{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("arangoschedulerdeployments"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerpod.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerpod.go new file mode 100644 index 000000000..55703b9db --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/arangoschedulerpod.go @@ -0,0 +1,199 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + scheme "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ArangoSchedulerPodsGetter has a method to return a ArangoSchedulerPodInterface. +// A group's client should implement this interface. +type ArangoSchedulerPodsGetter interface { + ArangoSchedulerPods(namespace string) ArangoSchedulerPodInterface +} + +// ArangoSchedulerPodInterface has methods to work with ArangoSchedulerPod resources. +type ArangoSchedulerPodInterface interface { + Create(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.CreateOptions) (*v1beta1.ArangoSchedulerPod, error) + Update(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerPod, error) + UpdateStatus(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerPod, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ArangoSchedulerPod, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ArangoSchedulerPodList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerPod, err error) + ArangoSchedulerPodExpansion +} + +// arangoSchedulerPods implements ArangoSchedulerPodInterface +type arangoSchedulerPods struct { + client rest.Interface + ns string +} + +// newArangoSchedulerPods returns a ArangoSchedulerPods +func newArangoSchedulerPods(c *SchedulerV1beta1Client, namespace string) *arangoSchedulerPods { + return &arangoSchedulerPods{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the arangoSchedulerPod, and returns the corresponding arangoSchedulerPod object, and an error if there is any. +func (c *arangoSchedulerPods) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerPod, err error) { + result = &v1beta1.ArangoSchedulerPod{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerPods that match those selectors. +func (c *arangoSchedulerPods) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerPodList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ArangoSchedulerPodList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerPods. +func (c *arangoSchedulerPods) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a arangoSchedulerPod and creates it. Returns the server's representation of the arangoSchedulerPod, and an error, if there is any. +func (c *arangoSchedulerPods) Create(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerPod, err error) { + result = &v1beta1.ArangoSchedulerPod{} + err = c.client.Post(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerPod). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a arangoSchedulerPod and updates it. Returns the server's representation of the arangoSchedulerPod, and an error, if there is any. +func (c *arangoSchedulerPods) Update(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerPod, err error) { + result = &v1beta1.ArangoSchedulerPod{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + Name(arangoSchedulerPod.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerPod). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *arangoSchedulerPods) UpdateStatus(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerPod, err error) { + result = &v1beta1.ArangoSchedulerPod{} + err = c.client.Put(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + Name(arangoSchedulerPod.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(arangoSchedulerPod). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the arangoSchedulerPod and deletes it. Returns an error if one occurs. +func (c *arangoSchedulerPods) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *arangoSchedulerPods) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("arangoschedulerpods"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched arangoSchedulerPod. +func (c *arangoSchedulerPods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerPod, err error) { + result = &v1beta1.ArangoSchedulerPod{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("arangoschedulerpods"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerbatchjob.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerbatchjob.go new file mode 100644 index 000000000..50830d6f3 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerbatchjob.go @@ -0,0 +1,145 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeArangoSchedulerBatchJobs implements ArangoSchedulerBatchJobInterface +type FakeArangoSchedulerBatchJobs struct { + Fake *FakeSchedulerV1beta1 + ns string +} + +var arangoschedulerbatchjobsResource = v1beta1.SchemeGroupVersion.WithResource("arangoschedulerbatchjobs") + +var arangoschedulerbatchjobsKind = v1beta1.SchemeGroupVersion.WithKind("ArangoSchedulerBatchJob") + +// Get takes name of the arangoSchedulerBatchJob, and returns the corresponding arangoSchedulerBatchJob object, and an error if there is any. +func (c *FakeArangoSchedulerBatchJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(arangoschedulerbatchjobsResource, c.ns, name), &v1beta1.ArangoSchedulerBatchJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerBatchJob), err +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerBatchJobs that match those selectors. +func (c *FakeArangoSchedulerBatchJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerBatchJobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(arangoschedulerbatchjobsResource, arangoschedulerbatchjobsKind, c.ns, opts), &v1beta1.ArangoSchedulerBatchJobList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ArangoSchedulerBatchJobList{ListMeta: obj.(*v1beta1.ArangoSchedulerBatchJobList).ListMeta} + for _, item := range obj.(*v1beta1.ArangoSchedulerBatchJobList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerBatchJobs. +func (c *FakeArangoSchedulerBatchJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(arangoschedulerbatchjobsResource, c.ns, opts)) + +} + +// Create takes the representation of a arangoSchedulerBatchJob and creates it. Returns the server's representation of the arangoSchedulerBatchJob, and an error, if there is any. +func (c *FakeArangoSchedulerBatchJobs) Create(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(arangoschedulerbatchjobsResource, c.ns, arangoSchedulerBatchJob), &v1beta1.ArangoSchedulerBatchJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerBatchJob), err +} + +// Update takes the representation of a arangoSchedulerBatchJob and updates it. Returns the server's representation of the arangoSchedulerBatchJob, and an error, if there is any. +func (c *FakeArangoSchedulerBatchJobs) Update(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(arangoschedulerbatchjobsResource, c.ns, arangoSchedulerBatchJob), &v1beta1.ArangoSchedulerBatchJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerBatchJob), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeArangoSchedulerBatchJobs) UpdateStatus(ctx context.Context, arangoSchedulerBatchJob *v1beta1.ArangoSchedulerBatchJob, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerBatchJob, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(arangoschedulerbatchjobsResource, "status", c.ns, arangoSchedulerBatchJob), &v1beta1.ArangoSchedulerBatchJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerBatchJob), err +} + +// Delete takes name of the arangoSchedulerBatchJob and deletes it. Returns an error if one occurs. +func (c *FakeArangoSchedulerBatchJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(arangoschedulerbatchjobsResource, c.ns, name, opts), &v1beta1.ArangoSchedulerBatchJob{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeArangoSchedulerBatchJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangoschedulerbatchjobsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ArangoSchedulerBatchJobList{}) + return err +} + +// Patch applies the patch and returns the patched arangoSchedulerBatchJob. +func (c *FakeArangoSchedulerBatchJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerBatchJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(arangoschedulerbatchjobsResource, c.ns, name, pt, data, subresources...), &v1beta1.ArangoSchedulerBatchJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerBatchJob), err +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulercronjob.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulercronjob.go new file mode 100644 index 000000000..d3866c951 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulercronjob.go @@ -0,0 +1,145 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeArangoSchedulerCronJobs implements ArangoSchedulerCronJobInterface +type FakeArangoSchedulerCronJobs struct { + Fake *FakeSchedulerV1beta1 + ns string +} + +var arangoschedulercronjobsResource = v1beta1.SchemeGroupVersion.WithResource("arangoschedulercronjobs") + +var arangoschedulercronjobsKind = v1beta1.SchemeGroupVersion.WithKind("ArangoSchedulerCronJob") + +// Get takes name of the arangoSchedulerCronJob, and returns the corresponding arangoSchedulerCronJob object, and an error if there is any. +func (c *FakeArangoSchedulerCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(arangoschedulercronjobsResource, c.ns, name), &v1beta1.ArangoSchedulerCronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerCronJob), err +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerCronJobs that match those selectors. +func (c *FakeArangoSchedulerCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerCronJobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(arangoschedulercronjobsResource, arangoschedulercronjobsKind, c.ns, opts), &v1beta1.ArangoSchedulerCronJobList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ArangoSchedulerCronJobList{ListMeta: obj.(*v1beta1.ArangoSchedulerCronJobList).ListMeta} + for _, item := range obj.(*v1beta1.ArangoSchedulerCronJobList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerCronJobs. +func (c *FakeArangoSchedulerCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(arangoschedulercronjobsResource, c.ns, opts)) + +} + +// Create takes the representation of a arangoSchedulerCronJob and creates it. Returns the server's representation of the arangoSchedulerCronJob, and an error, if there is any. +func (c *FakeArangoSchedulerCronJobs) Create(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(arangoschedulercronjobsResource, c.ns, arangoSchedulerCronJob), &v1beta1.ArangoSchedulerCronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerCronJob), err +} + +// Update takes the representation of a arangoSchedulerCronJob and updates it. Returns the server's representation of the arangoSchedulerCronJob, and an error, if there is any. +func (c *FakeArangoSchedulerCronJobs) Update(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(arangoschedulercronjobsResource, c.ns, arangoSchedulerCronJob), &v1beta1.ArangoSchedulerCronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerCronJob), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeArangoSchedulerCronJobs) UpdateStatus(ctx context.Context, arangoSchedulerCronJob *v1beta1.ArangoSchedulerCronJob, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerCronJob, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(arangoschedulercronjobsResource, "status", c.ns, arangoSchedulerCronJob), &v1beta1.ArangoSchedulerCronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerCronJob), err +} + +// Delete takes name of the arangoSchedulerCronJob and deletes it. Returns an error if one occurs. +func (c *FakeArangoSchedulerCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(arangoschedulercronjobsResource, c.ns, name, opts), &v1beta1.ArangoSchedulerCronJob{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeArangoSchedulerCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangoschedulercronjobsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ArangoSchedulerCronJobList{}) + return err +} + +// Patch applies the patch and returns the patched arangoSchedulerCronJob. +func (c *FakeArangoSchedulerCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerCronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(arangoschedulercronjobsResource, c.ns, name, pt, data, subresources...), &v1beta1.ArangoSchedulerCronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerCronJob), err +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerdeployment.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerdeployment.go new file mode 100644 index 000000000..e8c0ba6ab --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerdeployment.go @@ -0,0 +1,145 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeArangoSchedulerDeployments implements ArangoSchedulerDeploymentInterface +type FakeArangoSchedulerDeployments struct { + Fake *FakeSchedulerV1beta1 + ns string +} + +var arangoschedulerdeploymentsResource = v1beta1.SchemeGroupVersion.WithResource("arangoschedulerdeployments") + +var arangoschedulerdeploymentsKind = v1beta1.SchemeGroupVersion.WithKind("ArangoSchedulerDeployment") + +// Get takes name of the arangoSchedulerDeployment, and returns the corresponding arangoSchedulerDeployment object, and an error if there is any. +func (c *FakeArangoSchedulerDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(arangoschedulerdeploymentsResource, c.ns, name), &v1beta1.ArangoSchedulerDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerDeployment), err +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerDeployments that match those selectors. +func (c *FakeArangoSchedulerDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerDeploymentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(arangoschedulerdeploymentsResource, arangoschedulerdeploymentsKind, c.ns, opts), &v1beta1.ArangoSchedulerDeploymentList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ArangoSchedulerDeploymentList{ListMeta: obj.(*v1beta1.ArangoSchedulerDeploymentList).ListMeta} + for _, item := range obj.(*v1beta1.ArangoSchedulerDeploymentList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerDeployments. +func (c *FakeArangoSchedulerDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(arangoschedulerdeploymentsResource, c.ns, opts)) + +} + +// Create takes the representation of a arangoSchedulerDeployment and creates it. Returns the server's representation of the arangoSchedulerDeployment, and an error, if there is any. +func (c *FakeArangoSchedulerDeployments) Create(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(arangoschedulerdeploymentsResource, c.ns, arangoSchedulerDeployment), &v1beta1.ArangoSchedulerDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerDeployment), err +} + +// Update takes the representation of a arangoSchedulerDeployment and updates it. Returns the server's representation of the arangoSchedulerDeployment, and an error, if there is any. +func (c *FakeArangoSchedulerDeployments) Update(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(arangoschedulerdeploymentsResource, c.ns, arangoSchedulerDeployment), &v1beta1.ArangoSchedulerDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerDeployment), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeArangoSchedulerDeployments) UpdateStatus(ctx context.Context, arangoSchedulerDeployment *v1beta1.ArangoSchedulerDeployment, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerDeployment, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(arangoschedulerdeploymentsResource, "status", c.ns, arangoSchedulerDeployment), &v1beta1.ArangoSchedulerDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerDeployment), err +} + +// Delete takes name of the arangoSchedulerDeployment and deletes it. Returns an error if one occurs. +func (c *FakeArangoSchedulerDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(arangoschedulerdeploymentsResource, c.ns, name, opts), &v1beta1.ArangoSchedulerDeployment{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeArangoSchedulerDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangoschedulerdeploymentsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ArangoSchedulerDeploymentList{}) + return err +} + +// Patch applies the patch and returns the patched arangoSchedulerDeployment. +func (c *FakeArangoSchedulerDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(arangoschedulerdeploymentsResource, c.ns, name, pt, data, subresources...), &v1beta1.ArangoSchedulerDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerDeployment), err +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerpod.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerpod.go new file mode 100644 index 000000000..b9edcc57d --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_arangoschedulerpod.go @@ -0,0 +1,145 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeArangoSchedulerPods implements ArangoSchedulerPodInterface +type FakeArangoSchedulerPods struct { + Fake *FakeSchedulerV1beta1 + ns string +} + +var arangoschedulerpodsResource = v1beta1.SchemeGroupVersion.WithResource("arangoschedulerpods") + +var arangoschedulerpodsKind = v1beta1.SchemeGroupVersion.WithKind("ArangoSchedulerPod") + +// Get takes name of the arangoSchedulerPod, and returns the corresponding arangoSchedulerPod object, and an error if there is any. +func (c *FakeArangoSchedulerPods) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ArangoSchedulerPod, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(arangoschedulerpodsResource, c.ns, name), &v1beta1.ArangoSchedulerPod{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerPod), err +} + +// List takes label and field selectors, and returns the list of ArangoSchedulerPods that match those selectors. +func (c *FakeArangoSchedulerPods) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ArangoSchedulerPodList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(arangoschedulerpodsResource, arangoschedulerpodsKind, c.ns, opts), &v1beta1.ArangoSchedulerPodList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ArangoSchedulerPodList{ListMeta: obj.(*v1beta1.ArangoSchedulerPodList).ListMeta} + for _, item := range obj.(*v1beta1.ArangoSchedulerPodList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested arangoSchedulerPods. +func (c *FakeArangoSchedulerPods) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(arangoschedulerpodsResource, c.ns, opts)) + +} + +// Create takes the representation of a arangoSchedulerPod and creates it. Returns the server's representation of the arangoSchedulerPod, and an error, if there is any. +func (c *FakeArangoSchedulerPods) Create(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.CreateOptions) (result *v1beta1.ArangoSchedulerPod, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(arangoschedulerpodsResource, c.ns, arangoSchedulerPod), &v1beta1.ArangoSchedulerPod{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerPod), err +} + +// Update takes the representation of a arangoSchedulerPod and updates it. Returns the server's representation of the arangoSchedulerPod, and an error, if there is any. +func (c *FakeArangoSchedulerPods) Update(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.UpdateOptions) (result *v1beta1.ArangoSchedulerPod, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(arangoschedulerpodsResource, c.ns, arangoSchedulerPod), &v1beta1.ArangoSchedulerPod{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerPod), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeArangoSchedulerPods) UpdateStatus(ctx context.Context, arangoSchedulerPod *v1beta1.ArangoSchedulerPod, opts v1.UpdateOptions) (*v1beta1.ArangoSchedulerPod, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(arangoschedulerpodsResource, "status", c.ns, arangoSchedulerPod), &v1beta1.ArangoSchedulerPod{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerPod), err +} + +// Delete takes name of the arangoSchedulerPod and deletes it. Returns an error if one occurs. +func (c *FakeArangoSchedulerPods) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(arangoschedulerpodsResource, c.ns, name, opts), &v1beta1.ArangoSchedulerPod{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeArangoSchedulerPods) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangoschedulerpodsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ArangoSchedulerPodList{}) + return err +} + +// Patch applies the patch and returns the patched arangoSchedulerPod. +func (c *FakeArangoSchedulerPods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ArangoSchedulerPod, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(arangoschedulerpodsResource, c.ns, name, pt, data, subresources...), &v1beta1.ArangoSchedulerPod{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ArangoSchedulerPod), err +} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_scheduler_client.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_scheduler_client.go index b00b03e6b..f6e278220 100644 --- a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_scheduler_client.go +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/fake/fake_scheduler_client.go @@ -36,6 +36,22 @@ func (c *FakeSchedulerV1beta1) ArangoProfiles(namespace string) v1beta1.ArangoPr return &FakeArangoProfiles{c, namespace} } +func (c *FakeSchedulerV1beta1) ArangoSchedulerBatchJobs(namespace string) v1beta1.ArangoSchedulerBatchJobInterface { + return &FakeArangoSchedulerBatchJobs{c, namespace} +} + +func (c *FakeSchedulerV1beta1) ArangoSchedulerCronJobs(namespace string) v1beta1.ArangoSchedulerCronJobInterface { + return &FakeArangoSchedulerCronJobs{c, namespace} +} + +func (c *FakeSchedulerV1beta1) ArangoSchedulerDeployments(namespace string) v1beta1.ArangoSchedulerDeploymentInterface { + return &FakeArangoSchedulerDeployments{c, namespace} +} + +func (c *FakeSchedulerV1beta1) ArangoSchedulerPods(namespace string) v1beta1.ArangoSchedulerPodInterface { + return &FakeArangoSchedulerPods{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeSchedulerV1beta1) RESTClient() rest.Interface { diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/generated_expansion.go index 5d703a84e..7ee5d874a 100644 --- a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/generated_expansion.go @@ -23,3 +23,11 @@ package v1beta1 type ArangoProfileExpansion interface{} + +type ArangoSchedulerBatchJobExpansion interface{} + +type ArangoSchedulerCronJobExpansion interface{} + +type ArangoSchedulerDeploymentExpansion interface{} + +type ArangoSchedulerPodExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/scheduler_client.go b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/scheduler_client.go index c2d911e0b..ada000f18 100644 --- a/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/scheduler_client.go +++ b/pkg/generated/clientset/versioned/typed/scheduler/v1beta1/scheduler_client.go @@ -33,6 +33,10 @@ import ( type SchedulerV1beta1Interface interface { RESTClient() rest.Interface ArangoProfilesGetter + ArangoSchedulerBatchJobsGetter + ArangoSchedulerCronJobsGetter + ArangoSchedulerDeploymentsGetter + ArangoSchedulerPodsGetter } // SchedulerV1beta1Client is used to interact with features provided by the scheduler.arangodb.com group. @@ -44,6 +48,22 @@ func (c *SchedulerV1beta1Client) ArangoProfiles(namespace string) ArangoProfileI return newArangoProfiles(c, namespace) } +func (c *SchedulerV1beta1Client) ArangoSchedulerBatchJobs(namespace string) ArangoSchedulerBatchJobInterface { + return newArangoSchedulerBatchJobs(c, namespace) +} + +func (c *SchedulerV1beta1Client) ArangoSchedulerCronJobs(namespace string) ArangoSchedulerCronJobInterface { + return newArangoSchedulerCronJobs(c, namespace) +} + +func (c *SchedulerV1beta1Client) ArangoSchedulerDeployments(namespace string) ArangoSchedulerDeploymentInterface { + return newArangoSchedulerDeployments(c, namespace) +} + +func (c *SchedulerV1beta1Client) ArangoSchedulerPods(namespace string) ArangoSchedulerPodInterface { + return newArangoSchedulerPods(c, namespace) +} + // NewForConfig creates a new SchedulerV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 00f3e40c3..1dabd1a59 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -137,6 +137,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=scheduler.arangodb.com, Version=v1beta1 case schedulerv1beta1.SchemeGroupVersion.WithResource("arangoprofiles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduler().V1beta1().ArangoProfiles().Informer()}, nil + case schedulerv1beta1.SchemeGroupVersion.WithResource("arangoschedulerbatchjobs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduler().V1beta1().ArangoSchedulerBatchJobs().Informer()}, nil + case schedulerv1beta1.SchemeGroupVersion.WithResource("arangoschedulercronjobs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduler().V1beta1().ArangoSchedulerCronJobs().Informer()}, nil + case schedulerv1beta1.SchemeGroupVersion.WithResource("arangoschedulerdeployments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduler().V1beta1().ArangoSchedulerDeployments().Informer()}, nil + case schedulerv1beta1.SchemeGroupVersion.WithResource("arangoschedulerpods"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduler().V1beta1().ArangoSchedulerPods().Informer()}, nil // Group=storage.arangodb.com, Version=v1alpha case v1alpha.SchemeGroupVersion.WithResource("arangolocalstorages"): diff --git a/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerbatchjob.go b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerbatchjob.go new file mode 100644 index 000000000..fc93eea7e --- /dev/null +++ b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerbatchjob.go @@ -0,0 +1,94 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + schedulerv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/listers/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerBatchJobInformer provides access to a shared informer and lister for +// ArangoSchedulerBatchJobs. +type ArangoSchedulerBatchJobInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.ArangoSchedulerBatchJobLister +} + +type arangoSchedulerBatchJobInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewArangoSchedulerBatchJobInformer constructs a new informer for ArangoSchedulerBatchJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewArangoSchedulerBatchJobInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerBatchJobInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredArangoSchedulerBatchJobInformer constructs a new informer for ArangoSchedulerBatchJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredArangoSchedulerBatchJobInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerBatchJobs(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerBatchJobs(namespace).Watch(context.TODO(), options) + }, + }, + &schedulerv1beta1.ArangoSchedulerBatchJob{}, + resyncPeriod, + indexers, + ) +} + +func (f *arangoSchedulerBatchJobInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerBatchJobInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *arangoSchedulerBatchJobInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&schedulerv1beta1.ArangoSchedulerBatchJob{}, f.defaultInformer) +} + +func (f *arangoSchedulerBatchJobInformer) Lister() v1beta1.ArangoSchedulerBatchJobLister { + return v1beta1.NewArangoSchedulerBatchJobLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulercronjob.go b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulercronjob.go new file mode 100644 index 000000000..59b27a269 --- /dev/null +++ b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulercronjob.go @@ -0,0 +1,94 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + schedulerv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/listers/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerCronJobInformer provides access to a shared informer and lister for +// ArangoSchedulerCronJobs. +type ArangoSchedulerCronJobInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.ArangoSchedulerCronJobLister +} + +type arangoSchedulerCronJobInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewArangoSchedulerCronJobInformer constructs a new informer for ArangoSchedulerCronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewArangoSchedulerCronJobInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerCronJobInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredArangoSchedulerCronJobInformer constructs a new informer for ArangoSchedulerCronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredArangoSchedulerCronJobInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerCronJobs(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerCronJobs(namespace).Watch(context.TODO(), options) + }, + }, + &schedulerv1beta1.ArangoSchedulerCronJob{}, + resyncPeriod, + indexers, + ) +} + +func (f *arangoSchedulerCronJobInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerCronJobInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *arangoSchedulerCronJobInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&schedulerv1beta1.ArangoSchedulerCronJob{}, f.defaultInformer) +} + +func (f *arangoSchedulerCronJobInformer) Lister() v1beta1.ArangoSchedulerCronJobLister { + return v1beta1.NewArangoSchedulerCronJobLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerdeployment.go b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerdeployment.go new file mode 100644 index 000000000..214fe6e08 --- /dev/null +++ b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerdeployment.go @@ -0,0 +1,94 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + schedulerv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/listers/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerDeploymentInformer provides access to a shared informer and lister for +// ArangoSchedulerDeployments. +type ArangoSchedulerDeploymentInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.ArangoSchedulerDeploymentLister +} + +type arangoSchedulerDeploymentInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewArangoSchedulerDeploymentInformer constructs a new informer for ArangoSchedulerDeployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewArangoSchedulerDeploymentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerDeploymentInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredArangoSchedulerDeploymentInformer constructs a new informer for ArangoSchedulerDeployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredArangoSchedulerDeploymentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerDeployments(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerDeployments(namespace).Watch(context.TODO(), options) + }, + }, + &schedulerv1beta1.ArangoSchedulerDeployment{}, + resyncPeriod, + indexers, + ) +} + +func (f *arangoSchedulerDeploymentInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *arangoSchedulerDeploymentInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&schedulerv1beta1.ArangoSchedulerDeployment{}, f.defaultInformer) +} + +func (f *arangoSchedulerDeploymentInformer) Lister() v1beta1.ArangoSchedulerDeploymentLister { + return v1beta1.NewArangoSchedulerDeploymentLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerpod.go b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerpod.go new file mode 100644 index 000000000..9c302b729 --- /dev/null +++ b/pkg/generated/informers/externalversions/scheduler/v1beta1/arangoschedulerpod.go @@ -0,0 +1,94 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + schedulerv1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/arangodb/kube-arangodb/pkg/generated/listers/scheduler/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerPodInformer provides access to a shared informer and lister for +// ArangoSchedulerPods. +type ArangoSchedulerPodInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.ArangoSchedulerPodLister +} + +type arangoSchedulerPodInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewArangoSchedulerPodInformer constructs a new informer for ArangoSchedulerPod type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewArangoSchedulerPodInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerPodInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredArangoSchedulerPodInformer constructs a new informer for ArangoSchedulerPod type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredArangoSchedulerPodInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerPods(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulerV1beta1().ArangoSchedulerPods(namespace).Watch(context.TODO(), options) + }, + }, + &schedulerv1beta1.ArangoSchedulerPod{}, + resyncPeriod, + indexers, + ) +} + +func (f *arangoSchedulerPodInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredArangoSchedulerPodInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *arangoSchedulerPodInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&schedulerv1beta1.ArangoSchedulerPod{}, f.defaultInformer) +} + +func (f *arangoSchedulerPodInformer) Lister() v1beta1.ArangoSchedulerPodLister { + return v1beta1.NewArangoSchedulerPodLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/scheduler/v1beta1/interface.go b/pkg/generated/informers/externalversions/scheduler/v1beta1/interface.go index 1f5e0f743..94009ca55 100644 --- a/pkg/generated/informers/externalversions/scheduler/v1beta1/interface.go +++ b/pkg/generated/informers/externalversions/scheduler/v1beta1/interface.go @@ -30,6 +30,14 @@ import ( type Interface interface { // ArangoProfiles returns a ArangoProfileInformer. ArangoProfiles() ArangoProfileInformer + // ArangoSchedulerBatchJobs returns a ArangoSchedulerBatchJobInformer. + ArangoSchedulerBatchJobs() ArangoSchedulerBatchJobInformer + // ArangoSchedulerCronJobs returns a ArangoSchedulerCronJobInformer. + ArangoSchedulerCronJobs() ArangoSchedulerCronJobInformer + // ArangoSchedulerDeployments returns a ArangoSchedulerDeploymentInformer. + ArangoSchedulerDeployments() ArangoSchedulerDeploymentInformer + // ArangoSchedulerPods returns a ArangoSchedulerPodInformer. + ArangoSchedulerPods() ArangoSchedulerPodInformer } type version struct { @@ -47,3 +55,23 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) ArangoProfiles() ArangoProfileInformer { return &arangoProfileInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// ArangoSchedulerBatchJobs returns a ArangoSchedulerBatchJobInformer. +func (v *version) ArangoSchedulerBatchJobs() ArangoSchedulerBatchJobInformer { + return &arangoSchedulerBatchJobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ArangoSchedulerCronJobs returns a ArangoSchedulerCronJobInformer. +func (v *version) ArangoSchedulerCronJobs() ArangoSchedulerCronJobInformer { + return &arangoSchedulerCronJobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ArangoSchedulerDeployments returns a ArangoSchedulerDeploymentInformer. +func (v *version) ArangoSchedulerDeployments() ArangoSchedulerDeploymentInformer { + return &arangoSchedulerDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ArangoSchedulerPods returns a ArangoSchedulerPodInformer. +func (v *version) ArangoSchedulerPods() ArangoSchedulerPodInformer { + return &arangoSchedulerPodInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/generated/listers/scheduler/v1beta1/arangoschedulerbatchjob.go b/pkg/generated/listers/scheduler/v1beta1/arangoschedulerbatchjob.go new file mode 100644 index 000000000..d2eb5f9a2 --- /dev/null +++ b/pkg/generated/listers/scheduler/v1beta1/arangoschedulerbatchjob.go @@ -0,0 +1,103 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerBatchJobLister helps list ArangoSchedulerBatchJobs. +// All objects returned here must be treated as read-only. +type ArangoSchedulerBatchJobLister interface { + // List lists all ArangoSchedulerBatchJobs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerBatchJob, err error) + // ArangoSchedulerBatchJobs returns an object that can list and get ArangoSchedulerBatchJobs. + ArangoSchedulerBatchJobs(namespace string) ArangoSchedulerBatchJobNamespaceLister + ArangoSchedulerBatchJobListerExpansion +} + +// arangoSchedulerBatchJobLister implements the ArangoSchedulerBatchJobLister interface. +type arangoSchedulerBatchJobLister struct { + indexer cache.Indexer +} + +// NewArangoSchedulerBatchJobLister returns a new ArangoSchedulerBatchJobLister. +func NewArangoSchedulerBatchJobLister(indexer cache.Indexer) ArangoSchedulerBatchJobLister { + return &arangoSchedulerBatchJobLister{indexer: indexer} +} + +// List lists all ArangoSchedulerBatchJobs in the indexer. +func (s *arangoSchedulerBatchJobLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerBatchJob, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerBatchJob)) + }) + return ret, err +} + +// ArangoSchedulerBatchJobs returns an object that can list and get ArangoSchedulerBatchJobs. +func (s *arangoSchedulerBatchJobLister) ArangoSchedulerBatchJobs(namespace string) ArangoSchedulerBatchJobNamespaceLister { + return arangoSchedulerBatchJobNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ArangoSchedulerBatchJobNamespaceLister helps list and get ArangoSchedulerBatchJobs. +// All objects returned here must be treated as read-only. +type ArangoSchedulerBatchJobNamespaceLister interface { + // List lists all ArangoSchedulerBatchJobs in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerBatchJob, err error) + // Get retrieves the ArangoSchedulerBatchJob from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.ArangoSchedulerBatchJob, error) + ArangoSchedulerBatchJobNamespaceListerExpansion +} + +// arangoSchedulerBatchJobNamespaceLister implements the ArangoSchedulerBatchJobNamespaceLister +// interface. +type arangoSchedulerBatchJobNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ArangoSchedulerBatchJobs in the indexer for a given namespace. +func (s arangoSchedulerBatchJobNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerBatchJob, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerBatchJob)) + }) + return ret, err +} + +// Get retrieves the ArangoSchedulerBatchJob from the indexer for a given namespace and name. +func (s arangoSchedulerBatchJobNamespaceLister) Get(name string) (*v1beta1.ArangoSchedulerBatchJob, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("arangoschedulerbatchjob"), name) + } + return obj.(*v1beta1.ArangoSchedulerBatchJob), nil +} diff --git a/pkg/generated/listers/scheduler/v1beta1/arangoschedulercronjob.go b/pkg/generated/listers/scheduler/v1beta1/arangoschedulercronjob.go new file mode 100644 index 000000000..cc4e86c97 --- /dev/null +++ b/pkg/generated/listers/scheduler/v1beta1/arangoschedulercronjob.go @@ -0,0 +1,103 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerCronJobLister helps list ArangoSchedulerCronJobs. +// All objects returned here must be treated as read-only. +type ArangoSchedulerCronJobLister interface { + // List lists all ArangoSchedulerCronJobs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerCronJob, err error) + // ArangoSchedulerCronJobs returns an object that can list and get ArangoSchedulerCronJobs. + ArangoSchedulerCronJobs(namespace string) ArangoSchedulerCronJobNamespaceLister + ArangoSchedulerCronJobListerExpansion +} + +// arangoSchedulerCronJobLister implements the ArangoSchedulerCronJobLister interface. +type arangoSchedulerCronJobLister struct { + indexer cache.Indexer +} + +// NewArangoSchedulerCronJobLister returns a new ArangoSchedulerCronJobLister. +func NewArangoSchedulerCronJobLister(indexer cache.Indexer) ArangoSchedulerCronJobLister { + return &arangoSchedulerCronJobLister{indexer: indexer} +} + +// List lists all ArangoSchedulerCronJobs in the indexer. +func (s *arangoSchedulerCronJobLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerCronJob, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerCronJob)) + }) + return ret, err +} + +// ArangoSchedulerCronJobs returns an object that can list and get ArangoSchedulerCronJobs. +func (s *arangoSchedulerCronJobLister) ArangoSchedulerCronJobs(namespace string) ArangoSchedulerCronJobNamespaceLister { + return arangoSchedulerCronJobNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ArangoSchedulerCronJobNamespaceLister helps list and get ArangoSchedulerCronJobs. +// All objects returned here must be treated as read-only. +type ArangoSchedulerCronJobNamespaceLister interface { + // List lists all ArangoSchedulerCronJobs in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerCronJob, err error) + // Get retrieves the ArangoSchedulerCronJob from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.ArangoSchedulerCronJob, error) + ArangoSchedulerCronJobNamespaceListerExpansion +} + +// arangoSchedulerCronJobNamespaceLister implements the ArangoSchedulerCronJobNamespaceLister +// interface. +type arangoSchedulerCronJobNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ArangoSchedulerCronJobs in the indexer for a given namespace. +func (s arangoSchedulerCronJobNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerCronJob, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerCronJob)) + }) + return ret, err +} + +// Get retrieves the ArangoSchedulerCronJob from the indexer for a given namespace and name. +func (s arangoSchedulerCronJobNamespaceLister) Get(name string) (*v1beta1.ArangoSchedulerCronJob, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("arangoschedulercronjob"), name) + } + return obj.(*v1beta1.ArangoSchedulerCronJob), nil +} diff --git a/pkg/generated/listers/scheduler/v1beta1/arangoschedulerdeployment.go b/pkg/generated/listers/scheduler/v1beta1/arangoschedulerdeployment.go new file mode 100644 index 000000000..227ad243d --- /dev/null +++ b/pkg/generated/listers/scheduler/v1beta1/arangoschedulerdeployment.go @@ -0,0 +1,103 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerDeploymentLister helps list ArangoSchedulerDeployments. +// All objects returned here must be treated as read-only. +type ArangoSchedulerDeploymentLister interface { + // List lists all ArangoSchedulerDeployments in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerDeployment, err error) + // ArangoSchedulerDeployments returns an object that can list and get ArangoSchedulerDeployments. + ArangoSchedulerDeployments(namespace string) ArangoSchedulerDeploymentNamespaceLister + ArangoSchedulerDeploymentListerExpansion +} + +// arangoSchedulerDeploymentLister implements the ArangoSchedulerDeploymentLister interface. +type arangoSchedulerDeploymentLister struct { + indexer cache.Indexer +} + +// NewArangoSchedulerDeploymentLister returns a new ArangoSchedulerDeploymentLister. +func NewArangoSchedulerDeploymentLister(indexer cache.Indexer) ArangoSchedulerDeploymentLister { + return &arangoSchedulerDeploymentLister{indexer: indexer} +} + +// List lists all ArangoSchedulerDeployments in the indexer. +func (s *arangoSchedulerDeploymentLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerDeployment, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerDeployment)) + }) + return ret, err +} + +// ArangoSchedulerDeployments returns an object that can list and get ArangoSchedulerDeployments. +func (s *arangoSchedulerDeploymentLister) ArangoSchedulerDeployments(namespace string) ArangoSchedulerDeploymentNamespaceLister { + return arangoSchedulerDeploymentNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ArangoSchedulerDeploymentNamespaceLister helps list and get ArangoSchedulerDeployments. +// All objects returned here must be treated as read-only. +type ArangoSchedulerDeploymentNamespaceLister interface { + // List lists all ArangoSchedulerDeployments in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerDeployment, err error) + // Get retrieves the ArangoSchedulerDeployment from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.ArangoSchedulerDeployment, error) + ArangoSchedulerDeploymentNamespaceListerExpansion +} + +// arangoSchedulerDeploymentNamespaceLister implements the ArangoSchedulerDeploymentNamespaceLister +// interface. +type arangoSchedulerDeploymentNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ArangoSchedulerDeployments in the indexer for a given namespace. +func (s arangoSchedulerDeploymentNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerDeployment, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerDeployment)) + }) + return ret, err +} + +// Get retrieves the ArangoSchedulerDeployment from the indexer for a given namespace and name. +func (s arangoSchedulerDeploymentNamespaceLister) Get(name string) (*v1beta1.ArangoSchedulerDeployment, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("arangoschedulerdeployment"), name) + } + return obj.(*v1beta1.ArangoSchedulerDeployment), nil +} diff --git a/pkg/generated/listers/scheduler/v1beta1/arangoschedulerpod.go b/pkg/generated/listers/scheduler/v1beta1/arangoschedulerpod.go new file mode 100644 index 000000000..40de6ef0f --- /dev/null +++ b/pkg/generated/listers/scheduler/v1beta1/arangoschedulerpod.go @@ -0,0 +1,103 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ArangoSchedulerPodLister helps list ArangoSchedulerPods. +// All objects returned here must be treated as read-only. +type ArangoSchedulerPodLister interface { + // List lists all ArangoSchedulerPods in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerPod, err error) + // ArangoSchedulerPods returns an object that can list and get ArangoSchedulerPods. + ArangoSchedulerPods(namespace string) ArangoSchedulerPodNamespaceLister + ArangoSchedulerPodListerExpansion +} + +// arangoSchedulerPodLister implements the ArangoSchedulerPodLister interface. +type arangoSchedulerPodLister struct { + indexer cache.Indexer +} + +// NewArangoSchedulerPodLister returns a new ArangoSchedulerPodLister. +func NewArangoSchedulerPodLister(indexer cache.Indexer) ArangoSchedulerPodLister { + return &arangoSchedulerPodLister{indexer: indexer} +} + +// List lists all ArangoSchedulerPods in the indexer. +func (s *arangoSchedulerPodLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerPod, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerPod)) + }) + return ret, err +} + +// ArangoSchedulerPods returns an object that can list and get ArangoSchedulerPods. +func (s *arangoSchedulerPodLister) ArangoSchedulerPods(namespace string) ArangoSchedulerPodNamespaceLister { + return arangoSchedulerPodNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ArangoSchedulerPodNamespaceLister helps list and get ArangoSchedulerPods. +// All objects returned here must be treated as read-only. +type ArangoSchedulerPodNamespaceLister interface { + // List lists all ArangoSchedulerPods in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerPod, err error) + // Get retrieves the ArangoSchedulerPod from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.ArangoSchedulerPod, error) + ArangoSchedulerPodNamespaceListerExpansion +} + +// arangoSchedulerPodNamespaceLister implements the ArangoSchedulerPodNamespaceLister +// interface. +type arangoSchedulerPodNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ArangoSchedulerPods in the indexer for a given namespace. +func (s arangoSchedulerPodNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ArangoSchedulerPod, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ArangoSchedulerPod)) + }) + return ret, err +} + +// Get retrieves the ArangoSchedulerPod from the indexer for a given namespace and name. +func (s arangoSchedulerPodNamespaceLister) Get(name string) (*v1beta1.ArangoSchedulerPod, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("arangoschedulerpod"), name) + } + return obj.(*v1beta1.ArangoSchedulerPod), nil +} diff --git a/pkg/generated/listers/scheduler/v1beta1/expansion_generated.go b/pkg/generated/listers/scheduler/v1beta1/expansion_generated.go index accfa66ce..5a7a420fc 100644 --- a/pkg/generated/listers/scheduler/v1beta1/expansion_generated.go +++ b/pkg/generated/listers/scheduler/v1beta1/expansion_generated.go @@ -29,3 +29,35 @@ type ArangoProfileListerExpansion interface{} // ArangoProfileNamespaceListerExpansion allows custom methods to be added to // ArangoProfileNamespaceLister. type ArangoProfileNamespaceListerExpansion interface{} + +// ArangoSchedulerBatchJobListerExpansion allows custom methods to be added to +// ArangoSchedulerBatchJobLister. +type ArangoSchedulerBatchJobListerExpansion interface{} + +// ArangoSchedulerBatchJobNamespaceListerExpansion allows custom methods to be added to +// ArangoSchedulerBatchJobNamespaceLister. +type ArangoSchedulerBatchJobNamespaceListerExpansion interface{} + +// ArangoSchedulerCronJobListerExpansion allows custom methods to be added to +// ArangoSchedulerCronJobLister. +type ArangoSchedulerCronJobListerExpansion interface{} + +// ArangoSchedulerCronJobNamespaceListerExpansion allows custom methods to be added to +// ArangoSchedulerCronJobNamespaceLister. +type ArangoSchedulerCronJobNamespaceListerExpansion interface{} + +// ArangoSchedulerDeploymentListerExpansion allows custom methods to be added to +// ArangoSchedulerDeploymentLister. +type ArangoSchedulerDeploymentListerExpansion interface{} + +// ArangoSchedulerDeploymentNamespaceListerExpansion allows custom methods to be added to +// ArangoSchedulerDeploymentNamespaceLister. +type ArangoSchedulerDeploymentNamespaceListerExpansion interface{} + +// ArangoSchedulerPodListerExpansion allows custom methods to be added to +// ArangoSchedulerPodLister. +type ArangoSchedulerPodListerExpansion interface{} + +// ArangoSchedulerPodNamespaceListerExpansion allows custom methods to be added to +// ArangoSchedulerPodNamespaceLister. +type ArangoSchedulerPodNamespaceListerExpansion interface{} diff --git a/pkg/handlers/generic/parent/parent.go b/pkg/handlers/generic/parent/parent.go new file mode 100644 index 000000000..cb72e56e3 --- /dev/null +++ b/pkg/handlers/generic/parent/parent.go @@ -0,0 +1,114 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package parent + +import ( + "context" + + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/logging" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" +) + +var logger = logging.Global().RegisterAndGetLogger("generic-parent-operator", logging.Info) + +type NotifyHandlerClientFactory[T meta.Object, C NotifyHandlerClient[T]] func(namespace string) C + +type NotifyHandlerClient[T meta.Object] interface { + generic.GetInterface[T] +} + +func NewNotifyHandler[T meta.Object, C NotifyHandlerClient[T]](name string, operator operator.Operator, client NotifyHandlerClientFactory[T, C], gvk schema.GroupVersionKind, notifiable ...schema.GroupVersionKind) operator.Handler { + return notifyHandler[T, C]{ + name: name, + client: client, + gvk: gvk, + operator: operator, + notifiable: notifiable, + } +} + +type notifyHandler[T meta.Object, C NotifyHandlerClient[T]] struct { + operator operator.Operator + name string + client NotifyHandlerClientFactory[T, C] + gvk schema.GroupVersionKind + notifiable []schema.GroupVersionKind +} + +func (p notifyHandler[T, C]) Name() string { + return p.name +} + +func (p notifyHandler[T, C]) Handle(ctx context.Context, item operation.Item) error { + logger := logger.WrapObj(item) + if item.Operation == operation.Update { + obj, err := p.client(item.Namespace).Get(ctx, item.Name, meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + logger.Debug("Not Found") + return nil + } + logger.Err(err).Warn("Unexpected Error") + return err + } + + for _, owner := range obj.GetOwnerReferences() { + if i, err := operation.NewItemFromGVKObject(item.Operation, schema.FromAPIVersionAndKind(owner.APIVersion, owner.Kind), obj); err == nil { + if p.isNotifiable(i) { + logger.Debug("Parent notified") + p.operator.EnqueueItem(i) + } else { + logger.Debug("Parent notify skipped") + } + } + } + } + + return nil +} + +func (p notifyHandler[T, C]) isNotifiable(i operation.Item) bool { + for _, g := range p.notifiable { + if version := g.Version; version != "" && version != i.Version { + continue + } + if kind := g.Kind; kind != "" && kind != i.Kind { + continue + } + if group := g.Group; group != "" && group != i.Group { + continue + } + + return true + } + + return false +} + +func (p notifyHandler[T, C]) CanBeHandled(item operation.Item) bool { + return item.GVK(p.gvk) +} diff --git a/pkg/handlers/scheduler/batchjob/handler.go b/pkg/handlers/scheduler/batchjob/handler.go new file mode 100644 index 000000000..57b1b42c1 --- /dev/null +++ b/pkg/handlers/scheduler/batchjob/handler.go @@ -0,0 +1,228 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package batchjob + +import ( + "context" + "fmt" + + batch "k8s.io/api/batch/v1" + "k8s.io/apimachinery/pkg/api/equality" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/logging" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/scheduler" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" +) + +var logger = logging.Global().RegisterAndGetLogger("scheduler-batchjob-operator", logging.Info) + +type handler struct { + client arangoClientSet.Interface + kubeClient kubernetes.Interface + + eventRecorder event.RecorderInstance + + operator operator.Operator +} + +func (h *handler) Name() string { + return Kind() +} + +func (h *handler) Handle(ctx context.Context, item operation.Item) error { + // Get Backup object. It also covers NotFound case + + object, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.client.SchedulerV1beta1().ArangoSchedulerBatchJobs(item.Namespace).Get, item.Name, meta.GetOptions{}) + if err != nil { + if apiErrors.IsNotFound(err) { + return nil + } + + return err + } + + status := object.Status.DeepCopy() + + changed, reconcileErr := operator.HandleP3WithStop(ctx, item, object, status, h.handle) + if reconcileErr != nil && !operator.IsReconcile(reconcileErr) { + logger.Err(reconcileErr).Warn("Fail for %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + return reconcileErr + } + + if !changed { + return reconcileErr + } + + logger.Debug("Updating %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + if _, err := operator.WithSchedulerBatchJobUpdateStatusInterfaceRetry(context.Background(), h.client.SchedulerV1beta1().ArangoSchedulerBatchJobs(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { + return err + } + + return reconcileErr +} + +func (h *handler) handle(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerBatchJob, status *schedulerApi.ArangoSchedulerBatchJobStatus) (bool, error) { + return operator.HandleP3(ctx, item, extension, status, h.HandleObject) +} + +func (h *handler) HandleObject(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerBatchJob, status *schedulerApi.ArangoSchedulerBatchJobStatus) (bool, error) { + calculatedProfiles, profilesChecksum, err := scheduler.Profiles(ctx, h.client.SchedulerV1beta1().ArangoProfiles(extension.GetNamespace()), extension.GetLabels(), extension.Spec.Profiles...) + if err != nil { + return false, err + } + + var batchJobTemplate batch.Job + batchJobTemplate.ObjectMeta = meta.ObjectMeta{ + Name: extension.ObjectMeta.Name, + Labels: extension.ObjectMeta.Labels, + Annotations: extension.ObjectMeta.Annotations, + } + + extension.Spec.JobSpec.DeepCopyInto(&batchJobTemplate.Spec) + + deploymentSpecHash, err := util.SHA256FromJSON(batchJobTemplate) + if err != nil { + return false, err + } + + hash := util.SHA256FromString(fmt.Sprintf("%s|%s", profilesChecksum, deploymentSpecHash)) + + if err := schedulerApi.ProfileTemplates(util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) *schedulerApi.ProfileTemplate { + return a.V.Template + })).RenderOnTemplate(&batchJobTemplate.Spec.Template); err != nil { + return false, err + } + + if status.Object == nil { + // Create + + obj := &batch.Job{} + obj.ObjectMeta = meta.ObjectMeta{ + Name: extension.ObjectMeta.Name, + Labels: extension.ObjectMeta.Labels, + Annotations: extension.ObjectMeta.Annotations, + } + batchJobTemplate.Spec.DeepCopyInto(&obj.Spec) + + obj.OwnerReferences = append(obj.OwnerReferences, extension.AsOwner()) + + newObj, err := h.kubeClient.BatchV1().Jobs(extension.GetNamespace()).Create(ctx, obj, meta.CreateOptions{}) + if err != nil { + h.eventRecorder.Warning(extension, "Create Failed", "Unable to create Job: %s", err.Error()) + return false, err + } + + h.eventRecorder.Normal(extension, "Created", "Job %s created", newObj.GetName()) + + status.Object = util.NewType(sharedApi.NewObjectWithChecksum(newObj, hash)) + return true, operator.Reconcile("Job Reference Changed") + } + + // Find existing + obj, err := h.kubeClient.BatchV1().Jobs(status.Object.GetNamespace(extension)).Get(ctx, status.Object.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + // Object removed + h.eventRecorder.Warning(extension, "Removed", "Job %s is gone", status.Object.GetName()) + status.Object = nil + return true, operator.Reconcile("Job Reference Removed") + } + return false, err + } + + profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }) + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.JobStatus, obj.Status) { + obj.Status.DeepCopyInto(&status.JobStatus) + return true, operator.Reconcile("Status Changed") + } + + if obj.GetDeletionTimestamp() != nil { + // Object is deleting, check later + return false, operator.Reconcile("Job Deleting") + } + + if !status.Object.Equals(obj) { + // Object changed or was recreated + h.eventRecorder.Warning(extension, "Removed", "Job %s reference is invalid", status.Object.GetName()) + if err := h.kubeClient.BatchV1().Jobs(status.Object.GetNamespace(extension)).Delete(ctx, status.Object.GetName(), meta.DeleteOptions{}); err != nil { + return false, err + } + + return false, operator.Reconcile("Job Deleted") + } + + // Object is equal, lets check if changed + if hash != status.Object.GetChecksum() { + // Checksum changed, lets apply changes + _, _, err := patcher.Patcher[*batch.Job](ctx, h.kubeClient.BatchV1().Jobs(status.Object.GetNamespace(extension)), obj, meta.PatchOptions{}, func(in *batch.Job) []patch.Item { + return []patch.Item{ + patch.ItemReplace(patch.NewPath("spec"), batchJobTemplate.Spec), + } + }, patcher.PatchMetadata(obj)) + if err != nil { + h.eventRecorder.Warning(extension, "Patch Failed", "Unable to patch Job: %s", err.Error()) + return false, err + } + h.eventRecorder.Normal(extension, "Updated", "Job %s patched", obj.GetName()) + status.Object.Checksum = util.NewType(hash) + return true, nil + } + + return false, nil +} + +func (h *handler) CanBeHandled(item operation.Item) bool { + return item.Group == Group() && + item.Version == Version() && + item.Kind == Kind() +} + +func (h *handler) init() {} diff --git a/pkg/handlers/scheduler/batchjob/handler_manage_test.go b/pkg/handlers/scheduler/batchjob/handler_manage_test.go new file mode 100644 index 000000000..ccd96c49c --- /dev/null +++ b/pkg/handlers/scheduler/batchjob/handler_manage_test.go @@ -0,0 +1,230 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package batchjob + +import ( + "testing" + + "github.com/stretchr/testify/require" + batch "k8s.io/api/batch/v1" + "k8s.io/apimachinery/pkg/types" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Create(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerBatchJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "c12919994bb3b13dfc1cd7903bd2020a4da93064d93b068171d1567a203c62c4", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Update(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerBatchJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "c12919994bb3b13dfc1cd7903bd2020a4da93064d93b068171d1567a203c62c4", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) { + obj.Spec.Completions = util.NewType[int32](2) + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "65257e9b53283da2bfc00caeca08eee9cfbc465a3032119cb95c113efdf62b25", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Recreate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerBatchJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "c12919994bb3b13dfc1cd7903bd2020a4da93064d93b068171d1567a203c62c4", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) { + obj.Status.Object.UID = util.NewType[types.UID]("TEST") + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "c12919994bb3b13dfc1cd7903bd2020a4da93064d93b068171d1567a203c62c4", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Parent(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerBatchJob](t, tests.FakeNamespace, "test", func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) {}) + batchJob := tests.NewMetaObject[*batch.Job](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &batchJob) + + require.Len(t, batchJob.OwnerReferences, 1) +} + +func Test_Handler_Propagate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerBatchJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) {}) + batchJob := tests.NewMetaObject[*batch.Job](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &batchJob) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "c12919994bb3b13dfc1cd7903bd2020a4da93064d93b068171d1567a203c62c4", extension.Status.Object.GetChecksum()) + require.Nil(t, batchJob.Spec.Completions) + require.EqualValues(t, 0, extension.Status.Active) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) { + obj.Spec.Completions = util.NewType[int32](2) + }) + tests.Apply(t, batchJob, func(t *testing.T, obj *batch.Job) { + obj.Status.Active = 1 + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension, &batchJob) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &batchJob) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "65257e9b53283da2bfc00caeca08eee9cfbc465a3032119cb95c113efdf62b25", extension.Status.Object.GetChecksum()) + require.NotNil(t, batchJob.Spec.Completions) + require.EqualValues(t, 2, *batchJob.Spec.Completions) + require.EqualValues(t, 1, extension.Status.Active) +} + +func Test_Handler_Profile(t *testing.T) { + handler := newFakeHandler() + + // Arrange + profile := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", tests.MarkArangoProfileAsReady) + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerBatchJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerBatchJob) { + obj.Spec.Profiles = []string{profile.GetName()} + }) + batchJob := tests.NewMetaObject[*batch.Job](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.EqualError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension)), "Profile with name `test` is missing") + + tests.CreateObjects(t, handler.kubeClient, handler.client, &profile) + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &batchJob) + require.NotNil(t, batchJob) + + require.Len(t, extension.Status.Profiles, 1) + require.Equal(t, profile.GetName(), extension.Status.Profiles[0]) +} diff --git a/pkg/handlers/scheduler/batchjob/handler_test.go b/pkg/handlers/scheduler/batchjob/handler_test.go new file mode 100644 index 000000000..e5ef5638e --- /dev/null +++ b/pkg/handlers/scheduler/batchjob/handler_test.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package batchjob + +import ( + "testing" + + "github.com/stretchr/testify/require" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_ObjectNotFound(t *testing.T) { + // Arrange + handler := newFakeHandler() + + i := newItem(operation.Add, "test", "test") + + actions := map[operation.Operation]bool{ + operation.Add: false, + operation.Update: false, + operation.Delete: false, + } + + // Act + for op, shouldFail := range actions { + t.Run(string(op), func(t *testing.T) { + err := tests.Handle(handler, i) + + // Assert + if shouldFail { + require.Error(t, err) + require.True(t, apiErrors.IsNotFound(err)) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/pkg/handlers/scheduler/batchjob/local.go b/pkg/handlers/scheduler/batchjob/local.go new file mode 100644 index 000000000..3f63dfa2f --- /dev/null +++ b/pkg/handlers/scheduler/batchjob/local.go @@ -0,0 +1,48 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package batchjob + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +func GVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: Group(), + Version: Version(), + Kind: Kind(), + } +} + +func Kind() string { + return scheduler.BatchJobResourceKind +} + +func Group() string { + return schedulerApi.SchemeGroupVersion.Group +} + +func Version() string { + return schedulerApi.SchemeGroupVersion.Version +} diff --git a/pkg/handlers/scheduler/batchjob/register.go b/pkg/handlers/scheduler/batchjob/register.go new file mode 100644 index 000000000..b5156a5c1 --- /dev/null +++ b/pkg/handlers/scheduler/batchjob/register.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package batchjob + +import ( + batch "k8s.io/api/batch/v1" + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" + "github.com/arangodb/kube-arangodb/pkg/handlers/generic/parent" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +// RegisterInformer into operator +func RegisterInformer(operator operator.Operator, recorder event.Recorder, client arangoClientSet.Interface, + kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) error { + + if err := operator.RegisterInformer(informer.Scheduler().V1beta1().ArangoSchedulerBatchJobs().Informer(), + Group(), + Version(), + Kind()); err != nil { + return err + } + + h := &handler{ + client: client, + kubeClient: kubeClient, + + eventRecorder: recorder.NewInstance(Group(), Version(), Kind()), + + operator: operator, + } + + h.init() + + if err := operator.RegisterHandler(h); err != nil { + return err + } + + { + batchJob := k8sutil.BatchV1JobGVK() + + if err := operator.RegisterInformer(kubeInformer.Batch().V1().Jobs().Informer(), + batchJob.Group, + batchJob.Version, + batchJob.Kind); err != nil { + return err + } + + batchJobHandler := parent.NewNotifyHandler[*batch.Job]("batch-job-v1-parent", operator, kubeClient.BatchV1().Jobs, batchJob, GVK()) + + if err := operator.RegisterHandler(batchJobHandler); err != nil { + return err + } + } + + return nil +} diff --git a/pkg/handlers/scheduler/batchjob/suite_test.go b/pkg/handlers/scheduler/batchjob/suite_test.go new file mode 100644 index 000000000..749aa5009 --- /dev/null +++ b/pkg/handlers/scheduler/batchjob/suite_test.go @@ -0,0 +1,61 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package batchjob + +import ( + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" +) + +func newFakeHandler() *handler { + f := fakeClientSet.NewSimpleClientset() + k := fake.NewSimpleClientset() + + h := &handler{ + client: f, + kubeClient: k, + eventRecorder: event.NewEventRecorder("mock", k).NewInstance(Group(), Version(), Kind()), + operator: operator.NewOperator("mock", "mock", "mock"), + } + + h.init() + + return h +} + +func newItem(o operation.Operation, namespace, name string) operation.Item { + return operation.Item{ + Group: schedulerApi.SchemeGroupVersion.Group, + Version: schedulerApi.SchemeGroupVersion.Version, + Kind: scheduler.BatchJobResourceKind, + + Operation: o, + + Namespace: namespace, + Name: name, + } +} diff --git a/pkg/handlers/scheduler/cronjob/handler.go b/pkg/handlers/scheduler/cronjob/handler.go new file mode 100644 index 000000000..9666bf9d7 --- /dev/null +++ b/pkg/handlers/scheduler/cronjob/handler.go @@ -0,0 +1,228 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package cronjob + +import ( + "context" + "fmt" + + batch "k8s.io/api/batch/v1" + "k8s.io/apimachinery/pkg/api/equality" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/logging" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/scheduler" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" +) + +var logger = logging.Global().RegisterAndGetLogger("scheduler-cronjob-operator", logging.Info) + +type handler struct { + client arangoClientSet.Interface + kubeClient kubernetes.Interface + + eventRecorder event.RecorderInstance + + operator operator.Operator +} + +func (h *handler) Name() string { + return Kind() +} + +func (h *handler) Handle(ctx context.Context, item operation.Item) error { + // Get Backup object. It also covers NotFound case + + object, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.client.SchedulerV1beta1().ArangoSchedulerCronJobs(item.Namespace).Get, item.Name, meta.GetOptions{}) + if err != nil { + if apiErrors.IsNotFound(err) { + return nil + } + + return err + } + + status := object.Status.DeepCopy() + + changed, reconcileErr := operator.HandleP3WithStop(ctx, item, object, status, h.handle) + if reconcileErr != nil && !operator.IsReconcile(reconcileErr) { + logger.Err(reconcileErr).Warn("Fail for %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + return reconcileErr + } + + if !changed { + return reconcileErr + } + + logger.Debug("Updating %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + if _, err := operator.WithSchedulerCronJobUpdateStatusInterfaceRetry(context.Background(), h.client.SchedulerV1beta1().ArangoSchedulerCronJobs(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { + return err + } + + return reconcileErr +} + +func (h *handler) handle(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerCronJob, status *schedulerApi.ArangoSchedulerCronJobStatus) (bool, error) { + return operator.HandleP3(ctx, item, extension, status, h.HandleObject) +} + +func (h *handler) HandleObject(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerCronJob, status *schedulerApi.ArangoSchedulerCronJobStatus) (bool, error) { + calculatedProfiles, profilesChecksum, err := scheduler.Profiles(ctx, h.client.SchedulerV1beta1().ArangoProfiles(extension.GetNamespace()), extension.GetLabels(), extension.Spec.Profiles...) + if err != nil { + return false, err + } + + var cronJobTemplate batch.CronJob + cronJobTemplate.ObjectMeta = meta.ObjectMeta{ + Name: extension.ObjectMeta.Name, + Labels: extension.ObjectMeta.Labels, + Annotations: extension.ObjectMeta.Annotations, + } + + extension.Spec.CronJobSpec.DeepCopyInto(&cronJobTemplate.Spec) + + deploymentSpecHash, err := util.SHA256FromJSON(cronJobTemplate) + if err != nil { + return false, err + } + + hash := util.SHA256FromString(fmt.Sprintf("%s|%s", profilesChecksum, deploymentSpecHash)) + + if err := schedulerApi.ProfileTemplates(util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) *schedulerApi.ProfileTemplate { + return a.V.Template + })).RenderOnTemplate(&cronJobTemplate.Spec.JobTemplate.Spec.Template); err != nil { + return false, err + } + + if status.Object == nil { + // Create + + obj := &batch.CronJob{} + obj.ObjectMeta = meta.ObjectMeta{ + Name: extension.ObjectMeta.Name, + Labels: extension.ObjectMeta.Labels, + Annotations: extension.ObjectMeta.Annotations, + } + cronJobTemplate.Spec.DeepCopyInto(&obj.Spec) + + obj.OwnerReferences = append(obj.OwnerReferences, extension.AsOwner()) + + newObj, err := h.kubeClient.BatchV1().CronJobs(extension.GetNamespace()).Create(ctx, obj, meta.CreateOptions{}) + if err != nil { + h.eventRecorder.Warning(extension, "Create Failed", "Unable to create CronJob: %s", err.Error()) + return false, err + } + + h.eventRecorder.Normal(extension, "Created", "CronJob %s created", newObj.GetName()) + + status.Object = util.NewType(sharedApi.NewObjectWithChecksum(newObj, hash)) + return true, operator.Reconcile("Job Reference Changed") + } + + // Find existing + obj, err := h.kubeClient.BatchV1().CronJobs(status.Object.GetNamespace(extension)).Get(ctx, status.Object.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + // Object removed + h.eventRecorder.Warning(extension, "Removed", "CronJob %s is gone", status.Object.GetName()) + status.Object = nil + return true, operator.Reconcile("CronJob Reference Removed") + } + return false, err + } + + profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }) + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.CronJobStatus, obj.Status) { + obj.Status.DeepCopyInto(&status.CronJobStatus) + return true, operator.Reconcile("Status Changed") + } + + if obj.GetDeletionTimestamp() != nil { + // Object is deleting, check later + return false, operator.Reconcile("Job Deleting") + } + + if !status.Object.Equals(obj) { + // Object changed or was recreated + h.eventRecorder.Warning(extension, "Removed", "CronJob %s reference is invalid", status.Object.GetName()) + if err := h.kubeClient.BatchV1().CronJobs(status.Object.GetNamespace(extension)).Delete(ctx, status.Object.GetName(), meta.DeleteOptions{}); err != nil { + return false, err + } + + return false, operator.Reconcile("CronJob Deleted") + } + + // Object is equal, lets check if changed + if hash != status.Object.GetChecksum() { + // Checksum changed, lets apply changes + _, _, err := patcher.Patcher[*batch.CronJob](ctx, h.kubeClient.BatchV1().CronJobs(status.Object.GetNamespace(extension)), obj, meta.PatchOptions{}, func(in *batch.CronJob) []patch.Item { + return []patch.Item{ + patch.ItemReplace(patch.NewPath("spec"), cronJobTemplate.Spec), + } + }, patcher.PatchMetadata(obj)) + if err != nil { + h.eventRecorder.Warning(extension, "Patch Failed", "Unable to patch CronJob: %s", err.Error()) + return false, err + } + h.eventRecorder.Normal(extension, "Updated", "CronJob %s patched", obj.GetName()) + status.Object.Checksum = util.NewType(hash) + return true, nil + } + + return false, nil +} + +func (h *handler) CanBeHandled(item operation.Item) bool { + return item.Group == Group() && + item.Version == Version() && + item.Kind == Kind() +} + +func (h *handler) init() {} diff --git a/pkg/handlers/scheduler/cronjob/handler_manage_test.go b/pkg/handlers/scheduler/cronjob/handler_manage_test.go new file mode 100644 index 000000000..811b03994 --- /dev/null +++ b/pkg/handlers/scheduler/cronjob/handler_manage_test.go @@ -0,0 +1,231 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package cronjob + +import ( + "testing" + + "github.com/stretchr/testify/require" + batch "k8s.io/api/batch/v1" + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Create(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerCronJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "2f9e4c718f8bf1f0880e64aa44c10142acb59ca88a4c08d89ab7daadc93b115e", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Update(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerCronJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "2f9e4c718f8bf1f0880e64aa44c10142acb59ca88a4c08d89ab7daadc93b115e", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) { + obj.Spec.StartingDeadlineSeconds = util.NewType[int64](2) + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "5411ac008bce56d38b0d0e36d8bbbbb904c02c01dc3e8052f4467d6f24f9c7b5", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Recreate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerCronJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "2f9e4c718f8bf1f0880e64aa44c10142acb59ca88a4c08d89ab7daadc93b115e", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) { + obj.Status.Object.UID = util.NewType[types.UID]("TEST") + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "2f9e4c718f8bf1f0880e64aa44c10142acb59ca88a4c08d89ab7daadc93b115e", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Parent(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerCronJob](t, tests.FakeNamespace, "test", func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) {}) + cronJob := tests.NewMetaObject[*batch.CronJob](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &cronJob) + + require.Len(t, cronJob.OwnerReferences, 1) +} + +func Test_Handler_Propagate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerCronJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) {}) + cronJob := tests.NewMetaObject[*batch.CronJob](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &cronJob) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "2f9e4c718f8bf1f0880e64aa44c10142acb59ca88a4c08d89ab7daadc93b115e", extension.Status.Object.GetChecksum()) + require.Nil(t, cronJob.Spec.StartingDeadlineSeconds) + require.Len(t, extension.Status.Active, 0) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) { + obj.Spec.StartingDeadlineSeconds = util.NewType[int64](2) + }) + tests.Apply(t, cronJob, func(t *testing.T, obj *batch.CronJob) { + obj.Status.Active = []core.ObjectReference{{}} + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension, &cronJob) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &cronJob) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "5411ac008bce56d38b0d0e36d8bbbbb904c02c01dc3e8052f4467d6f24f9c7b5", extension.Status.Object.GetChecksum()) + require.NotNil(t, cronJob.Spec.StartingDeadlineSeconds) + require.EqualValues(t, 2, *cronJob.Spec.StartingDeadlineSeconds) + require.Len(t, extension.Status.Active, 1) +} + +func Test_Handler_Profile(t *testing.T) { + handler := newFakeHandler() + + // Arrange + profile := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", tests.MarkArangoProfileAsReady) + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerCronJob](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerCronJob) { + obj.Spec.Profiles = []string{profile.GetName()} + }) + cronJob := tests.NewMetaObject[*batch.CronJob](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.EqualError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension)), "Profile with name `test` is missing") + + tests.CreateObjects(t, handler.kubeClient, handler.client, &profile) + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &cronJob) + require.NotNil(t, cronJob) + + require.Len(t, extension.Status.Profiles, 1) + require.Equal(t, profile.GetName(), extension.Status.Profiles[0]) +} diff --git a/pkg/handlers/scheduler/cronjob/handler_test.go b/pkg/handlers/scheduler/cronjob/handler_test.go new file mode 100644 index 000000000..5af91bf46 --- /dev/null +++ b/pkg/handlers/scheduler/cronjob/handler_test.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package cronjob + +import ( + "testing" + + "github.com/stretchr/testify/require" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_ObjectNotFound(t *testing.T) { + // Arrange + handler := newFakeHandler() + + i := newItem(operation.Add, "test", "test") + + actions := map[operation.Operation]bool{ + operation.Add: false, + operation.Update: false, + operation.Delete: false, + } + + // Act + for op, shouldFail := range actions { + t.Run(string(op), func(t *testing.T) { + err := tests.Handle(handler, i) + + // Assert + if shouldFail { + require.Error(t, err) + require.True(t, apiErrors.IsNotFound(err)) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/pkg/handlers/scheduler/cronjob/local.go b/pkg/handlers/scheduler/cronjob/local.go new file mode 100644 index 000000000..4f7bd9c44 --- /dev/null +++ b/pkg/handlers/scheduler/cronjob/local.go @@ -0,0 +1,48 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package cronjob + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +func GVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: Group(), + Version: Version(), + Kind: Kind(), + } +} + +func Kind() string { + return scheduler.CronJobResourceKind +} + +func Group() string { + return schedulerApi.SchemeGroupVersion.Group +} + +func Version() string { + return schedulerApi.SchemeGroupVersion.Version +} diff --git a/pkg/handlers/scheduler/cronjob/register.go b/pkg/handlers/scheduler/cronjob/register.go new file mode 100644 index 000000000..51a868486 --- /dev/null +++ b/pkg/handlers/scheduler/cronjob/register.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package cronjob + +import ( + batch "k8s.io/api/batch/v1" + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" + "github.com/arangodb/kube-arangodb/pkg/handlers/generic/parent" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +// RegisterInformer into operator +func RegisterInformer(operator operator.Operator, recorder event.Recorder, client arangoClientSet.Interface, + kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) error { + + if err := operator.RegisterInformer(informer.Scheduler().V1beta1().ArangoSchedulerCronJobs().Informer(), + Group(), + Version(), + Kind()); err != nil { + return err + } + + h := &handler{ + client: client, + kubeClient: kubeClient, + + eventRecorder: recorder.NewInstance(Group(), Version(), Kind()), + + operator: operator, + } + + h.init() + + if err := operator.RegisterHandler(h); err != nil { + return err + } + + { + cronJob := k8sutil.BatchV1CronJobGVK() + + if err := operator.RegisterInformer(kubeInformer.Batch().V1().CronJobs().Informer(), + cronJob.Group, + cronJob.Version, + cronJob.Kind); err != nil { + return err + } + + cronJobHandler := parent.NewNotifyHandler[*batch.CronJob]("batch-cronjob-v1-parent", operator, kubeClient.BatchV1().CronJobs, cronJob, GVK()) + + if err := operator.RegisterHandler(cronJobHandler); err != nil { + return err + } + } + + return nil +} diff --git a/pkg/handlers/scheduler/cronjob/suite_test.go b/pkg/handlers/scheduler/cronjob/suite_test.go new file mode 100644 index 000000000..5be3356c0 --- /dev/null +++ b/pkg/handlers/scheduler/cronjob/suite_test.go @@ -0,0 +1,61 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package cronjob + +import ( + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" +) + +func newFakeHandler() *handler { + f := fakeClientSet.NewSimpleClientset() + k := fake.NewSimpleClientset() + + h := &handler{ + client: f, + kubeClient: k, + eventRecorder: event.NewEventRecorder("mock", k).NewInstance(Group(), Version(), Kind()), + operator: operator.NewOperator("mock", "mock", "mock"), + } + + h.init() + + return h +} + +func newItem(o operation.Operation, namespace, name string) operation.Item { + return operation.Item{ + Group: schedulerApi.SchemeGroupVersion.Group, + Version: schedulerApi.SchemeGroupVersion.Version, + Kind: scheduler.CronJobResourceKind, + + Operation: o, + + Namespace: namespace, + Name: name, + } +} diff --git a/pkg/handlers/scheduler/deployment/handler.go b/pkg/handlers/scheduler/deployment/handler.go new file mode 100644 index 000000000..05828f1df --- /dev/null +++ b/pkg/handlers/scheduler/deployment/handler.go @@ -0,0 +1,229 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package deployment + +import ( + "context" + "fmt" + + apps "k8s.io/api/apps/v1" + "k8s.io/apimachinery/pkg/api/equality" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/logging" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/scheduler" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" +) + +var logger = logging.Global().RegisterAndGetLogger("scheduler-deployment-operator", logging.Info) + +type handler struct { + client arangoClientSet.Interface + kubeClient kubernetes.Interface + + eventRecorder event.RecorderInstance + + operator operator.Operator +} + +func (h *handler) Name() string { + return Kind() +} + +func (h *handler) Handle(ctx context.Context, item operation.Item) error { + // Get Backup object. It also covers NotFound case + + object, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.client.SchedulerV1beta1().ArangoSchedulerDeployments(item.Namespace).Get, item.Name, meta.GetOptions{}) + if err != nil { + if apiErrors.IsNotFound(err) { + return nil + } + + return err + } + + status := object.Status.DeepCopy() + + changed, reconcileErr := operator.HandleP3WithStop(ctx, item, object, status, h.handle) + if reconcileErr != nil && !operator.IsReconcile(reconcileErr) { + logger.Err(reconcileErr).Warn("Fail for %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + return reconcileErr + } + + if !changed { + return reconcileErr + } + + logger.Debug("Updating %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + if _, err := operator.WithSchedulerDeploymentUpdateStatusInterfaceRetry(context.Background(), h.client.SchedulerV1beta1().ArangoSchedulerDeployments(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { + return err + } + + return reconcileErr +} + +func (h *handler) handle(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerDeployment, status *schedulerApi.ArangoSchedulerDeploymentStatus) (bool, error) { + return operator.HandleP3(ctx, item, extension, status, h.HandleObject) +} + +func (h *handler) HandleObject(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerDeployment, status *schedulerApi.ArangoSchedulerDeploymentStatus) (bool, error) { + calculatedProfiles, profilesChecksum, err := scheduler.Profiles(ctx, h.client.SchedulerV1beta1().ArangoProfiles(extension.GetNamespace()), extension.GetLabels(), extension.Spec.Profiles...) + if err != nil { + return false, err + } + + var deploymentTemplate apps.Deployment + deploymentTemplate.ObjectMeta = meta.ObjectMeta{ + Name: extension.ObjectMeta.Name, + Labels: extension.ObjectMeta.Labels, + Annotations: extension.ObjectMeta.Annotations, + } + + extension.Spec.DeploymentSpec.DeepCopyInto(&deploymentTemplate.Spec) + + deploymentSpecHash, err := util.SHA256FromJSON(deploymentTemplate) + if err != nil { + return false, err + } + + hash := util.SHA256FromString(fmt.Sprintf("%s|%s", profilesChecksum, deploymentSpecHash)) + + if err := schedulerApi.ProfileTemplates(util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) *schedulerApi.ProfileTemplate { + return a.V.Template + })).RenderOnTemplate(&deploymentTemplate.Spec.Template); err != nil { + return false, err + } + + if status.Object == nil { + // Create + + obj := &apps.Deployment{} + obj.ObjectMeta = meta.ObjectMeta{ + Name: extension.ObjectMeta.Name, + Labels: extension.ObjectMeta.Labels, + Annotations: extension.ObjectMeta.Annotations, + } + extension.Spec.DeploymentSpec.DeepCopyInto(&obj.Spec) + extension.Spec.DeploymentSpec.Template.DeepCopyInto(&obj.Spec.Template) + + obj.OwnerReferences = append(obj.OwnerReferences, extension.AsOwner()) + + newObj, err := h.kubeClient.AppsV1().Deployments(extension.GetNamespace()).Create(ctx, obj, meta.CreateOptions{}) + if err != nil { + h.eventRecorder.Warning(extension, "Create Failed", "Unable to create Deployment: %s", err.Error()) + return false, err + } + + h.eventRecorder.Normal(extension, "Created", "Deployment %s created", newObj.GetName()) + + status.Object = util.NewType(sharedApi.NewObjectWithChecksum(newObj, hash)) + return true, operator.Reconcile("Job Reference Changed") + } + + // Find existing + obj, err := h.kubeClient.AppsV1().Deployments(status.Object.GetNamespace(extension)).Get(ctx, status.Object.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + // Object removed + h.eventRecorder.Warning(extension, "Removed", "Deployment %s is gone", status.Object.GetName()) + status.Object = nil + return true, operator.Reconcile("Deployment Reference Removed") + } + return false, err + } + + profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }) + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.DeploymentStatus, obj.Status) { + obj.Status.DeepCopyInto(&status.DeploymentStatus) + return true, operator.Reconcile("Status Changed") + } + + if obj.GetDeletionTimestamp() != nil { + // Object is deleting, check later + return false, operator.Reconcile("Deployment Deleting") + } + + if !status.Object.Equals(obj) { + // Object changed or was recreated + h.eventRecorder.Warning(extension, "Removed", "Deployment %s reference is invalid", status.Object.GetName()) + if err := h.kubeClient.AppsV1().Deployments(status.Object.GetNamespace(extension)).Delete(ctx, status.Object.GetName(), meta.DeleteOptions{}); err != nil { + return false, err + } + + return false, operator.Reconcile("Deployment Deleted") + } + + // Object is equal, lets check if changed + if hash != status.Object.GetChecksum() { + // Checksum changed, lets apply changes + _, _, err := patcher.Patcher[*apps.Deployment](ctx, h.kubeClient.AppsV1().Deployments(status.Object.GetNamespace(extension)), obj, meta.PatchOptions{}, func(in *apps.Deployment) []patch.Item { + return []patch.Item{ + patch.ItemReplace(patch.NewPath("spec"), deploymentTemplate.Spec), + } + }, patcher.PatchMetadata(obj)) + if err != nil { + h.eventRecorder.Warning(extension, "Patch Failed", "Unable to patch Deployment: %s", err.Error()) + return false, err + } + h.eventRecorder.Normal(extension, "Updated", "Deployment %s patched", obj.GetName()) + status.Object.Checksum = util.NewType(hash) + return true, nil + } + + return false, nil +} + +func (h *handler) CanBeHandled(item operation.Item) bool { + return item.Group == Group() && + item.Version == Version() && + item.Kind == Kind() +} + +func (h *handler) init() {} diff --git a/pkg/handlers/scheduler/deployment/handler_manage_test.go b/pkg/handlers/scheduler/deployment/handler_manage_test.go new file mode 100644 index 000000000..e2f2b4927 --- /dev/null +++ b/pkg/handlers/scheduler/deployment/handler_manage_test.go @@ -0,0 +1,227 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package deployment + +import ( + "testing" + + "github.com/stretchr/testify/require" + apps "k8s.io/api/apps/v1" + "k8s.io/apimachinery/pkg/types" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Create(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerDeployment](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "df484e6467f4b2445aae3a93ed7da1e374a689ac7e616c86ba31a3b2dc3e3244", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Update(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerDeployment](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "df484e6467f4b2445aae3a93ed7da1e374a689ac7e616c86ba31a3b2dc3e3244", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) { + obj.Spec.Replicas = util.NewType[int32](2) + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "6ce82430599f0e4a3dc3983226076179a27559f0f1d87194eaa3c2d482aaceb3", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Recreate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerDeployment](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "df484e6467f4b2445aae3a93ed7da1e374a689ac7e616c86ba31a3b2dc3e3244", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) { + obj.Status.Object.UID = util.NewType[types.UID]("TEST") + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "df484e6467f4b2445aae3a93ed7da1e374a689ac7e616c86ba31a3b2dc3e3244", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Parent(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerDeployment](t, tests.FakeNamespace, "test", func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) {}) + deployment := tests.NewMetaObject[*apps.Deployment](t, tests.FakeNamespace, "test", func(t *testing.T, obj *apps.Deployment) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &deployment) + + require.Len(t, deployment.OwnerReferences, 1) +} + +func Test_Handler_Propagate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerDeployment](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) {}) + deployment := tests.NewMetaObject[*apps.Deployment](t, tests.FakeNamespace, "test", func(t *testing.T, obj *apps.Deployment) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &deployment) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "df484e6467f4b2445aae3a93ed7da1e374a689ac7e616c86ba31a3b2dc3e3244", extension.Status.Object.GetChecksum()) + require.EqualValues(t, 0, extension.Status.Replicas) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) { + obj.Spec.Replicas = util.NewType[int32](2) + }) + tests.Apply(t, deployment, func(t *testing.T, obj *apps.Deployment) { + obj.Status.Replicas = 5 + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension, &deployment) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &deployment) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "6ce82430599f0e4a3dc3983226076179a27559f0f1d87194eaa3c2d482aaceb3", extension.Status.Object.GetChecksum()) + require.EqualValues(t, 5, extension.Status.Replicas) +} + +func Test_Handler_Profile(t *testing.T) { + handler := newFakeHandler() + + // Arrange + profile := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", tests.MarkArangoProfileAsReady) + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerDeployment](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerDeployment) { + obj.Spec.Profiles = []string{profile.GetName()} + }) + deployment := tests.NewMetaObject[*apps.Deployment](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.EqualError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension)), "Profile with name `test` is missing") + + tests.CreateObjects(t, handler.kubeClient, handler.client, &profile) + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &deployment) + require.NotNil(t, deployment) + + require.Len(t, extension.Status.Profiles, 1) + require.Equal(t, profile.GetName(), extension.Status.Profiles[0]) +} diff --git a/pkg/handlers/scheduler/deployment/handler_test.go b/pkg/handlers/scheduler/deployment/handler_test.go new file mode 100644 index 000000000..e9c42c83e --- /dev/null +++ b/pkg/handlers/scheduler/deployment/handler_test.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package deployment + +import ( + "testing" + + "github.com/stretchr/testify/require" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_ObjectNotFound(t *testing.T) { + // Arrange + handler := newFakeHandler() + + i := newItem(operation.Add, "test", "test") + + actions := map[operation.Operation]bool{ + operation.Add: false, + operation.Update: false, + operation.Delete: false, + } + + // Act + for op, shouldFail := range actions { + t.Run(string(op), func(t *testing.T) { + err := tests.Handle(handler, i) + + // Assert + if shouldFail { + require.Error(t, err) + require.True(t, apiErrors.IsNotFound(err)) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/pkg/handlers/scheduler/deployment/local.go b/pkg/handlers/scheduler/deployment/local.go new file mode 100644 index 000000000..2932bf197 --- /dev/null +++ b/pkg/handlers/scheduler/deployment/local.go @@ -0,0 +1,48 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package deployment + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +func GVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: Group(), + Version: Version(), + Kind: Kind(), + } +} + +func Kind() string { + return scheduler.DeploymentResourceKind +} + +func Group() string { + return schedulerApi.SchemeGroupVersion.Group +} + +func Version() string { + return schedulerApi.SchemeGroupVersion.Version +} diff --git a/pkg/handlers/scheduler/deployment/register.go b/pkg/handlers/scheduler/deployment/register.go new file mode 100644 index 000000000..a6d902fa2 --- /dev/null +++ b/pkg/handlers/scheduler/deployment/register.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package deployment + +import ( + apps "k8s.io/api/apps/v1" + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" + "github.com/arangodb/kube-arangodb/pkg/handlers/generic/parent" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +// RegisterInformer into operator +func RegisterInformer(operator operator.Operator, recorder event.Recorder, client arangoClientSet.Interface, + kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) error { + + if err := operator.RegisterInformer(informer.Scheduler().V1beta1().ArangoSchedulerDeployments().Informer(), + Group(), + Version(), + Kind()); err != nil { + return err + } + + h := &handler{ + client: client, + kubeClient: kubeClient, + + eventRecorder: recorder.NewInstance(Group(), Version(), Kind()), + + operator: operator, + } + + h.init() + + if err := operator.RegisterHandler(h); err != nil { + return err + } + + { + deployment := k8sutil.AppsV1DeploymentGVK() + + if err := operator.RegisterInformer(kubeInformer.Apps().V1().Deployments().Informer(), + deployment.Group, + deployment.Version, + deployment.Kind); err != nil { + return err + } + + deploymentHandler := parent.NewNotifyHandler[*apps.Deployment]("apps-deployment-v1-parent", operator, kubeClient.AppsV1().Deployments, deployment, GVK()) + + if err := operator.RegisterHandler(deploymentHandler); err != nil { + return err + } + } + + return nil +} diff --git a/pkg/handlers/scheduler/deployment/suite_test.go b/pkg/handlers/scheduler/deployment/suite_test.go new file mode 100644 index 000000000..f0b5b69ca --- /dev/null +++ b/pkg/handlers/scheduler/deployment/suite_test.go @@ -0,0 +1,61 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package deployment + +import ( + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" +) + +func newFakeHandler() *handler { + f := fakeClientSet.NewSimpleClientset() + k := fake.NewSimpleClientset() + + h := &handler{ + client: f, + kubeClient: k, + eventRecorder: event.NewEventRecorder("mock", k).NewInstance(Group(), Version(), Kind()), + operator: operator.NewOperator("mock", "mock", "mock"), + } + + h.init() + + return h +} + +func newItem(o operation.Operation, namespace, name string) operation.Item { + return operation.Item{ + Group: schedulerApi.SchemeGroupVersion.Group, + Version: schedulerApi.SchemeGroupVersion.Version, + Kind: scheduler.DeploymentResourceKind, + + Operation: o, + + Namespace: namespace, + Name: name, + } +} diff --git a/pkg/handlers/scheduler/pod/handler.go b/pkg/handlers/scheduler/pod/handler.go new file mode 100644 index 000000000..bcd471a38 --- /dev/null +++ b/pkg/handlers/scheduler/pod/handler.go @@ -0,0 +1,224 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package pod + +import ( + "context" + "fmt" + + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/equality" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/logging" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/scheduler" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/patcher" +) + +var logger = logging.Global().RegisterAndGetLogger("scheduler-pod-operator", logging.Info) + +type handler struct { + client arangoClientSet.Interface + kubeClient kubernetes.Interface + + eventRecorder event.RecorderInstance + + operator operator.Operator +} + +func (h *handler) Name() string { + return Kind() +} + +func (h *handler) Handle(ctx context.Context, item operation.Item) error { + // Get Backup object. It also covers NotFound case + + object, err := util.WithKubernetesContextTimeoutP2A2(ctx, h.client.SchedulerV1beta1().ArangoSchedulerPods(item.Namespace).Get, item.Name, meta.GetOptions{}) + if err != nil { + if apiErrors.IsNotFound(err) { + return nil + } + + return err + } + + status := object.Status.DeepCopy() + + changed, reconcileErr := operator.HandleP3WithStop(ctx, item, object, status, h.handle) + if reconcileErr != nil && !operator.IsReconcile(reconcileErr) { + logger.Err(reconcileErr).Warn("Fail for %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + return reconcileErr + } + + if !changed { + return reconcileErr + } + + logger.Debug("Updating %s %s/%s", + item.Kind, + item.Namespace, + item.Name) + + if _, err := operator.WithSchedulerPodUpdateStatusInterfaceRetry(context.Background(), h.client.SchedulerV1beta1().ArangoSchedulerPods(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { + return err + } + + return reconcileErr +} + +func (h *handler) handle(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerPod, status *schedulerApi.ArangoSchedulerPodStatus) (bool, error) { + return operator.HandleP3(ctx, item, extension, status, h.HandleObject) +} + +func (h *handler) HandleObject(ctx context.Context, item operation.Item, extension *schedulerApi.ArangoSchedulerPod, status *schedulerApi.ArangoSchedulerPodStatus) (bool, error) { + calculatedProfiles, profilesChecksum, err := scheduler.Profiles(ctx, h.client.SchedulerV1beta1().ArangoProfiles(extension.GetNamespace()), extension.GetLabels(), extension.Spec.Profiles...) + if err != nil { + return false, err + } + + var podSpecTemplate core.PodTemplateSpec + + podSpecTemplate.ObjectMeta = meta.ObjectMeta{ + Name: extension.ObjectMeta.Name, + Labels: extension.ObjectMeta.Labels, + Annotations: extension.ObjectMeta.Annotations, + } + extension.Spec.PodSpec.DeepCopyInto(&podSpecTemplate.Spec) + + podSpecHash, err := util.SHA256FromJSON(podSpecTemplate) + if err != nil { + return false, err + } + + hash := util.SHA256FromString(fmt.Sprintf("%s|%s", profilesChecksum, podSpecHash)) + + if err := schedulerApi.ProfileTemplates(util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) *schedulerApi.ProfileTemplate { + return a.V.Template + })).RenderOnTemplate(&podSpecTemplate); err != nil { + return false, err + } + + if status.Object == nil { + // Create + + obj := &core.Pod{ + ObjectMeta: podSpecTemplate.ObjectMeta, + Spec: podSpecTemplate.Spec, + } + obj.OwnerReferences = append(obj.OwnerReferences, extension.AsOwner()) + + newObj, err := h.kubeClient.CoreV1().Pods(extension.GetNamespace()).Create(ctx, obj, meta.CreateOptions{}) + if err != nil { + h.eventRecorder.Warning(extension, "Create Failed", "Unable to create Pod: %s", err.Error()) + return false, err + } + + h.eventRecorder.Normal(extension, "Created", "Pod %s created", newObj.GetName()) + + status.Object = util.NewType(sharedApi.NewObjectWithChecksum(newObj, hash)) + return true, operator.Reconcile("Job Reference Changed") + } + + // Find existing + obj, err := h.kubeClient.CoreV1().Pods(status.Object.GetNamespace(extension)).Get(ctx, status.Object.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + // Object removed + h.eventRecorder.Warning(extension, "Removed", "Pod %s is gone", status.Object.GetName()) + status.Object = nil + return true, operator.Reconcile("Pod Reference Removed") + } + return false, err + } + + profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }) + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + + // Try to fetch status + if !equality.Semantic.DeepEqual(status.PodStatus, obj.Status) { + obj.Status.DeepCopyInto(&status.PodStatus) + return true, operator.Reconcile("Status Changed") + } + + if obj.GetDeletionTimestamp() != nil { + // Object is deleting, check later + return false, operator.Reconcile("Pod Deleting") + } + + if !status.Object.Equals(obj) { + // Object changed or was recreated + h.eventRecorder.Warning(extension, "Removed", "Pod %s reference is invalid", status.Object.GetName()) + if err := h.kubeClient.CoreV1().Pods(status.Object.GetNamespace(extension)).Delete(ctx, status.Object.GetName(), meta.DeleteOptions{}); err != nil { + return false, err + } + + return false, operator.Reconcile("Pod Deleted") + } + + // Object is equal, lets check if changed + if hash != status.Object.GetChecksum() { + // Checksum changed, lets apply changes + _, _, err := patcher.Patcher[*core.Pod](ctx, h.kubeClient.CoreV1().Pods(status.Object.GetNamespace(extension)), obj, meta.PatchOptions{}, func(in *core.Pod) []patch.Item { + return []patch.Item{ + patch.ItemReplace(patch.NewPath("spec"), podSpecTemplate.Spec), + } + }, patcher.PatchMetadata(obj)) + if err != nil { + h.eventRecorder.Warning(extension, "Patch Failed", "Unable to patch Pod: %s", err.Error()) + return false, err + } + h.eventRecorder.Normal(extension, "Updated", "Pod %s patched", obj.GetName()) + status.Object.Checksum = util.NewType(hash) + return true, nil + } + + return false, nil +} + +func (h *handler) CanBeHandled(item operation.Item) bool { + return item.Group == Group() && + item.Version == Version() && + item.Kind == Kind() +} + +func (h *handler) init() {} diff --git a/pkg/handlers/scheduler/pod/handler_manage_test.go b/pkg/handlers/scheduler/pod/handler_manage_test.go new file mode 100644 index 000000000..4d067f337 --- /dev/null +++ b/pkg/handlers/scheduler/pod/handler_manage_test.go @@ -0,0 +1,227 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package pod + +import ( + "testing" + + "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_Handler_Create(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerPod](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "64759f2e87813091ac4dbb627ee7411316259132ca5a9603786993f122899c2c", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Update(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerPod](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "64759f2e87813091ac4dbb627ee7411316259132ca5a9603786993f122899c2c", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) { + obj.Spec.HostNetwork = true + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "c982d1c7855103125df8330401d993eb1e8de85b2bd605ac61af3c872f4fa51d", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Recreate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerPod](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "64759f2e87813091ac4dbb627ee7411316259132ca5a9603786993f122899c2c", extension.Status.Object.GetChecksum()) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) { + obj.Status.Object.UID = util.NewType[types.UID]("TEST") + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "64759f2e87813091ac4dbb627ee7411316259132ca5a9603786993f122899c2c", extension.Status.Object.GetChecksum()) +} + +func Test_Handler_Parent(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerPod](t, tests.FakeNamespace, "test", func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) {}) + pod := tests.NewMetaObject[*core.Pod](t, tests.FakeNamespace, "test", func(t *testing.T, obj *core.Pod) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + + // Validate + require.NotNil(t, extension.Status.Object) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &pod) + + require.Len(t, pod.OwnerReferences, 1) +} + +func Test_Handler_Propagate(t *testing.T) { + handler := newFakeHandler() + + // Arrange + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerPod](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) {}) + pod := tests.NewMetaObject[*core.Pod](t, tests.FakeNamespace, "test", func(t *testing.T, obj *core.Pod) {}) + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &pod) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "64759f2e87813091ac4dbb627ee7411316259132ca5a9603786993f122899c2c", extension.Status.Object.GetChecksum()) + require.Equal(t, "", pod.Status.Message) + + // Update + tests.Apply(t, extension, func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) { + obj.Spec.HostNetwork = true + }) + tests.Apply(t, pod, func(t *testing.T, obj *core.Pod) { + obj.Status.Message = "RANDOM" + }) + tests.UpdateObjects(t, handler.kubeClient, handler.client, &extension, &pod) + + // Test + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &pod) + + // Validate + require.NotNil(t, extension.Status.Object) + require.Equal(t, extension.GetName(), extension.Status.Object.GetName()) + require.Equal(t, "c982d1c7855103125df8330401d993eb1e8de85b2bd605ac61af3c872f4fa51d", extension.Status.Object.GetChecksum()) + require.Equal(t, "RANDOM", pod.Status.Message) +} + +func Test_Handler_Profile(t *testing.T) { + handler := newFakeHandler() + + // Arrange + profile := tests.NewMetaObject[*schedulerApi.ArangoProfile](t, tests.FakeNamespace, "test", tests.MarkArangoProfileAsReady) + extension := tests.NewMetaObject[*schedulerApi.ArangoSchedulerPod](t, tests.FakeNamespace, "test", + func(t *testing.T, obj *schedulerApi.ArangoSchedulerPod) { + obj.Spec.Profiles = []string{profile.GetName()} + }) + pod := tests.NewMetaObject[*core.Pod](t, tests.FakeNamespace, "test") + + refresh := tests.CreateObjects(t, handler.kubeClient, handler.client, &extension) + + // Test + require.EqualError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension)), "Profile with name `test` is missing") + + tests.CreateObjects(t, handler.kubeClient, handler.client, &profile) + require.NoError(t, tests.Handle(handler, tests.NewItem(t, operation.Update, extension))) + + // Refresh + refresh(t) + tests.RefreshObjects(t, handler.kubeClient, handler.client, &pod) + require.NotNil(t, pod) + + require.Len(t, extension.Status.Profiles, 1) + require.Equal(t, profile.GetName(), extension.Status.Profiles[0]) +} diff --git a/pkg/handlers/scheduler/pod/handler_test.go b/pkg/handlers/scheduler/pod/handler_test.go new file mode 100644 index 000000000..2bffb0714 --- /dev/null +++ b/pkg/handlers/scheduler/pod/handler_test.go @@ -0,0 +1,59 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package pod + +import ( + "testing" + + "github.com/stretchr/testify/require" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/tests" +) + +func Test_ObjectNotFound(t *testing.T) { + // Arrange + handler := newFakeHandler() + + i := newItem(operation.Add, "test", "test") + + actions := map[operation.Operation]bool{ + operation.Add: false, + operation.Update: false, + operation.Delete: false, + } + + // Act + for op, shouldFail := range actions { + t.Run(string(op), func(t *testing.T) { + err := tests.Handle(handler, i) + + // Assert + if shouldFail { + require.Error(t, err) + require.True(t, apiErrors.IsNotFound(err)) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/pkg/handlers/scheduler/pod/local.go b/pkg/handlers/scheduler/pod/local.go new file mode 100644 index 000000000..0dfc44c98 --- /dev/null +++ b/pkg/handlers/scheduler/pod/local.go @@ -0,0 +1,48 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package pod + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +func GVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: Group(), + Version: Version(), + Kind: Kind(), + } +} + +func Kind() string { + return scheduler.PodResourceKind +} + +func Group() string { + return schedulerApi.SchemeGroupVersion.Group +} + +func Version() string { + return schedulerApi.SchemeGroupVersion.Version +} diff --git a/pkg/handlers/scheduler/pod/register.go b/pkg/handlers/scheduler/pod/register.go new file mode 100644 index 000000000..e0a88e297 --- /dev/null +++ b/pkg/handlers/scheduler/pod/register.go @@ -0,0 +1,80 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package pod + +import ( + core "k8s.io/api/core/v1" + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" + "github.com/arangodb/kube-arangodb/pkg/handlers/generic/parent" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" +) + +// RegisterInformer into operator +func RegisterInformer(operator operator.Operator, recorder event.Recorder, client arangoClientSet.Interface, + kubeClient kubernetes.Interface, informer arangoInformer.SharedInformerFactory, kubeInformer informers.SharedInformerFactory) error { + + if err := operator.RegisterInformer(informer.Scheduler().V1beta1().ArangoSchedulerPods().Informer(), + Group(), + Version(), + Kind()); err != nil { + return err + } + + h := &handler{ + client: client, + kubeClient: kubeClient, + + eventRecorder: recorder.NewInstance(Group(), Version(), Kind()), + + operator: operator, + } + + h.init() + + if err := operator.RegisterHandler(h); err != nil { + return err + } + + { + pod := k8sutil.CoreV1PodGVK() + + if err := operator.RegisterInformer(kubeInformer.Core().V1().Pods().Informer(), + pod.Group, + pod.Version, + pod.Kind); err != nil { + return err + } + + podHandler := parent.NewNotifyHandler[*core.Pod]("core-pod-v1-parent", operator, kubeClient.CoreV1().Pods, pod, GVK()) + + if err := operator.RegisterHandler(podHandler); err != nil { + return err + } + } + + return nil +} diff --git a/pkg/handlers/scheduler/pod/suite_test.go b/pkg/handlers/scheduler/pod/suite_test.go new file mode 100644 index 000000000..bdbb1150e --- /dev/null +++ b/pkg/handlers/scheduler/pod/suite_test.go @@ -0,0 +1,61 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package pod + +import ( + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" +) + +func newFakeHandler() *handler { + f := fakeClientSet.NewSimpleClientset() + k := fake.NewSimpleClientset() + + h := &handler{ + client: f, + kubeClient: k, + eventRecorder: event.NewEventRecorder("mock", k).NewInstance(Group(), Version(), Kind()), + operator: operator.NewOperator("mock", "mock", "mock"), + } + + h.init() + + return h +} + +func newItem(o operation.Operation, namespace, name string) operation.Item { + return operation.Item{ + Group: schedulerApi.SchemeGroupVersion.Group, + Version: schedulerApi.SchemeGroupVersion.Version, + Kind: scheduler.PodResourceKind, + + Operation: o, + + Namespace: namespace, + Name: name, + } +} diff --git a/pkg/handlers/scheduler/profile/handler.go b/pkg/handlers/scheduler/profile/handler.go index 7f1b2eb0d..e0413a637 100644 --- a/pkg/handlers/scheduler/profile/handler.go +++ b/pkg/handlers/scheduler/profile/handler.go @@ -84,7 +84,7 @@ func (h *handler) Handle(ctx context.Context, item operation.Item) error { item.Namespace, item.Name) - if _, err := operator.WithNetworkingArangoProfileUpdateStatusInterfaceRetry(context.Background(), h.client.SchedulerV1beta1().ArangoProfiles(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { + if _, err := operator.WithSchedulerArangoProfileUpdateStatusInterfaceRetry(context.Background(), h.client.SchedulerV1beta1().ArangoProfiles(object.GetNamespace()), object, *status, meta.UpdateOptions{}); err != nil { return err } diff --git a/pkg/handlers/scheduler/profile/local.go b/pkg/handlers/scheduler/profile/local.go index 3fa7f09bc..297dc9780 100644 --- a/pkg/handlers/scheduler/profile/local.go +++ b/pkg/handlers/scheduler/profile/local.go @@ -21,10 +21,20 @@ package profile import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "github.com/arangodb/kube-arangodb/pkg/apis/scheduler" schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" ) +func GVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: Group(), + Version: Version(), + Kind: Kind(), + } +} + func Kind() string { return scheduler.ArangoProfileResourceKind } diff --git a/pkg/integrations/sidecar/integration.go b/pkg/integrations/sidecar/integration.go index 28a040cea..731dbe0c7 100644 --- a/pkg/integrations/sidecar/integration.go +++ b/pkg/integrations/sidecar/integration.go @@ -90,6 +90,7 @@ func NewIntegrationEnablement(integrations ...Integration) (*schedulerApi.Profil } return &schedulerApi.ProfileTemplate{ + Priority: util.NewType(127), Pod: &schedulerPodApi.Pod{ Volumes: &schedulerPodResourcesApi.Volumes{ Volumes: volumes, @@ -186,6 +187,7 @@ func NewIntegration(image *schedulerContainerResourcesApi.Image, integration *sc } pt := schedulerApi.ProfileTemplate{ + Priority: util.NewType(128), Container: &schedulerApi.ProfileContainerTemplate{ All: &schedulerContainerApi.Generic{ Environments: &schedulerContainerResourcesApi.Environments{ diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 3d0768819..659509e4b 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -49,7 +49,11 @@ import ( "github.com/arangodb/kube-arangodb/pkg/handlers/job" "github.com/arangodb/kube-arangodb/pkg/handlers/networking/route" "github.com/arangodb/kube-arangodb/pkg/handlers/policy" - "github.com/arangodb/kube-arangodb/pkg/handlers/scheduler/profile" + schedulerBatchJobHandler "github.com/arangodb/kube-arangodb/pkg/handlers/scheduler/batchjob" + schedulerCronJobHandler "github.com/arangodb/kube-arangodb/pkg/handlers/scheduler/cronjob" + schedulerDeploymentHandler "github.com/arangodb/kube-arangodb/pkg/handlers/scheduler/deployment" + schedulerPodHandler "github.com/arangodb/kube-arangodb/pkg/handlers/scheduler/pod" + schedulerProfileHandler "github.com/arangodb/kube-arangodb/pkg/handlers/scheduler/profile" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/operator/scope" operatorV2 "github.com/arangodb/kube-arangodb/pkg/operatorV2" @@ -380,7 +384,47 @@ func (o *Operator) onStartOperatorV2Scheduler(operator operatorV2.Operator, reco } o.waitForCRD(scheduler.ArangoProfileCRDName, checkFn) - if err := profile.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { + checkFn = func() error { + _, err := o.Client.Arango().SchedulerV1beta1().ArangoSchedulerPods(o.Namespace).List(context.Background(), meta.ListOptions{}) + return err + } + o.waitForCRD(scheduler.PodCRDName, checkFn) + + checkFn = func() error { + _, err := o.Client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(o.Namespace).List(context.Background(), meta.ListOptions{}) + return err + } + o.waitForCRD(scheduler.DeploymentCRDName, checkFn) + + checkFn = func() error { + _, err := o.Client.Arango().SchedulerV1beta1().ArangoSchedulerBatchJobs(o.Namespace).List(context.Background(), meta.ListOptions{}) + return err + } + o.waitForCRD(scheduler.BatchJobCRDName, checkFn) + + checkFn = func() error { + _, err := o.Client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(o.Namespace).List(context.Background(), meta.ListOptions{}) + return err + } + o.waitForCRD(scheduler.CronJobCRDName, checkFn) + + if err := schedulerProfileHandler.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { + panic(err) + } + + if err := schedulerPodHandler.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { + panic(err) + } + + if err := schedulerDeploymentHandler.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { + panic(err) + } + + if err := schedulerBatchJobHandler.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { + panic(err) + } + + if err := schedulerCronJobHandler.RegisterInformer(operator, recorder, client, kubeClient, informer, kubeInformer); err != nil { panic(err) } } diff --git a/pkg/operatorV2/operation/item.go b/pkg/operatorV2/operation/item.go index 546a8b4b5..2e3e23e49 100644 --- a/pkg/operatorV2/operation/item.go +++ b/pkg/operatorV2/operation/item.go @@ -25,6 +25,7 @@ import ( "github.com/rs/zerolog" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" "github.com/arangodb/kube-arangodb/pkg/util/errors" ) @@ -57,6 +58,11 @@ func NewItemFromString(itemString string) (Item, error) { return NewItem(Operation(parts[0]), parts[1], parts[2], parts[3], parts[4], parts[5]) } +// NewItemFromGVKObject creates new item from Kubernetes Object +func NewItemFromGVKObject(operation Operation, gvk schema.GroupVersionKind, object meta.Object) (Item, error) { + return NewItem(operation, gvk.Group, gvk.Version, gvk.Kind, object.GetNamespace(), object.GetName()) +} + // NewItemFromObject creates new item from Kubernetes Object func NewItemFromObject(operation Operation, group, version, kind string, object meta.Object) (Item, error) { return NewItem(operation, group, version, kind, object.GetNamespace(), object.GetName()) @@ -92,6 +98,12 @@ type Item struct { Name string } +func (i Item) GVK(gvk schema.GroupVersionKind) bool { + return i.Group == gvk.Group && + i.Version == gvk.Version && + i.Kind == gvk.Kind +} + func validateField(name, value string, allowEmpty bool) error { if !allowEmpty && value == "" { return errors.Errorf(emptyError, name) diff --git a/pkg/operatorV2/update.go b/pkg/operatorV2/update.go index cdc16f54e..d82408f3b 100644 --- a/pkg/operatorV2/update.go +++ b/pkg/operatorV2/update.go @@ -28,6 +28,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" "github.com/arangodb/kube-arangodb/pkg/util/timer" ) @@ -39,15 +40,14 @@ type Object[T interface{}] interface { } type GetInterface[S interface{}, T Object[S]] interface { - Get(ctx context.Context, name string, options meta.GetOptions) (T, error) + generic.GetInterface[T] } type UpdateStatusInterfaceClient[S interface{}, T Object[S]] func(namespace string) UpdateStatusInterface[S, T] type UpdateStatusInterface[S interface{}, T Object[S]] interface { - GetInterface[S, T] - - UpdateStatus(ctx context.Context, in T, options meta.UpdateOptions) (T, error) + generic.GetInterface[T] + generic.UpdateStatusInterface[T] } func WithUpdateStatusInterfaceRetry[S interface{}, T Object[S]](ctx context.Context, client UpdateStatusInterface[S, T], obj T, status S, opts meta.UpdateOptions) (T, error) { diff --git a/pkg/operatorV2/update_wraps.go b/pkg/operatorV2/update_wraps.go index 9ec789c27..f2f3c53e1 100644 --- a/pkg/operatorV2/update_wraps.go +++ b/pkg/operatorV2/update_wraps.go @@ -57,10 +57,26 @@ func WithNetworkingArangoRouteUpdateStatusInterfaceRetry(ctx context.Context, cl return WithUpdateStatusInterfaceRetry[networkingApi.ArangoRouteStatus, *networkingApi.ArangoRoute](ctx, client, obj, status, opts) } -func WithNetworkingArangoProfileUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[schedulerApi.ProfileStatus, *schedulerApi.ArangoProfile], obj *schedulerApi.ArangoProfile, status schedulerApi.ProfileStatus, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) { +func WithSchedulerArangoProfileUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[schedulerApi.ProfileStatus, *schedulerApi.ArangoProfile], obj *schedulerApi.ArangoProfile, status schedulerApi.ProfileStatus, opts meta.UpdateOptions) (*schedulerApi.ArangoProfile, error) { return WithUpdateStatusInterfaceRetry[schedulerApi.ProfileStatus, *schedulerApi.ArangoProfile](ctx, client, obj, status, opts) } +func WithSchedulerPodUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[schedulerApi.ArangoSchedulerPodStatus, *schedulerApi.ArangoSchedulerPod], obj *schedulerApi.ArangoSchedulerPod, status schedulerApi.ArangoSchedulerPodStatus, opts meta.UpdateOptions) (*schedulerApi.ArangoSchedulerPod, error) { + return WithUpdateStatusInterfaceRetry[schedulerApi.ArangoSchedulerPodStatus, *schedulerApi.ArangoSchedulerPod](ctx, client, obj, status, opts) +} + +func WithSchedulerDeploymentUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[schedulerApi.ArangoSchedulerDeploymentStatus, *schedulerApi.ArangoSchedulerDeployment], obj *schedulerApi.ArangoSchedulerDeployment, status schedulerApi.ArangoSchedulerDeploymentStatus, opts meta.UpdateOptions) (*schedulerApi.ArangoSchedulerDeployment, error) { + return WithUpdateStatusInterfaceRetry[schedulerApi.ArangoSchedulerDeploymentStatus, *schedulerApi.ArangoSchedulerDeployment](ctx, client, obj, status, opts) +} + +func WithSchedulerBatchJobUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[schedulerApi.ArangoSchedulerBatchJobStatus, *schedulerApi.ArangoSchedulerBatchJob], obj *schedulerApi.ArangoSchedulerBatchJob, status schedulerApi.ArangoSchedulerBatchJobStatus, opts meta.UpdateOptions) (*schedulerApi.ArangoSchedulerBatchJob, error) { + return WithUpdateStatusInterfaceRetry[schedulerApi.ArangoSchedulerBatchJobStatus, *schedulerApi.ArangoSchedulerBatchJob](ctx, client, obj, status, opts) +} + +func WithSchedulerCronJobUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[schedulerApi.ArangoSchedulerCronJobStatus, *schedulerApi.ArangoSchedulerCronJob], obj *schedulerApi.ArangoSchedulerCronJob, status schedulerApi.ArangoSchedulerCronJobStatus, opts meta.UpdateOptions) (*schedulerApi.ArangoSchedulerCronJob, error) { + return WithUpdateStatusInterfaceRetry[schedulerApi.ArangoSchedulerCronJobStatus, *schedulerApi.ArangoSchedulerCronJob](ctx, client, obj, status, opts) +} + func WithArangoStorageUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage], obj *mlApi.ArangoMLStorage, status mlApi.ArangoMLStorageStatus, opts meta.UpdateOptions) (*mlApi.ArangoMLStorage, error) { return WithUpdateStatusInterfaceRetry[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage](ctx, client, obj, status, opts) } diff --git a/pkg/scheduler/input.go b/pkg/scheduler/input.go index 000bfa985..b136b033c 100644 --- a/pkg/scheduler/input.go +++ b/pkg/scheduler/input.go @@ -21,68 +21,43 @@ package scheduler import ( - "math" - core "k8s.io/api/core/v1" pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" - schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" - schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" - schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources" - schedulerPodApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod" - schedulerPodResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/pod/resources" - "github.com/arangodb/kube-arangodb/pkg/util" ) -func baseAsTemplate(in *pbSchedulerV1.Spec) *schedulerApi.ProfileTemplate { - containers := schedulerContainerApi.Containers{} - - for n, c := range in.Containers { +func SpecAsTemplate(in *pbSchedulerV1.Spec) *core.PodTemplateSpec { + var ret core.PodTemplateSpec + for _, c := range in.Containers { if c == nil { continue } - var container schedulerContainerApi.Container + var container core.Container if image := c.Image; image != nil { - container.Image = &schedulerContainerResourcesApi.Image{ - Image: c.Image, - } + container.Image = *image } if len(c.Args) > 0 { - container.Core = &schedulerContainerResourcesApi.Core{ - Args: c.Args, - } + container.Args = c.Args } - if len(c.EnvironmentVariables) > 0 { - container.Environments = &schedulerContainerResourcesApi.Environments{} - - for k, v := range c.EnvironmentVariables { - container.Env = append(container.Env, core.EnvVar{ - Name: k, - Value: v, - }) - } + for k, v := range c.EnvironmentVariables { + container.Env = append(container.Env, core.EnvVar{ + Name: k, + Value: v, + }) } - containers[n] = container + ret.Spec.Containers = append(ret.Spec.Containers, container) } - var t = schedulerApi.ProfileTemplate{ - Priority: util.NewType(math.MaxInt), - Pod: &schedulerPodApi.Pod{}, - Container: &schedulerApi.ProfileContainerTemplate{ - Containers: containers, - }, + if base := in.Base; base != nil { + ret.ObjectMeta.Labels = base.Labels } - if job := in.Job; job != nil { - t.Pod.Metadata = &schedulerPodResourcesApi.Metadata{ - Labels: job.Labels, - } - } + ret.Spec.RestartPolicy = core.RestartPolicyNever - return &t + return &ret } diff --git a/pkg/scheduler/profiles.go b/pkg/scheduler/profiles.go new file mode 100644 index 000000000..25cb34af2 --- /dev/null +++ b/pkg/scheduler/profiles.go @@ -0,0 +1,106 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package scheduler + +import ( + "context" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/generators/kubernetes" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" + "github.com/arangodb/kube-arangodb/pkg/util/strings" +) + +func Profiles(ctx context.Context, client generic.ListInterface[*schedulerApi.ArangoProfileList], labels map[string]string, profiles ...string) ([]util.KV[string, schedulerApi.ProfileAcceptedTemplate], string, error) { + profileMap, err := kubernetes.MapObjects[*schedulerApi.ArangoProfileList, *schedulerApi.ArangoProfile](ctx, client, func(result *schedulerApi.ArangoProfileList) []*schedulerApi.ArangoProfile { + q := make([]*schedulerApi.ArangoProfile, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) + + if err != nil { + return nil, "", err + } + + extractedProfiles := profileMap.AsList().Filter(func(a *schedulerApi.ArangoProfile) bool { + return a != nil && a.Spec.Template != nil + }).Filter(func(a *schedulerApi.ArangoProfile) bool { + if a.Spec.Selectors == nil { + return false + } + + if !a.Spec.Selectors.Select(labels) { + return false + } + + return true + }) + + for _, name := range profiles { + p, ok := profileMap.ByName(name) + if !ok { + return nil, "", errors.Errorf("Profile with name `%s` is missing", name) + } + + extractedProfiles = append(extractedProfiles, p) + } + + extractedProfiles = extractedProfiles.Unique(func(existing util.List[*schedulerApi.ArangoProfile], o *schedulerApi.ArangoProfile) bool { + return existing.Contains(func(a *schedulerApi.ArangoProfile) bool { + return a.GetName() == o.GetName() + }) + }) + + extractedProfiles = extractedProfiles.Sort(func(a, b *schedulerApi.ArangoProfile) bool { + return a.Spec.Template.GetPriority() > b.Spec.Template.GetPriority() + }) + + // Check if everything is valid + if err := errors.Errors(util.FormatList(extractedProfiles, func(in *schedulerApi.ArangoProfile) error { + if !in.Status.Conditions.IsTrue(schedulerApi.ReadyCondition) { + return errors.Errorf("ArangoProfile `%s` is not ready", in.GetName()) + } + if in.Status.Accepted == nil { + return errors.Errorf("ArangoProfile `%s` status is nil", in.GetName()) + } + + return nil + })...); err != nil { + return nil, "", err + } + + resultProfiles := util.FormatList(extractedProfiles, func(a *schedulerApi.ArangoProfile) util.KV[string, schedulerApi.ProfileAcceptedTemplate] { + return util.KV[string, schedulerApi.ProfileAcceptedTemplate]{ + K: a.GetName(), + V: *a.Status.Accepted, + } + }) + + return resultProfiles, util.SHA256FromString(strings.Join(util.FormatList(resultProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.V.Checksum + }), "|")), nil +} diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go deleted file mode 100644 index 53e77d076..000000000 --- a/pkg/scheduler/scheduler.go +++ /dev/null @@ -1,136 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - -package scheduler - -import ( - "context" - - core "k8s.io/api/core/v1" - - pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" - schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" - "github.com/arangodb/kube-arangodb/pkg/debug_package/generators/kubernetes" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" -) - -func NewScheduler(client kclient.Client, namespace string) Scheduler { - return scheduler{ - client: client, - namespace: namespace, - } -} - -type Scheduler interface { - Render(ctx context.Context, in *pbSchedulerV1.Spec, templates ...*schedulerApi.ProfileTemplate) (*core.PodTemplateSpec, []string, error) -} - -type scheduler struct { - client kclient.Client - namespace string -} - -func (s scheduler) Render(ctx context.Context, in *pbSchedulerV1.Spec, templates ...*schedulerApi.ProfileTemplate) (*core.PodTemplateSpec, []string, error) { - if in == nil { - return nil, nil, errors.Errorf("Unable to parse nil Spec") - } - - profileMap, err := kubernetes.MapObjects[*schedulerApi.ArangoProfileList, *schedulerApi.ArangoProfile](ctx, s.client.Arango().SchedulerV1beta1().ArangoProfiles(s.namespace), func(result *schedulerApi.ArangoProfileList) []*schedulerApi.ArangoProfile { - q := make([]*schedulerApi.ArangoProfile, len(result.Items)) - - for id, e := range result.Items { - q[id] = e.DeepCopy() - } - - return q - }) - - if err != nil { - return nil, nil, err - } - - var labels map[string]string - var additionalProfiles []string - - if job := in.Job; job != nil { - labels = job.Labels - additionalProfiles = job.Profiles - } - - if len(in.Containers) == 0 { - return nil, nil, errors.Errorf("Required at least 1 container") - } - - profiles := profileMap.AsList().Filter(func(a *schedulerApi.ArangoProfile) bool { - return a != nil && a.Spec.Template != nil - }).Filter(func(a *schedulerApi.ArangoProfile) bool { - if a.Spec.Selectors == nil { - return false - } - - if !a.Spec.Selectors.Select(labels) { - return false - } - - return true - }) - - for _, name := range additionalProfiles { - p, ok := profileMap.ByName(name) - if !ok { - return nil, nil, errors.Errorf("Profile with name `%s` is missing", name) - } - - profiles = append(profiles, p) - } - - profiles = profiles.Unique(func(existing kubernetes.List[*schedulerApi.ArangoProfile], o *schedulerApi.ArangoProfile) bool { - return existing.Contains(func(a *schedulerApi.ArangoProfile) bool { - return a.GetName() == o.GetName() - }) - }) - - profiles = profiles.Sort(func(a, b *schedulerApi.ArangoProfile) bool { - return a.Spec.Template.GetPriority() > b.Spec.Template.GetPriority() - }) - - if err := errors.Errors(kubernetes.Extract(profiles, func(in *schedulerApi.ArangoProfile) error { - return in.Spec.Validate() - })...); err != nil { - return nil, nil, err - } - - extracted := schedulerApi.ProfileTemplates(kubernetes.Extract(profiles, func(in *schedulerApi.ArangoProfile) *schedulerApi.ProfileTemplate { - return in.Spec.Template - }).Append(templates...).Append(baseAsTemplate(in))) - - names := kubernetes.Extract(profiles, func(in *schedulerApi.ArangoProfile) string { - return in.GetName() - }) - - var pod core.PodTemplateSpec - - if err := extracted.RenderOnTemplate(&pod); err != nil { - return nil, names, err - } - - return &pod, names, nil -} diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go deleted file mode 100644 index c70e16bb9..000000000 --- a/pkg/scheduler/scheduler_test.go +++ /dev/null @@ -1,344 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - -package scheduler - -import ( - "context" - "strings" - "testing" - - "github.com/stretchr/testify/require" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/yaml" - - pbSchedulerV1 "github.com/arangodb/kube-arangodb/integrations/scheduler/v1/definition" - schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" - schedulerContainerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container" - schedulerContainerResourcesApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1/container/resources" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/arangodb/kube-arangodb/pkg/util/tests" -) - -const DefaultContainerName = "job" - -func newScheduler(t *testing.T, objects ...*schedulerApi.ArangoProfile) Scheduler { - client := kclient.NewFakeClientBuilder().Client() - - objs := make([]interface{}, len(objects)) - for id := range objs { - objs[id] = &objects[id] - } - - tests.CreateObjects(t, client.Kubernetes(), client.Arango(), objs...) - - return NewScheduler(client, tests.FakeNamespace) -} - -type validatorExec func(in validator) - -type validator func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) - -func getRequest(in ...func(obj *pbSchedulerV1.Spec)) *pbSchedulerV1.Spec { - var r pbSchedulerV1.Spec - for _, i := range in { - i(&r) - } - - return &r -} - -func withProfiles(profiles ...string) func(obj *pbSchedulerV1.Spec) { - return func(obj *pbSchedulerV1.Spec) { - if obj.Job == nil { - obj.Job = &pbSchedulerV1.JobBase{} - } - - obj.Job.Profiles = append(obj.Job.Profiles, profiles...) - } -} - -func withLabels(labels map[string]string) func(obj *pbSchedulerV1.Spec) { - return func(obj *pbSchedulerV1.Spec) { - if obj.Job == nil { - obj.Job = &pbSchedulerV1.JobBase{} - } - - if obj.Job.Labels == nil { - obj.Job.Labels = make(map[string]string) - } - - for k, v := range labels { - obj.Job.Labels[k] = v - } - } -} - -func withDefaultContainer(in ...func(obj *pbSchedulerV1.ContainerBase)) func(obj *pbSchedulerV1.Spec) { - return func(obj *pbSchedulerV1.Spec) { - if obj.Containers == nil { - obj.Containers = make(map[string]*pbSchedulerV1.ContainerBase) - } - - var c pbSchedulerV1.ContainerBase - - for _, i := range in { - i(&c) - } - - obj.Containers[DefaultContainerName] = &c - } -} - -func render(t *testing.T, s Scheduler, in *pbSchedulerV1.Spec, templates ...*schedulerApi.ProfileTemplate) validatorExec { - pod, accepted, err := s.Render(context.Background(), in, templates...) - t.Logf("Accepted templates: %s", strings.Join(accepted, ", ")) - if err != nil { - return runValidate(t, err, pod, accepted) - } - require.NoError(t, err) - - data, err := yaml.Marshal(pod) - require.NoError(t, err) - - t.Logf("Rendered Template:\n%s", string(data)) - - return runValidate(t, nil, pod, accepted) -} - -func runValidate(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) validatorExec { - return func(in validator) { - t.Run("Validate", func(t *testing.T) { - in(t, err, template, accepted) - }) - } -} - -func Test_Nil(t *testing.T) { - render(t, newScheduler(t, tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test")), nil)(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.EqualError(t, err, "Unable to parse nil Spec") - }) -} - -func Test_NoProfiles(t *testing.T) { - render(t, newScheduler(t, tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test")), &pbSchedulerV1.Spec{})(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.EqualError(t, err, "Required at least 1 container") - }) -} - -func Test_MissingSelectedProfile(t *testing.T) { - render(t, newScheduler(t, tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test")), - getRequest(withProfiles("missing"), withDefaultContainer()), - )(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.EqualError(t, err, "Profile with name `missing` is missing") - }) -} - -func Test_SelectorWithoutSelector(t *testing.T) { - render(t, newScheduler(t, tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { - obj.Spec.Template = &schedulerApi.ProfileTemplate{ - Container: &schedulerApi.ProfileContainerTemplate{ - Containers: schedulerContainerApi.Containers{ - DefaultContainerName: { - Image: &schedulerContainerResourcesApi.Image{ - Image: util.NewType("image:1"), - }, - }, - }, - }, - } - })), getRequest(withDefaultContainer(func(obj *pbSchedulerV1.ContainerBase) { - obj.Image = util.NewType("") - })))(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.NoError(t, err) - - require.Len(t, accepted, 0) - - c := tests.GetContainerByNameT(t, template.Spec.Containers, DefaultContainerName) - require.Equal(t, "", c.Image) - }) -} - -func Test_SelectorWithSelectorAll(t *testing.T) { - render(t, newScheduler(t, tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { - obj.Spec.Selectors = &schedulerApi.ProfileSelectors{ - Label: &meta.LabelSelector{}, - } - obj.Spec.Template = &schedulerApi.ProfileTemplate{ - Container: &schedulerApi.ProfileContainerTemplate{ - Containers: schedulerContainerApi.Containers{ - DefaultContainerName: { - Image: &schedulerContainerResourcesApi.Image{ - Image: util.NewType("image:1"), - }, - }, - }, - }, - } - })), getRequest(withDefaultContainer()))(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.NoError(t, err) - - require.Len(t, accepted, 1) - require.Equal(t, []string{ - "test", - }, accepted) - - c := tests.GetContainerByNameT(t, template.Spec.Containers, DefaultContainerName) - require.Equal(t, "image:1", c.Image) - }) -} - -func Test_SelectorWithSpecificSelector_MissingLabel(t *testing.T) { - render(t, newScheduler(t, tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { - obj.Spec.Selectors = &schedulerApi.ProfileSelectors{ - Label: &meta.LabelSelector{ - MatchExpressions: []meta.LabelSelectorRequirement{ - { - Key: "ml.arangodb.com/type", - Operator: meta.LabelSelectorOpExists, - }, - }, - }, - } - obj.Spec.Template = &schedulerApi.ProfileTemplate{ - Container: &schedulerApi.ProfileContainerTemplate{ - Containers: schedulerContainerApi.Containers{ - DefaultContainerName: { - Image: &schedulerContainerResourcesApi.Image{ - Image: util.NewType("image:1"), - }, - }, - }, - }, - } - })), getRequest(withDefaultContainer()))(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.NoError(t, err) - - require.Len(t, accepted, 0) - - c := tests.GetContainerByNameT(t, template.Spec.Containers, DefaultContainerName) - require.Equal(t, "", c.Image) - }) -} - -func Test_SelectorWithSpecificSelector_PresentLabel(t *testing.T) { - render(t, newScheduler(t, tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { - obj.Spec.Selectors = &schedulerApi.ProfileSelectors{ - Label: &meta.LabelSelector{ - MatchExpressions: []meta.LabelSelectorRequirement{ - { - Key: "ml.arangodb.com/type", - Operator: meta.LabelSelectorOpExists, - }, - }, - }, - } - obj.Spec.Template = &schedulerApi.ProfileTemplate{ - Container: &schedulerApi.ProfileContainerTemplate{ - Containers: schedulerContainerApi.Containers{ - DefaultContainerName: { - Image: &schedulerContainerResourcesApi.Image{ - Image: util.NewType("image:1"), - }, - }, - }, - }, - } - })), getRequest(withDefaultContainer(), withLabels(map[string]string{ - "ml.arangodb.com/type": "training", - })), nil)(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.NoError(t, err) - - require.Len(t, accepted, 1) - require.Equal(t, []string{ - "test", - }, accepted) - - c := tests.GetContainerByNameT(t, template.Spec.Containers, DefaultContainerName) - require.Equal(t, "image:1", c.Image) - }) -} - -func Test_SelectorWithSpecificSelector_PresentLabel_ByPriority(t *testing.T) { - render(t, newScheduler(t, - tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test", func(t *testing.T, obj *schedulerApi.ArangoProfile) { - obj.Spec.Selectors = &schedulerApi.ProfileSelectors{ - Label: &meta.LabelSelector{ - MatchExpressions: []meta.LabelSelectorRequirement{ - { - Key: "ml.arangodb.com/type", - Operator: meta.LabelSelectorOpExists, - }, - }, - }, - } - obj.Spec.Template = &schedulerApi.ProfileTemplate{ - Priority: util.NewType(1), - Container: &schedulerApi.ProfileContainerTemplate{ - Containers: schedulerContainerApi.Containers{ - DefaultContainerName: { - Image: &schedulerContainerResourcesApi.Image{ - Image: util.NewType("image:1"), - }, - }, - }, - }, - } - }), tests.NewMetaObjectInDefaultNamespace[*schedulerApi.ArangoProfile](t, "test2", func(t *testing.T, obj *schedulerApi.ArangoProfile) { - obj.Spec.Selectors = &schedulerApi.ProfileSelectors{ - Label: &meta.LabelSelector{ - MatchExpressions: []meta.LabelSelectorRequirement{ - { - Key: "ml.arangodb.com/type", - Operator: meta.LabelSelectorOpExists, - }, - }, - }, - } - obj.Spec.Template = &schedulerApi.ProfileTemplate{ - Priority: util.NewType(2), - Container: &schedulerApi.ProfileContainerTemplate{ - Containers: schedulerContainerApi.Containers{ - DefaultContainerName: { - Image: &schedulerContainerResourcesApi.Image{ - Image: util.NewType("image:2"), - }, - }, - }, - }, - } - })), getRequest(withDefaultContainer(), withLabels(map[string]string{ - "ml.arangodb.com/type": "training", - }, - )))(func(t *testing.T, err error, template *core.PodTemplateSpec, accepted []string) { - require.NoError(t, err) - - require.Len(t, accepted, 2) - require.Equal(t, []string{ - "test2", - "test", - }, accepted) - - c := tests.GetContainerByNameT(t, template.Spec.Containers, DefaultContainerName) - require.Equal(t, "image:2", c.Image) - }) -} diff --git a/pkg/crd/arangoprofile.go b/pkg/util/constants/profiles.go similarity index 69% rename from pkg/crd/arangoprofile.go rename to pkg/util/constants/profiles.go index e421e9940..b603fca0a 100644 --- a/pkg/crd/arangoprofile.go +++ b/pkg/util/constants/profiles.go @@ -18,17 +18,9 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -package crd +package constants -import ( - "github.com/arangodb/kube-arangodb/pkg/crd/crds" -) +const ProfileGroup = "profiles.arangodb.com" -func init() { - registerCRDWithPanic(func(opts *crds.CRDOptions) crds.Definition { - return crds.SchedulerProfileDefinitionWithOptions(opts.AsFunc()) - }, &crds.CRDOptions{ - WithSchema: true, - WithPreserve: false, - }) -} +const ProfilesDeployment = ProfileGroup + "/deployment" +const ProfilesIntegrationPrefix = "integration." + ProfileGroup diff --git a/pkg/util/k8sutil/gvk.go b/pkg/util/k8sutil/gvk.go new file mode 100644 index 000000000..be549bd3a --- /dev/null +++ b/pkg/util/k8sutil/gvk.go @@ -0,0 +1,55 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package k8sutil + +import "k8s.io/apimachinery/pkg/runtime/schema" + +func CoreV1PodGVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + } +} + +func AppsV1DeploymentGVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + } +} + +func BatchV1JobGVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "Job", + } +} + +func BatchV1CronJobGVK() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "CronJob", + } +} diff --git a/pkg/util/k8sutil/inspector/generic/mod.go b/pkg/util/k8sutil/inspector/generic/mod.go index 7efc2c18f..37a0c2e25 100644 --- a/pkg/util/k8sutil/inspector/generic/mod.go +++ b/pkg/util/k8sutil/inspector/generic/mod.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,14 @@ import ( "k8s.io/apimachinery/pkg/types" ) +type ListContinue interface { + GetContinue() string +} + +type ListInterface[S ListContinue] interface { + List(ctx context.Context, opts meta.ListOptions) (S, error) +} + type GetInterface[S meta.Object] interface { Get(ctx context.Context, name string, opts meta.GetOptions) (S, error) } diff --git a/pkg/util/k8sutil/list.go b/pkg/util/k8sutil/list.go index b066dd5cd..8202f5d1a 100644 --- a/pkg/util/k8sutil/list.go +++ b/pkg/util/k8sutil/list.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,17 +24,11 @@ import ( "context" meta "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ListContinue interface { - GetContinue() string -} -type ListAPI[T ListContinue] interface { - List(ctx context.Context, opts meta.ListOptions) (T, error) -} + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/generic" +) -func APIList[T ListContinue](ctx context.Context, api ListAPI[T], opts meta.ListOptions, parser func(result T, err error) error) error { +func APIList[T generic.ListContinue](ctx context.Context, api generic.ListInterface[T], opts meta.ListOptions, parser func(result T, err error) error) error { result, err := api.List(ctx, opts) for { if err := parser(result, err); err != nil { diff --git a/pkg/util/k8sutil/patcher/metadata.go b/pkg/util/k8sutil/patcher/metadata.go new file mode 100644 index 000000000..3dab8c2d1 --- /dev/null +++ b/pkg/util/k8sutil/patcher/metadata.go @@ -0,0 +1,54 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package patcher + +import ( + "k8s.io/apimachinery/pkg/api/equality" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" +) + +func PatchMetadata[T meta.Object](expected T) Patch[T] { + return func(in T) []patch.Item { + r := make([]patch.Item, 0, 3) + + if expected := expected.GetFinalizers(); expected != nil && !equality.Semantic.DeepEqual(expected, in.GetFinalizers()) { + r = append(r, + patch.ItemReplace(patch.NewPath("metadata", "finalizers"), expected), + ) + } + + if expected := expected.GetLabels(); expected != nil && !equality.Semantic.DeepEqual(expected, in.GetAnnotations()) { + r = append(r, + patch.ItemReplace(patch.NewPath("metadata", "labels"), expected), + ) + } + + if expected := expected.GetAnnotations(); expected != nil && !equality.Semantic.DeepEqual(expected, in.GetLabels()) { + r = append(r, + patch.ItemReplace(patch.NewPath("metadata", "annotations"), expected), + ) + } + + return r + } +} diff --git a/pkg/util/list.go b/pkg/util/list.go index 13409bc7f..5359f294a 100644 --- a/pkg/util/list.go +++ b/pkg/util/list.go @@ -22,7 +22,7 @@ package util import "sort" -type List[T comparable] []T +type List[T any] []T func (l List[T]) Filter(fn func(T) bool) List[T] { if l == nil { @@ -57,6 +57,30 @@ func (l List[T]) Sort(fn func(T, T) bool) List[T] { return clone } +func (l List[T]) Contains(fn func(T) bool) bool { + for _, e := range l { + if fn(e) { + return true + } + } + + return false +} + +func (l List[T]) Unique(f func(existing List[T], a T) bool) List[T] { + r := make(List[T], 0, len(l)) + + for _, o := range l { + if f(r, o) { + continue + } + + r = append(r, o) + } + + return r +} + func PickFromList[V any](in []V, q func(v V) bool) (V, bool) { for _, v := range in { if q(v) { diff --git a/pkg/util/tests/ap.go b/pkg/util/tests/ap.go new file mode 100644 index 000000000..4fcf8d41a --- /dev/null +++ b/pkg/util/tests/ap.go @@ -0,0 +1,47 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package tests + +import ( + "testing" + + "github.com/stretchr/testify/require" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" +) + +func MarkArangoProfileAsReady(t *testing.T, obj *schedulerApi.ArangoProfile) { + if err := obj.Spec.Validate(); err != nil { + obj.Status.Conditions.Update(schedulerApi.SpecValidCondition, false, "Spec Invalid", "Spec Invalid") + obj.Status.Conditions.Update(schedulerApi.ReadyCondition, false, "Spec Invalid", "Spec Invalid") + return + } + obj.Status.Conditions.Update(schedulerApi.SpecValidCondition, true, "Spec Valid", "Spec Valid") + + checksum, err := obj.Spec.Template.Checksum() + require.NoError(t, err) + + obj.Status.Accepted = &schedulerApi.ProfileAcceptedTemplate{ + Checksum: checksum, + Template: obj.Spec.Template.DeepCopy(), + } + obj.Status.Conditions.Update(schedulerApi.ReadyCondition, true, "OK", "OK") +} diff --git a/pkg/util/tests/kubernetes.go b/pkg/util/tests/kubernetes.go index ea5c520a1..6eae5c44a 100644 --- a/pkg/util/tests/kubernetes.go +++ b/pkg/util/tests/kubernetes.go @@ -161,6 +161,12 @@ func CreateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := k8s.AppsV1().StatefulSets(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) require.NoError(t, err) + case **apps.Deployment: + require.NotNil(t, v) + + vl := *v + _, err := k8s.AppsV1().Deployments(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) case **api.ArangoDeployment: require.NotNil(t, v) @@ -251,6 +257,30 @@ func CreateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := arango.SchedulerV1beta1().ArangoProfiles(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) require.NoError(t, err) + case **schedulerApi.ArangoSchedulerPod: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerPods(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) + case **schedulerApi.ArangoSchedulerDeployment: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerDeployments(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) + case **schedulerApi.ArangoSchedulerBatchJob: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerBatchJobs(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) + case **schedulerApi.ArangoSchedulerCronJob: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerCronJobs(vl.GetNamespace()).Create(context.Background(), vl, meta.CreateOptions{}) + require.NoError(t, err) case **analyticsApi.GraphAnalyticsEngine: require.NotNil(t, v) @@ -333,6 +363,11 @@ func UpdateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := k8s.AppsV1().StatefulSets(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) require.NoError(t, err) + case **apps.Deployment: + require.NotNil(t, v) + vl := *v + _, err := k8s.AppsV1().Deployments(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) case **api.ArangoDeployment: require.NotNil(t, v) @@ -423,6 +458,30 @@ func UpdateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v _, err := arango.SchedulerV1beta1().ArangoProfiles(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) require.NoError(t, err) + case **schedulerApi.ArangoSchedulerPod: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerPods(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) + case **schedulerApi.ArangoSchedulerDeployment: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerDeployments(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) + case **schedulerApi.ArangoSchedulerBatchJob: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerBatchJobs(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) + case **schedulerApi.ArangoSchedulerCronJob: + require.NotNil(t, v) + + vl := *v + _, err := arango.SchedulerV1beta1().ArangoSchedulerCronJobs(vl.GetNamespace()).Update(context.Background(), vl, meta.UpdateOptions{}) + require.NoError(t, err) case **analyticsApi.GraphAnalyticsEngine: require.NotNil(t, v) @@ -493,6 +552,11 @@ func DeleteObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v err := k8s.AppsV1().StatefulSets(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{}) require.NoError(t, err) + case **apps.Deployment: + require.NotNil(t, v) + vl := *v + err := k8s.AppsV1().Deployments(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{}) + require.NoError(t, err) case **api.ArangoDeployment: require.NotNil(t, v) @@ -568,6 +632,26 @@ func DeleteObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSe vl := *v require.NoError(t, arango.SchedulerV1beta1().ArangoProfiles(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) + case **schedulerApi.ArangoSchedulerPod: + require.NotNil(t, v) + + vl := *v + require.NoError(t, arango.SchedulerV1beta1().ArangoSchedulerPods(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) + case **schedulerApi.ArangoSchedulerDeployment: + require.NotNil(t, v) + + vl := *v + require.NoError(t, arango.SchedulerV1beta1().ArangoSchedulerDeployments(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) + case **schedulerApi.ArangoSchedulerBatchJob: + require.NotNil(t, v) + + vl := *v + require.NoError(t, arango.SchedulerV1beta1().ArangoSchedulerBatchJobs(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) + case **schedulerApi.ArangoSchedulerCronJob: + require.NotNil(t, v) + + vl := *v + require.NoError(t, arango.SchedulerV1beta1().ArangoSchedulerCronJobs(vl.GetNamespace()).Delete(context.Background(), vl.GetName(), meta.DeleteOptions{})) case **analyticsApi.GraphAnalyticsEngine: require.NotNil(t, v) @@ -725,6 +809,20 @@ func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientS } else { *v = vn } + case **apps.Deployment: + require.NotNil(t, v) + + vl := *v + vn, err := k8s.AppsV1().Deployments(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } case **api.ArangoDeployment: require.NotNil(t, v) @@ -950,6 +1048,66 @@ func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientS } else { *v = vn } + case **schedulerApi.ArangoSchedulerPod: + require.NotNil(t, v) + + vl := *v + + vn, err := arango.SchedulerV1beta1().ArangoSchedulerPods(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } + case **schedulerApi.ArangoSchedulerDeployment: + require.NotNil(t, v) + + vl := *v + + vn, err := arango.SchedulerV1beta1().ArangoSchedulerDeployments(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } + case **schedulerApi.ArangoSchedulerBatchJob: + require.NotNil(t, v) + + vl := *v + + vn, err := arango.SchedulerV1beta1().ArangoSchedulerBatchJobs(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } + case **schedulerApi.ArangoSchedulerCronJob: + require.NotNil(t, v) + + vl := *v + + vn, err := arango.SchedulerV1beta1().ArangoSchedulerCronJobs(vl.GetNamespace()).Get(context.Background(), vl.GetName(), meta.GetOptions{}) + if err != nil { + if kerrors.IsNotFound(err) { + *v = nil + } else { + require.NoError(t, err) + } + } else { + *v = vn + } case **analyticsApi.GraphAnalyticsEngine: require.NotNil(t, v) @@ -988,10 +1146,16 @@ func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientS type MetaObjectMod[T meta.Object] func(t *testing.T, obj T) +func Apply[T meta.Object](t *testing.T, obj T, mods ...MetaObjectMod[T]) { + for _, m := range mods { + m(t, obj) + } +} + func SetMetaBasedOnType(t *testing.T, object meta.Object) { switch v := object.(type) { case *batch.CronJob: - v.Kind = "CronJob" + v.Kind = " ArangoSchedulerCronJob" v.APIVersion = "batch/v1" v.SetSelfLink(fmt.Sprintf("/api/batch/v1/cronjobs/%s/%s", object.GetNamespace(), @@ -1003,7 +1167,7 @@ func SetMetaBasedOnType(t *testing.T, object meta.Object) { object.GetNamespace(), object.GetName())) case *core.Pod: - v.Kind = "Pod" + v.Kind = " ArangoSchedulerPod" v.APIVersion = "v1" v.SetSelfLink(fmt.Sprintf("/api/v1/Pods/%s/%s", object.GetNamespace(), @@ -1044,6 +1208,12 @@ func SetMetaBasedOnType(t *testing.T, object meta.Object) { v.SetSelfLink(fmt.Sprintf("/api/apps/v1/statefulsets/%s/%s", object.GetNamespace(), object.GetName())) + case *apps.Deployment: + v.Kind = "Deployment" + v.APIVersion = "v1" + v.SetSelfLink(fmt.Sprintf("/api/apps/v1/deployments/%s/%s", + object.GetNamespace(), + object.GetName())) case *api.ArangoDeployment: v.Kind = deployment.ArangoDeploymentResourceKind v.APIVersion = api.SchemeGroupVersion.String() @@ -1156,6 +1326,38 @@ func SetMetaBasedOnType(t *testing.T, object meta.Object) { scheduler.ArangoProfileResourcePlural, object.GetNamespace(), object.GetName())) + case *schedulerApi.ArangoSchedulerPod: + v.Kind = scheduler.PodResourceKind + v.APIVersion = schedulerApi.SchemeGroupVersion.String() + v.SetSelfLink(fmt.Sprintf("/api/%s/%s/%s/%s", + schedulerApi.SchemeGroupVersion.String(), + scheduler.PodResourcePlural, + object.GetNamespace(), + object.GetName())) + case *schedulerApi.ArangoSchedulerDeployment: + v.Kind = scheduler.DeploymentResourceKind + v.APIVersion = schedulerApi.SchemeGroupVersion.String() + v.SetSelfLink(fmt.Sprintf("/api/%s/%s/%s/%s", + schedulerApi.SchemeGroupVersion.String(), + scheduler.DeploymentResourcePlural, + object.GetNamespace(), + object.GetName())) + case *schedulerApi.ArangoSchedulerBatchJob: + v.Kind = scheduler.BatchJobResourceKind + v.APIVersion = schedulerApi.SchemeGroupVersion.String() + v.SetSelfLink(fmt.Sprintf("/api/%s/%s/%s/%s", + schedulerApi.SchemeGroupVersion.String(), + scheduler.BatchJobResourcePlural, + object.GetNamespace(), + object.GetName())) + case *schedulerApi.ArangoSchedulerCronJob: + v.Kind = scheduler.CronJobResourceKind + v.APIVersion = schedulerApi.SchemeGroupVersion.String() + v.SetSelfLink(fmt.Sprintf("/api/%s/%s/%s/%s", + schedulerApi.SchemeGroupVersion.String(), + scheduler.CronJobResourcePlural, + object.GetNamespace(), + object.GetName())) case *analyticsApi.GraphAnalyticsEngine: v.Kind = analytics.GraphAnalyticsEngineResourceKind v.APIVersion = analyticsApi.SchemeGroupVersion.String() @@ -1198,9 +1400,7 @@ func NewMetaObject[T meta.Object](t *testing.T, namespace, name string, mods ... SetMetaBasedOnType(t, obj) - for _, mod := range mods { - mod(t, obj) - } + Apply(t, obj, mods...) return obj } @@ -1220,7 +1420,7 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind { return schema.GroupVersionKind{ Group: "batch", Version: "v1", - Kind: "CronJob", + Kind: " ArangoSchedulerCronJob", } case *batch.Job: return schema.GroupVersionKind{ @@ -1232,7 +1432,7 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind { return schema.GroupVersionKind{ Group: "", Version: "v1", - Kind: "Pod", + Kind: " ArangoSchedulerPod", } case *core.Secret: return schema.GroupVersionKind{ @@ -1270,6 +1470,12 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind { Version: "v1", Kind: "StatefulSet", } + case *apps.Deployment: + return schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + } case *api.ArangoDeployment: return schema.GroupVersionKind{ Group: deployment.ArangoDeploymentGroupName, @@ -1354,6 +1560,30 @@ func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind { Version: schedulerApi.ArangoSchedulerVersion, Kind: scheduler.ArangoProfileResourceKind, } + case *schedulerApi.ArangoSchedulerPod: + return schema.GroupVersionKind{ + Group: scheduler.ArangoSchedulerGroupName, + Version: schedulerApi.ArangoSchedulerVersion, + Kind: scheduler.PodResourceKind, + } + case *schedulerApi.ArangoSchedulerDeployment: + return schema.GroupVersionKind{ + Group: scheduler.ArangoSchedulerGroupName, + Version: schedulerApi.ArangoSchedulerVersion, + Kind: scheduler.DeploymentResourceKind, + } + case *schedulerApi.ArangoSchedulerBatchJob: + return schema.GroupVersionKind{ + Group: scheduler.ArangoSchedulerGroupName, + Version: schedulerApi.ArangoSchedulerVersion, + Kind: scheduler.BatchJobResourceKind, + } + case *schedulerApi.ArangoSchedulerCronJob: + return schema.GroupVersionKind{ + Group: scheduler.ArangoSchedulerGroupName, + Version: schedulerApi.ArangoSchedulerVersion, + Kind: scheduler.CronJobResourceKind, + } case *analyticsApi.GraphAnalyticsEngine: return schema.GroupVersionKind{ Group: analytics.ArangoAnalyticsGroupName, diff --git a/pkg/util/tests/kubernetes_test.go b/pkg/util/tests/kubernetes_test.go index c29d42215..ffadeb629 100644 --- a/pkg/util/tests/kubernetes_test.go +++ b/pkg/util/tests/kubernetes_test.go @@ -68,6 +68,7 @@ func NewMetaObjectRun[T meta.Object](t *testing.T) { func Test_NewMetaObject(t *testing.T) { NewMetaObjectRun[*batch.Job](t) + NewMetaObjectRun[*batch.CronJob](t) NewMetaObjectRun[*core.Pod](t) NewMetaObjectRun[*core.Secret](t) NewMetaObjectRun[*core.ConfigMap](t) @@ -75,6 +76,7 @@ func Test_NewMetaObject(t *testing.T) { NewMetaObjectRun[*core.Service](t) NewMetaObjectRun[*core.Endpoints](t) NewMetaObjectRun[*apps.StatefulSet](t) + NewMetaObjectRun[*apps.Deployment](t) NewMetaObjectRun[*rbac.Role](t) NewMetaObjectRun[*rbac.RoleBinding](t) NewMetaObjectRun[*rbac.ClusterRole](t) @@ -89,6 +91,10 @@ func Test_NewMetaObject(t *testing.T) { NewMetaObjectRun[*mlApiv1alpha1.ArangoMLBatchJob](t) NewMetaObjectRun[*mlApiv1alpha1.ArangoMLCronJob](t) NewMetaObjectRun[*schedulerApi.ArangoProfile](t) + NewMetaObjectRun[*schedulerApi.ArangoSchedulerPod](t) + NewMetaObjectRun[*schedulerApi.ArangoSchedulerDeployment](t) + NewMetaObjectRun[*schedulerApi.ArangoSchedulerBatchJob](t) + NewMetaObjectRun[*schedulerApi.ArangoSchedulerCronJob](t) NewMetaObjectRun[*analyticsApi.GraphAnalyticsEngine](t) NewMetaObjectRun[*networkingApi.ArangoRoute](t) } From 9f0e5c5713ab1df3653f568e3043fd7fab35776f Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 27 Sep 2024 09:32:04 +0200 Subject: [PATCH 43/50] [Feature] Alternative Upgrade Order (#1731) --- CHANGELOG.md | 1 + pkg/deployment/features/upgrade.go | 11 ++++++++++ .../reconcile/plan_builder_rotate_upgrade.go | 11 ++++++++++ .../plan_builder_rotate_upgrade_decision.go | 8 +++++-- .../plan_builder_rotate_upgrade_test.go | 20 ++++++++++++++++- pkg/util/list.go | 22 +++++++++++++++++++ 6 files changed, 70 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b451c1ec..d3ad7c03a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - (Improvement) Improve Metrics Handling - (Feature) (Scheduler) Create Integration Profile - (Feature) (Scheduler) Additional types +- (Feature) Alternative Upgrade Order Feature ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/deployment/features/upgrade.go b/pkg/deployment/features/upgrade.go index f33baae1e..9e1e448ba 100644 --- a/pkg/deployment/features/upgrade.go +++ b/pkg/deployment/features/upgrade.go @@ -23,6 +23,7 @@ package features func init() { registerFeature(upgradeVersionCheck) registerFeature(upgradeVersionCheckV2) + registerFeature(upgradeAlternativeOrder) } var upgradeVersionCheck Feature = &feature{ @@ -39,6 +40,14 @@ var upgradeVersionCheckV2 Feature = &feature{ enabledByDefault: false, } +var upgradeAlternativeOrder Feature = &feature{ + name: "upgrade-alternative-order", + description: "Changes order of the upgrade process - Coordinators are upgraded before DBServers", + enterpriseRequired: false, + enabledByDefault: false, + hidden: true, +} + func UpgradeVersionCheck() Feature { return upgradeVersionCheck } @@ -46,3 +55,5 @@ func UpgradeVersionCheck() Feature { func UpgradeVersionCheckV2() Feature { return upgradeVersionCheckV2 } + +func UpgradeAlternativeOrder() Feature { return upgradeAlternativeOrder } diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go index e652d1f4e..8843bee35 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go @@ -51,6 +51,17 @@ var ( api.ServerGroupSyncWorkers, api.ServerGroupGateways, } + + // alternativeUpgradeOrder contains execution order which enforce upgrade of Coordinators before DBServers + alternativeUpgradeOrder = []api.ServerGroup{ + api.ServerGroupAgents, + api.ServerGroupSingle, + api.ServerGroupCoordinators, + api.ServerGroupDBServers, + api.ServerGroupSyncMasters, + api.ServerGroupSyncWorkers, + api.ServerGroupGateways, + } ) // upgradeDecision is the result of an upgrade check. diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade_decision.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade_decision.go index fcd7db657..eace2f0df 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade_decision.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade_decision.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package reconcile import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/rotation" "github.com/arangodb/kube-arangodb/pkg/util" ) @@ -62,7 +63,10 @@ func (r *Reconciler) createRotateOrUpgradeDecision(spec api.DeploymentSpec, stat d := updateUpgradeDecisionMap{} // Init phase - for _, m := range status.Members.AsList() { + + upgradeOrder := util.BoolSwitch(features.UpgradeAlternativeOrder().Enabled(), alternativeUpgradeOrder, api.AllServerGroups) + + for _, m := range status.Members.AsListInGroups(upgradeOrder...) { d[m.Member.ID] = r.createRotateOrUpgradeDecisionMember(spec, status, context, m) } diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go index d374ab70b..6c1915bb6 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,24 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util" ) +func Test_EnsureGroupsContainsAll(t *testing.T) { + ensure := func(t *testing.T, groups ...api.ServerGroup) { + require.Equal(t, groups, util.UniqueList(groups)) + + for _, expected := range api.AllServerGroups { + t.Run(expected.AsRole(), func(t *testing.T) { + require.Contains(t, groups, expected) + }) + } + } + t.Run("rotationByAnnotationOrder", func(t *testing.T) { + ensure(t, rotationByAnnotationOrder...) + }) + t.Run("alternativeUpgradeOrder", func(t *testing.T) { + ensure(t, alternativeUpgradeOrder...) + }) +} + func Test_RotateUpgrade_Condition(t *testing.T) { type testCase struct { status api.MemberStatus diff --git a/pkg/util/list.go b/pkg/util/list.go index 5359f294a..1d1e76ce7 100644 --- a/pkg/util/list.go +++ b/pkg/util/list.go @@ -112,6 +112,28 @@ func FormatList[A, B any](in []A, format func(A) B) []B { return r } +func ContainsList[A comparable](in []A, item A) bool { + for _, el := range in { + if el == item { + return true + } + } + + return false +} + +func UniqueList[A comparable](in []A) []A { + var r = make([]A, 0, len(in)) + + for _, el := range in { + if !ContainsList(r, el) { + r = append(r, el) + } + } + + return r +} + func FormatListErr[A, B any](in []A, format func(A) (B, error)) ([]B, error) { var r = make([]B, len(in)) From 01f5875140f5956d5e0866eb3206faa565370a88 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:34:49 +0200 Subject: [PATCH 44/50] [Feature] [Scheduler] SchedV1 Integration (#1732) --- CHANGELOG.md | 1 + .../generators/kubernetes/arango_scheduler.go | 20 +++++ .../kubernetes/arango_scheduler_batchjobs.go | 73 +++++++++++++++++++ .../kubernetes/arango_scheduler_cronjobs.go | 73 +++++++++++++++++++ .../kubernetes/arango_scheduler_deployment.go | 73 +++++++++++++++++++ .../kubernetes/arango_scheduler_pod.go | 73 +++++++++++++++++++ pkg/deployment/resources/arango_profiles.go | 11 ++- pkg/handlers/scheduler/batchjob/handler.go | 18 ++--- pkg/handlers/scheduler/cronjob/handler.go | 18 ++--- pkg/handlers/scheduler/deployment/handler.go | 18 ++--- pkg/handlers/scheduler/pod/handler.go | 18 ++--- .../sidecar/integration.scheduler.v1.go | 73 +++++++++++++++++++ pkg/util/constants/profiles.go | 17 +++++ 13 files changed, 442 insertions(+), 44 deletions(-) create mode 100644 pkg/debug_package/generators/kubernetes/arango_scheduler_batchjobs.go create mode 100644 pkg/debug_package/generators/kubernetes/arango_scheduler_cronjobs.go create mode 100644 pkg/debug_package/generators/kubernetes/arango_scheduler_deployment.go create mode 100644 pkg/debug_package/generators/kubernetes/arango_scheduler_pod.go create mode 100644 pkg/integrations/sidecar/integration.scheduler.v1.go diff --git a/CHANGELOG.md b/CHANGELOG.md index d3ad7c03a..64058cc22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - (Feature) (Scheduler) Create Integration Profile - (Feature) (Scheduler) Additional types - (Feature) Alternative Upgrade Order Feature +- (Feature) (Scheduler) SchedV1 Integration ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler.go b/pkg/debug_package/generators/kubernetes/arango_scheduler.go index cf6dd16e9..dead1a268 100644 --- a/pkg/debug_package/generators/kubernetes/arango_scheduler.go +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler.go @@ -43,5 +43,25 @@ func scheduler(logger zerolog.Logger, files chan<- shared.File) error { return err } + if err := schedulerPods(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + + if err := schedulerDeployments(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + + if err := schedulerBatchJobs(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + + if err := schedulerCronJobs(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + return nil } diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_batchjobs.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_batchjobs.go new file mode 100644 index 000000000..a12a9b70c --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_batchjobs.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerBatchJobs(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + batchjobs, err := listSchedulerBatchJobs(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerBatchJob, client, files, batchjobs...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler batchjobs") + return err + } + + return nil +} + +func schedulerBatchJob(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerBatchJob) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulerbatchjobs/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerBatchJobs(client kclient.Client) ([]*schedulerApi.ArangoSchedulerBatchJob, error) { + return ListObjects[*schedulerApi.ArangoSchedulerBatchJobList, *schedulerApi.ArangoSchedulerBatchJob](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerBatchJobs(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerBatchJobList) []*schedulerApi.ArangoSchedulerBatchJob { + q := make([]*schedulerApi.ArangoSchedulerBatchJob, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_cronjobs.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_cronjobs.go new file mode 100644 index 000000000..566548feb --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_cronjobs.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerCronJobs(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + cronjobs, err := listSchedulerCronJobs(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerCronJob, client, files, cronjobs...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler cronjobs") + return err + } + + return nil +} + +func schedulerCronJob(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerCronJob) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulercronjobs/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerCronJobs(client kclient.Client) ([]*schedulerApi.ArangoSchedulerCronJob, error) { + return ListObjects[*schedulerApi.ArangoSchedulerCronJobList, *schedulerApi.ArangoSchedulerCronJob](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerCronJobList) []*schedulerApi.ArangoSchedulerCronJob { + q := make([]*schedulerApi.ArangoSchedulerCronJob, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_deployment.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_deployment.go new file mode 100644 index 000000000..eec21376e --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_deployment.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerDeployments(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + deployments, err := listSchedulerDeployments(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerDeployment, client, files, deployments...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler deployments") + return err + } + + return nil +} + +func schedulerDeployment(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerDeployment) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulerdeployments/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerDeployments(client kclient.Client) ([]*schedulerApi.ArangoSchedulerDeployment, error) { + return ListObjects[*schedulerApi.ArangoSchedulerDeploymentList, *schedulerApi.ArangoSchedulerDeployment](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerDeploymentList) []*schedulerApi.ArangoSchedulerDeployment { + q := make([]*schedulerApi.ArangoSchedulerDeployment, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_pod.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_pod.go new file mode 100644 index 000000000..b3bbe7c80 --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_pod.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerPods(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + pods, err := listSchedulerPods(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerPod, client, files, pods...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler pods") + return err + } + + return nil +} + +func schedulerPod(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerPod) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulerpods/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerPods(client kclient.Client) ([]*schedulerApi.ArangoSchedulerPod, error) { + return ListObjects[*schedulerApi.ArangoSchedulerPodList, *schedulerApi.ArangoSchedulerPod](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerPods(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerPodList) []*schedulerApi.ArangoSchedulerPod { + q := make([]*schedulerApi.ArangoSchedulerPod, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/deployment/resources/arango_profiles.go b/pkg/deployment/resources/arango_profiles.go index cfa12fdc0..56da23346 100644 --- a/pkg/deployment/resources/arango_profiles.go +++ b/pkg/deployment/resources/arango_profiles.go @@ -81,6 +81,8 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe return "", nil, err } + key, v := constants.NewProfileIntegration(name, version) + return fullName, &schedulerApi.ArangoProfile{ ObjectMeta: meta.ObjectMeta{ Name: fullName, @@ -91,8 +93,8 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe }, Spec: schedulerApi.ProfileSpec{ Selectors: matchArangoProfilesLabels(map[string]string{ - constants.ProfilesDeployment: deploymentName, - fmt.Sprintf("%s/%s", constants.ProfilesIntegrationPrefix, name): version, + constants.ProfilesDeployment: deploymentName, + key: v, }), Template: integration, }, @@ -128,8 +130,9 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe }, }, nil }, - gen("authz", "v0", sidecar.IntegrationAuthorizationV0{}), - gen("authn", "v1", sidecar.IntegrationAuthenticationV1{Spec: spec, DeploymentName: apiObject.GetName()}), + gen(constants.ProfilesIntegrationAuthz, constants.ProfilesIntegrationV0, sidecar.IntegrationAuthorizationV0{}), + gen(constants.ProfilesIntegrationAuthn, constants.ProfilesIntegrationV1, sidecar.IntegrationAuthenticationV1{Spec: spec, DeploymentName: apiObject.GetName()}), + gen(constants.ProfilesIntegrationSched, constants.ProfilesIntegrationV1, sidecar.IntegrationSchedulerV1{}), ); err != nil { return err } else if changed { diff --git a/pkg/handlers/scheduler/batchjob/handler.go b/pkg/handlers/scheduler/batchjob/handler.go index 57b1b42c1..9f87e3d08 100644 --- a/pkg/handlers/scheduler/batchjob/handler.go +++ b/pkg/handlers/scheduler/batchjob/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var batchJobTemplate batch.Job batchJobTemplate.ObjectMeta = meta.ObjectMeta{ Name: extension.ObjectMeta.Name, @@ -168,16 +176,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.JobStatus, obj.Status) { obj.Status.DeepCopyInto(&status.JobStatus) diff --git a/pkg/handlers/scheduler/cronjob/handler.go b/pkg/handlers/scheduler/cronjob/handler.go index 9666bf9d7..c65d8791f 100644 --- a/pkg/handlers/scheduler/cronjob/handler.go +++ b/pkg/handlers/scheduler/cronjob/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var cronJobTemplate batch.CronJob cronJobTemplate.ObjectMeta = meta.ObjectMeta{ Name: extension.ObjectMeta.Name, @@ -168,16 +176,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.CronJobStatus, obj.Status) { obj.Status.DeepCopyInto(&status.CronJobStatus) diff --git a/pkg/handlers/scheduler/deployment/handler.go b/pkg/handlers/scheduler/deployment/handler.go index 05828f1df..9ccd75159 100644 --- a/pkg/handlers/scheduler/deployment/handler.go +++ b/pkg/handlers/scheduler/deployment/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var deploymentTemplate apps.Deployment deploymentTemplate.ObjectMeta = meta.ObjectMeta{ Name: extension.ObjectMeta.Name, @@ -169,16 +177,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.DeploymentStatus, obj.Status) { obj.Status.DeepCopyInto(&status.DeploymentStatus) diff --git a/pkg/handlers/scheduler/pod/handler.go b/pkg/handlers/scheduler/pod/handler.go index bcd471a38..292642d62 100644 --- a/pkg/handlers/scheduler/pod/handler.go +++ b/pkg/handlers/scheduler/pod/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var podSpecTemplate core.PodTemplateSpec podSpecTemplate.ObjectMeta = meta.ObjectMeta{ @@ -164,16 +172,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.PodStatus, obj.Status) { obj.Status.DeepCopyInto(&status.PodStatus) diff --git a/pkg/integrations/sidecar/integration.scheduler.v1.go b/pkg/integrations/sidecar/integration.scheduler.v1.go new file mode 100644 index 000000000..9913e6274 --- /dev/null +++ b/pkg/integrations/sidecar/integration.scheduler.v1.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// 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 holder is ArangoDB GmbH, Cologne, Germany +// + +package sidecar + +import ( + core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type IntegrationSchedulerV1 struct { + Core *Core + + DeploymentName string + Spec api.DeploymentSpec +} + +func (i IntegrationSchedulerV1) Name() []string { + return []string{"SCHEDULER", "V1"} +} + +func (i IntegrationSchedulerV1) Validate() error { + return nil +} + +func (i IntegrationSchedulerV1) Envs() ([]core.EnvVar, error) { + var envs = []core.EnvVar{ + { + Name: "INTEGRATION_SCHEDULER_V1", + Value: "true", + }, + { + Name: "INTEGRATION_SCHEDULER_V1_VERIFY_ACCESS", + Value: "true", + }, + { + Name: "INTEGRATION_SCHEDULER_V1_NAMESPACE", + ValueFrom: &core.EnvVarSource{ + FieldRef: &core.ObjectFieldSelector{ + FieldPath: "metadata.namespace", + }, + }, + }, + } + + return i.Core.Envs(i, envs...), nil +} + +func (i IntegrationSchedulerV1) GlobalEnvs() ([]core.EnvVar, error) { + return nil, nil +} + +func (i IntegrationSchedulerV1) Volumes() ([]core.Volume, []core.VolumeMount, error) { + return nil, nil, nil +} diff --git a/pkg/util/constants/profiles.go b/pkg/util/constants/profiles.go index b603fca0a..bc4778a0c 100644 --- a/pkg/util/constants/profiles.go +++ b/pkg/util/constants/profiles.go @@ -20,7 +20,24 @@ package constants +import "fmt" + const ProfileGroup = "profiles.arangodb.com" const ProfilesDeployment = ProfileGroup + "/deployment" const ProfilesIntegrationPrefix = "integration." + ProfileGroup + +const ( + ProfilesIntegrationAuthn = "authn" + ProfilesIntegrationAuthz = "authz" + ProfilesIntegrationSched = "sched" +) + +const ( + ProfilesIntegrationV0 = "v0" + ProfilesIntegrationV1 = "v1" +) + +func NewProfileIntegration(name, version string) (string, string) { + return fmt.Sprintf("%s/%s", ProfilesIntegrationPrefix, name), version +} From 3ffda220d9c76e725d1d2028b94d8c882d53cdd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 11:22:39 +0200 Subject: [PATCH 45/50] Bump rollup from 2.79.0 to 2.79.2 in /dashboard (#1733) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dashboard/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index f5d5a5edd..c28667e7b 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -13304,9 +13304,9 @@ } }, "rollup": { - "version": "2.79.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.0.tgz", - "integrity": "sha512-x4KsrCgwQ7ZJPcFA/SUu6QVcYlO7uRLfLAy0DSA4NS2eG8japdbpM50ToH7z4iObodRYOJ0soneF0iaQRJ6zhA==", + "version": "2.79.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", + "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", "dev": true, "requires": { "fsevents": "~2.3.2" From 0121b4b919483da0165c0fb19997537fad462e49 Mon Sep 17 00:00:00 2001 From: ajanikow <12255597+ajanikow@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:31:08 +0000 Subject: [PATCH 46/50] Updated to 1.2.43-preview-1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0dfda79db..fb3e9a1b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.42+git \ No newline at end of file +1.2.43-preview-1+git \ No newline at end of file From 1cdea86203e3b543a45bee26d5c15f481e94717c Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:10:55 +0200 Subject: [PATCH 47/50] [Maintenance] Update README (#1736) --- Makefile | 135 +++++++++++------- README.md | 39 +++-- .../templates/crd/cluster-role.yaml | 16 +++ .../templates/crd/cluster-role.yaml | 16 +++ .../templates/crd/cluster-role.yaml | 16 +++ .../templates/crd/cluster-role.yaml | 16 +++ internal/docs_test.go | 73 +++++++--- internal/platforms.yaml | 100 +++++++++---- internal/readme.go | 10 +- 9 files changed, 302 insertions(+), 119 deletions(-) diff --git a/Makefile b/Makefile index 7c176d50e..ca462de78 100644 --- a/Makefile +++ b/Makefile @@ -542,75 +542,100 @@ manifests-crd-kustomize: manifests-crd-file manifests: manifests-crd-kustomize $(eval $(call manifest-generator, deployment, kube-arangodb, \ - --set "operator.features.deployment=true" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=true" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=true" \ + --set "operator.features.scheduler=true")) $(eval $(call manifest-generator, deployment-replication, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=true" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=true" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, storage, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=true" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=true" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, backup, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=true")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=true" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, apps, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=true" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=true" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, ml, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=true" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=true" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, k2kclustersync, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=true" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=true" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, all, kube-arangodb, \ - --set "operator.features.deployment=true" \ - --set "operator.features.deploymentReplications=true" \ - --set "operator.features.storage=true" \ - --set "operator.features.apps=true" \ - --set "operator.features.ml=true" \ - --set "operator.features.k8sToK8sClusterSync=true" \ - --set "operator.features.backup=true")) + --set "operator.features.deployment=true" \ + --set "operator.features.deploymentReplications=true" \ + --set "operator.features.storage=true" \ + --set "operator.features.backup=true" \ + --set "operator.features.apps=true" \ + --set "operator.features.k8sToK8sClusterSync=true" \ + --set "operator.features.ml=true" \ + --set "operator.features.analytics=true" \ + --set "operator.features.networking=true" \ + --set "operator.features.scheduler=true")) .PHONY: chart-crd chart-crd: export CHART_NAME := kube-arangodb-crd diff --git a/README.md b/README.md index 5643abcbd..8568367b9 100644 --- a/README.md +++ b/README.md @@ -52,19 +52,32 @@ covers individual newer features separately. [START_INJECT]: # (kubernetesVersionsTable) -| Platform | Kubernetes Version | ArangoDB Version | State | Remarks | Provider Remarks | -|:--------------------|:-------------------|:-----------------|:-----------|:------------------------------------------|:-----------------------------------| -| Google GKE | 1.25-1.30 | >= 3.8.0 | Production | Don't use micro nodes | | -| Azure AKS | 1.25-1.30 | >= 3.8.0 | Production | | | -| Amazon EKS | 1.25-1.30 | >= 3.8.0 | Production | | [Amazon EKS](./docs/providers/eks) | -| IBM Cloud | <= 1.20 | >= 3.8.0 | Deprecated | Support will be dropped in Operator 1.5.0 | | -| IBM Cloud | 1.25-1.30 | >= 3.8.0 | Production | | | -| OpenShift | 3.11 | >= 3.8.0 | Deprecated | Support will be dropped in Operator 1.5.0 | | -| OpenShift | 4.2-4.14 | >= 3.8.0 | Production | | | -| BareMetal (kubeadm) | <= 1.20 | >= 3.8.0 | Deprecated | Support will be dropped in Operator 1.5.0 | | -| BareMetal (kubeadm) | 1.25-1.30 | >= 3.8.0 | Production | | | -| Minikube | 1.25-1.30 | >= 3.8.0 | Devel Only | | | -| Other | 1.25-1.30 | >= 3.8.0 | Devel Only | | | +| Platform | State | Kubernetes Version | ArangoDB Version | Remarks | Provider Remarks | +|:--------------------|:-------------|:-------------------|:-----------------|:----------------------|:-----------------------------------| +| Google GKE | Production | 1.28-1.31 | >= 3.11.0 | Don't use micro nodes | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | Don't use micro nodes | | +| | NotSupported | < 1.25 | < 3.8.0 | Don't use micro nodes | | +| Azure AKS | Production | 1.28-1.32 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| Amazon EKS | Production | 1.28-1.31 | >= 3.11.0 | | [Amazon EKS](./docs/providers/eks) | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | [Amazon EKS](./docs/providers/eks) | +| | NotSupported | < 1.25 | < 3.8.0 | | [Amazon EKS](./docs/providers/eks) | +| IBM Cloud | Production | 1.29-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.28 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| OpenShift | Production | 4.11-4.17 | >= 3.11.0 | | | +| | EOL | 4.2-4.11 | 3.9.0-3.10.0 | | | +| | NotSupported | < 4.2 | < 3.8.0 | | | +| BareMetal (kubeadm) | Production | 1.28-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| Minikube | Devel Only | 1.28-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| Other | Production | 1.28-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | [END_INJECT]: # (kubernetesVersionsTable) diff --git a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/chart/kube-arangodb/templates/crd/cluster-role.yaml b/chart/kube-arangodb/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/internal/docs_test.go b/internal/docs_test.go index 765c969c9..6db3dc33e 100644 --- a/internal/docs_test.go +++ b/internal/docs_test.go @@ -21,15 +21,17 @@ package internal import ( + "bufio" "bytes" "fmt" "go/ast" "go/token" "io" "os" + "os/exec" "path" - "path/filepath" "reflect" + "sort" "strings" "testing" @@ -365,12 +367,60 @@ func Test_GenerateAPIDocs(t *testing.T) { } } -func prepareGitHubTreePath(t *testing.T, root string) string { - vStr, err := os.ReadFile(filepath.Join(root, "VERSION")) - require.NoError(t, err, "failed to read VERSION file") - opVersion, err := semver.NewVersion(string(vStr)) +func writeFrontMatter(t *testing.T, out io.Writer, keyVals map[string]string) { + fm := "" + util.IterateSorted(keyVals, func(key, val string) { + fm += fmt.Sprintf("%s: %s\n", key, val) + }) + + if fm != "" { + fm = "---\n" + fm + "---\n\n" + } + + write(t, out, fm) +} + +func extractVersion(t *testing.T, root string) *semver.Version { + cmd := exec.Command("git", "tag", "--list") + cmd.Dir = root + + out, err := cmd.StdoutPipe() require.NoError(t, err) + require.NoError(t, cmd.Start()) + + versions := semver.Versions{} + + scanner := bufio.NewScanner(out) + // optionally, resize scanner's capacity for lines over 64K, see next example + for scanner.Scan() { + v := strings.TrimSpace(scanner.Text()) + sm, err := semver.NewVersion(v) + if err != nil { + t.Logf("Unable to parse: %s", v) + continue + } + + if v := sm.PreRelease.Slice(); len(v) > 0 && v[0] != "" { + continue + } + + versions = append(versions, sm) + } + + require.NoError(t, cmd.Wait()) + + sort.Sort(versions) + + if len(versions) == 0 { + require.Fail(t, "Required at least one version") + } + + return versions[len(versions)-1] +} + +func prepareGitHubTreePath(t *testing.T, root string) string { + opVersion := extractVersion(t, root) ref := fmt.Sprintf("%d.%d.%d", opVersion.Major, opVersion.Minor, opVersion.Patch) return fmt.Sprintf("https://github.com/arangodb/kube-arangodb/blob/%s", ref) } @@ -434,16 +484,3 @@ func write(t *testing.T, out io.Writer, format string, args ...interface{}) { _, err := out.Write([]byte(fmt.Sprintf(format, args...))) require.NoError(t, err) } - -func writeFrontMatter(t *testing.T, out io.Writer, keyVals map[string]string) { - fm := "" - util.IterateSorted(keyVals, func(key, val string) { - fm += fmt.Sprintf("%s: %s\n", key, val) - }) - - if fm != "" { - fm = "---\n" + fm + "---\n\n" - } - - write(t, out, fm) -} diff --git a/internal/platforms.yaml b/internal/platforms.yaml index ea6fd5ca8..c7ba1d198 100644 --- a/internal/platforms.yaml +++ b/internal/platforms.yaml @@ -1,55 +1,95 @@ platforms: - name: "Google GKE" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" - remarks: "Don't use micro nodes " + remarks: "Don't use micro nodes" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + remarks: "Don't use micro nodes" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" + remarks: "Don't use micro nodes" - name: "Azure AKS" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.32" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "Amazon EKS" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" providerRemarks: "[Amazon EKS](./docs/providers/eks)" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + providerRemarks: "[Amazon EKS](./docs/providers/eks)" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" + providerRemarks: "[Amazon EKS](./docs/providers/eks)" - name: "IBM Cloud" versions: - - kubernetesVersion: "<= 1.20" - arangoDBVersion: ">= 3.8.0" - state: "Deprecated" - remarks: "Support will be dropped in Operator 1.5.0" - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.29-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "1.25-1.28" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "OpenShift" versions: - - kubernetesVersion: "3.11" - arangoDBVersion: ">= 3.8.0" - state: "Deprecated" - remarks: "Support will be dropped in Operator 1.5.0" - - kubernetesVersion: "4.2-4.14" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "4.11-4.17" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "4.2-4.11" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 4.2" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "BareMetal (kubeadm)" versions: - - kubernetesVersion: "<= 1.20" - arangoDBVersion: ">= 3.8.0" - state: "Deprecated" - remarks: "Support will be dropped in Operator 1.5.0" - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "Minikube" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Devel Only" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "Other" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" - state: "Devel Only" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" + state: "Production" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" diff --git a/internal/readme.go b/internal/readme.go index 402e91426..7ce37fb12 100644 --- a/internal/readme.go +++ b/internal/readme.go @@ -331,9 +331,9 @@ func GenerateReadmePlatforms(root string) (string, error) { pRemarks := md.NewColumn("Provider Remarks", md.ColumnLeftAlign) t := md.NewTable( platform, + state, kVersion, aVersion, - state, remarks, pRemarks, ) @@ -350,9 +350,13 @@ func GenerateReadmePlatforms(root string) (string, error) { } for _, p := range d.Platforms { - for _, v := range p.Versions { + for id, v := range p.Versions { + n := "" + if id == 0 { + n = p.Name + } if err := t.AddRow(map[md.Column]string{ - platform: p.Name, + platform: n, kVersion: util.TypeOrDefault[string](v.KubernetesVersion, ""), aVersion: util.TypeOrDefault[string](v.ArangoDBVersion, ""), state: util.TypeOrDefault[string](v.State, ""), From f12061428184d4b4795ea5a1581af830ffa2ce10 Mon Sep 17 00:00:00 2001 From: ajanikow <12255597+ajanikow@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:06:12 +0000 Subject: [PATCH 48/50] Updated to 1.2.43-preview-2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fb3e9a1b5..758f2e3d5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.43-preview-1+git \ No newline at end of file +1.2.43-preview-2+git \ No newline at end of file From 21bb072033f1a0be47781bc3c31a004a13bd0ad0 Mon Sep 17 00:00:00 2001 From: ajanikow <12255597+ajanikow@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:14:05 +0000 Subject: [PATCH 49/50] Update CHANGELOG --- CHANGELOG.md | 2 ++ internal/docs_test.go | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64058cc22..5606cde79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) + +## [1.2.43](https://github.com/arangodb/kube-arangodb/tree/1.2.43) (2024-10-14) - (Feature) ArangoRoute CRD - (Feature) ArangoRoute Operator - (Feature) Add Kubernetes Services for Group diff --git a/internal/docs_test.go b/internal/docs_test.go index 6db3dc33e..291fce799 100644 --- a/internal/docs_test.go +++ b/internal/docs_test.go @@ -381,6 +381,39 @@ func writeFrontMatter(t *testing.T, out io.Writer, keyVals map[string]string) { } func extractVersion(t *testing.T, root string) *semver.Version { + if v := extractVersionFile(t, root); v != nil { + return v + } else { + t.Logf("Unable to get Version from file, fallback to git") + } + + if v := extractVersionGit(t, root); v != nil { + return v + } else { + t.Logf("Unable to get Version from Git") + } + + require.FailNow(t, "Unable to get version") + + return nil +} + +func extractVersionFile(t *testing.T, root string) *semver.Version { + data, err := os.ReadFile(path.Join(root, "VERSION")) + require.NoError(t, err) + + v := strings.TrimSpace(string(data)) + sm, err := semver.NewVersion(v) + require.NoError(t, err) + + if v := sm.PreRelease.Slice(); len(v) > 0 && v[0] != "" { + return nil + } + + return sm +} + +func extractVersionGit(t *testing.T, root string) *semver.Version { cmd := exec.Command("git", "tag", "--list") cmd.Dir = root @@ -410,12 +443,12 @@ func extractVersion(t *testing.T, root string) *semver.Version { require.NoError(t, cmd.Wait()) - sort.Sort(versions) - if len(versions) == 0 { - require.Fail(t, "Required at least one version") + return nil } + sort.Sort(versions) + return versions[len(versions)-1] } From 7e602389d908fcef515c8b3acd0aca4c66c842df Mon Sep 17 00:00:00 2001 From: ajanikow <12255597+ajanikow@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:35:16 +0000 Subject: [PATCH 50/50] Updated to 1.2.43 --- README.md | 36 +- VERSION | 2 +- chart/kube-arangodb-arm64/Chart.yaml | 2 +- chart/kube-arangodb-arm64/values.yaml | 2 +- chart/kube-arangodb-crd/Chart.yaml | 2 +- .../kube-arangodb-enterprise-arm64/Chart.yaml | 2 +- .../values.yaml | 2 +- chart/kube-arangodb-enterprise/Chart.yaml | 2 +- chart/kube-arangodb-enterprise/values.yaml | 2 +- chart/kube-arangodb/Chart.yaml | 2 +- chart/kube-arangodb/values.yaml | 2 +- docs/api/ArangoBackup.V1.md | 62 +- docs/api/ArangoBackupPolicy.V1.md | 32 +- docs/api/ArangoDeployment.V1.md | 1518 ++++++++--------- docs/api/ArangoDeploymentReplication.V1.md | 24 +- docs/api/ArangoJob.V1.md | 4 +- docs/api/ArangoLocalStorage.V1Alpha.md | 16 +- docs/api/ArangoMLBatchJob.V1Alpha1.md | 14 +- docs/api/ArangoMLCronJob.V1Alpha1.md | 14 +- docs/api/ArangoMLExtension.V1Alpha1.md | 606 +++---- docs/api/ArangoMLExtension.V1Beta1.md | 650 +++---- docs/api/ArangoMLStorage.V1Alpha1.md | 62 +- docs/api/ArangoMLStorage.V1Beta1.md | 28 +- docs/api/ArangoMember.V1.md | 20 +- docs/api/ArangoProfile.V1Alpha1.md | 72 +- docs/api/ArangoProfile.V1Beta1.md | 74 +- docs/api/ArangoRoute.V1Alpha1.md | 58 +- docs/api/GraphAnalyticsEngine.V1Alpha1.md | 152 +- examples/reboot-pod.yaml | 2 +- manifests/arango-all.yaml | 494 +++++- manifests/arango-apps.yaml | 69 +- manifests/arango-backup.yaml | 64 +- manifests/arango-crd.yaml | 120 ++ manifests/arango-deployment-replication.yaml | 63 +- manifests/arango-deployment.yaml | 294 +++- manifests/arango-k2kclustersync.yaml | 67 +- manifests/arango-ml.yaml | 68 +- manifests/arango-storage.yaml | 69 +- manifests/enterprise-all.yaml | 494 +++++- manifests/enterprise-apps.yaml | 69 +- manifests/enterprise-backup.yaml | 64 +- manifests/enterprise-crd.yaml | 120 ++ .../enterprise-deployment-replication.yaml | 63 +- manifests/enterprise-deployment.yaml | 294 +++- manifests/enterprise-k2kclustersync.yaml | 67 +- manifests/enterprise-ml.yaml | 68 +- manifests/enterprise-storage.yaml | 69 +- .../all/enterprise-all.yaml | 494 +++++- .../apps/enterprise-apps.yaml | 69 +- .../backup/enterprise-backup.yaml | 64 +- .../crd/enterprise-crd.yaml | 120 ++ .../enterprise-deployment-replication.yaml | 63 +- .../deployment/enterprise-deployment.yaml | 294 +++- .../enterprise-k2kclustersync.yaml | 67 +- .../storage/enterprise-storage.yaml | 69 +- manifests/kustomize/all/arango-all.yaml | 494 +++++- manifests/kustomize/apps/arango-apps.yaml | 69 +- manifests/kustomize/apps/arango-ml.yaml | 68 +- manifests/kustomize/apps/enterprise-ml.yaml | 68 +- manifests/kustomize/backup/arango-backup.yaml | 64 +- manifests/kustomize/crd/arango-crd.yaml | 120 ++ .../arango-deployment-replication.yaml | 63 +- .../deployment/arango-deployment.yaml | 294 +++- .../k2kclustersync/arango-k2kclustersync.yaml | 67 +- .../kustomize/storage/arango-storage.yaml | 69 +- pkg/operatorV2/handler_p0.generated.go | 20 - pkg/operatorV2/handler_p1.generated.go | 20 - pkg/operatorV2/handler_p2.generated.go | 20 - pkg/operatorV2/handler_p3.generated.go | 20 - pkg/operatorV2/handler_p4.generated.go | 20 - pkg/operatorV2/handler_p5.generated.go | 20 - pkg/operatorV2/handler_p6.generated.go | 20 - pkg/operatorV2/handler_p7.generated.go | 20 - pkg/operatorV2/handler_p8.generated.go | 20 - pkg/operatorV2/handler_p9.generated.go | 20 - 75 files changed, 6124 insertions(+), 2772 deletions(-) diff --git a/README.md b/README.md index 8568367b9..6970c8817 100644 --- a/README.md +++ b/README.md @@ -239,8 +239,8 @@ Flags: ### Installation and Usage Docker images: -- Community Edition: `arangodb/kube-arangodb:1.2.42` -- Enterprise Edition: `arangodb/kube-arangodb-enterprise:1.2.42` +- Community Edition: `arangodb/kube-arangodb:1.2.43` +- Enterprise Edition: `arangodb/kube-arangodb-enterprise:1.2.43` ### Installation of latest release using Kubectl @@ -249,22 +249,22 @@ running ArangoDB deployments. ##### Community Edition ```bash -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/arango-crd.yaml -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/arango-deployment.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/arango-crd.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/arango-deployment.yaml # To use `ArangoLocalStorage`, also run -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/arango-storage.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/arango-storage.yaml # To use `ArangoDeploymentReplication`, also run -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/arango-deployment-replication.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/arango-deployment-replication.yaml ``` ##### Enterprise Edition ```bash -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/enterprise-crd.yaml -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/enterprise-deployment.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/enterprise-crd.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/enterprise-deployment.yaml # To use `ArangoLocalStorage`, also run -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/enterprise-storage.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/enterprise-storage.yaml # To use `ArangoDeploymentReplication`, also run -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.42/manifests/enterprise-deployment-replication.yaml +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/1.2.43/manifests/enterprise-deployment-replication.yaml ``` ### Installation of latest release using kustomize @@ -330,17 +330,17 @@ helm install --generate-name kube-arangodb/kube-arangodb-enterprise --set "opera ##### Community Edition ```bash # The following will install the operator and basic CRDs resources. -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-1.2.42.tgz +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-1.2.43.tgz # To use `ArangoLocalStorage`, set field `operator.features.storage` to true -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-1.2.42.tgz --set "operator.features.storage=true" +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-1.2.43.tgz --set "operator.features.storage=true" ``` ##### Enterprise Edition ```bash # The following will install the operator and basic CRDs resources. -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-enterprise-1.2.43.tgz # To use `ArangoLocalStorage`, set field `operator.features.storage` to true -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz --set "operator.features.storage=true" +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-enterprise-1.2.43.tgz --set "operator.features.storage=true" ``` ### Upgrading the operator using Helm @@ -369,17 +369,17 @@ Then you can install the new version with `helm install` as normal: ##### Community Edition ```bash # The following will install the operator and basic CRDs resources. -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-1.2.42.tgz +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-1.2.43.tgz # To use `ArangoLocalStorage`, set field `operator.features.storage` to true -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-1.2.42.tgz --set "operator.features.storage=true" +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-1.2.43.tgz --set "operator.features.storage=true" ``` ##### Enterprise Edition ```bash # The following will install the operator and basic CRDs resources. -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-enterprise-1.2.43.tgz # To use `ArangoLocalStorage`, set field `operator.features.storage` to true -helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.42/kube-arangodb-enterprise-1.2.42.tgz --set "operator.features.storage=true" +helm install --generate-name https://github.com/arangodb/kube-arangodb/releases/download/1.2.43/kube-arangodb-enterprise-1.2.43.tgz --set "operator.features.storage=true" ``` ## Building diff --git a/VERSION b/VERSION index 758f2e3d5..bb3653fe5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.43-preview-2+git \ No newline at end of file +1.2.43 \ No newline at end of file diff --git a/chart/kube-arangodb-arm64/Chart.yaml b/chart/kube-arangodb-arm64/Chart.yaml index 0c6e11c68..0623b1c69 100644 --- a/chart/kube-arangodb-arm64/Chart.yaml +++ b/chart/kube-arangodb-arm64/Chart.yaml @@ -1,5 +1,5 @@ # do not switch to V2 yet - we still need to support Helm 2 apiVersion: v1 name: kube-arangodb-arm64 -version: 1.2.42 +version: 1.2.43 description: "ArangoDB Kubernetes Operator with ARM64 defaults" diff --git a/chart/kube-arangodb-arm64/values.yaml b/chart/kube-arangodb-arm64/values.yaml index f509a510f..72ec93fbb 100644 --- a/chart/kube-arangodb-arm64/values.yaml +++ b/chart/kube-arangodb-arm64/values.yaml @@ -1,5 +1,5 @@ operator: - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 imagePullPolicy: IfNotPresent imagePullSecrets: [] scope: legacy diff --git a/chart/kube-arangodb-crd/Chart.yaml b/chart/kube-arangodb-crd/Chart.yaml index 373171942..ae6470d0c 100644 --- a/chart/kube-arangodb-crd/Chart.yaml +++ b/chart/kube-arangodb-crd/Chart.yaml @@ -1,5 +1,5 @@ name: kube-arangodb-crd -version: 1.2.42 +version: 1.2.43 description: "ArangoDB Kubernetes Custom Resource Definitions (Deprecated)" tillerVersion: ">2.7" appVersion: 3.5.0 diff --git a/chart/kube-arangodb-enterprise-arm64/Chart.yaml b/chart/kube-arangodb-enterprise-arm64/Chart.yaml index aa7c7d933..d059fd986 100644 --- a/chart/kube-arangodb-enterprise-arm64/Chart.yaml +++ b/chart/kube-arangodb-enterprise-arm64/Chart.yaml @@ -1,5 +1,5 @@ # do not switch to V2 yet - we still need to support Helm 2 apiVersion: v1 name: kube-arangodb-enterprise-arm64 -version: 1.2.42 +version: 1.2.43 description: "ArangoDB Kubernetes Enterprise Operator with ARM64 defaults" diff --git a/chart/kube-arangodb-enterprise-arm64/values.yaml b/chart/kube-arangodb-enterprise-arm64/values.yaml index 96f6e6b16..1588dc4c2 100644 --- a/chart/kube-arangodb-enterprise-arm64/values.yaml +++ b/chart/kube-arangodb-enterprise-arm64/values.yaml @@ -1,5 +1,5 @@ operator: - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 imagePullPolicy: IfNotPresent imagePullSecrets: [] scope: legacy diff --git a/chart/kube-arangodb-enterprise/Chart.yaml b/chart/kube-arangodb-enterprise/Chart.yaml index d57271884..681878d7f 100644 --- a/chart/kube-arangodb-enterprise/Chart.yaml +++ b/chart/kube-arangodb-enterprise/Chart.yaml @@ -1,5 +1,5 @@ # do not switch to V2 yet - we still need to support Helm 2 apiVersion: v1 name: kube-arangodb-enterprise -version: 1.2.42 +version: 1.2.43 description: "ArangoDB Kubernetes Enterprise Operator" diff --git a/chart/kube-arangodb-enterprise/values.yaml b/chart/kube-arangodb-enterprise/values.yaml index 92ae2b0a1..838e191c3 100644 --- a/chart/kube-arangodb-enterprise/values.yaml +++ b/chart/kube-arangodb-enterprise/values.yaml @@ -1,5 +1,5 @@ operator: - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 imagePullPolicy: IfNotPresent imagePullSecrets: [] scope: legacy diff --git a/chart/kube-arangodb/Chart.yaml b/chart/kube-arangodb/Chart.yaml index 1c26a2489..35fbe6ed1 100644 --- a/chart/kube-arangodb/Chart.yaml +++ b/chart/kube-arangodb/Chart.yaml @@ -1,5 +1,5 @@ # do not switch to V2 yet - we still need to support Helm 2 apiVersion: v1 name: kube-arangodb -version: 1.2.42 +version: 1.2.43 description: "ArangoDB Kubernetes Operator" diff --git a/chart/kube-arangodb/values.yaml b/chart/kube-arangodb/values.yaml index 980cd6866..eb822d04b 100644 --- a/chart/kube-arangodb/values.yaml +++ b/chart/kube-arangodb/values.yaml @@ -1,5 +1,5 @@ operator: - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 imagePullPolicy: IfNotPresent imagePullSecrets: [] scope: legacy diff --git a/docs/api/ArangoBackup.V1.md b/docs/api/ArangoBackup.V1.md index 9ff2e670a..e7951833c 100644 --- a/docs/api/ArangoBackup.V1.md +++ b/docs/api/ArangoBackup.V1.md @@ -10,7 +10,7 @@ title: ArangoBackup V1 ### .spec.backoff.iterations -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L31) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L31) Iterations defines number of iterations before reaching MaxDelay. Default to 5 @@ -18,7 +18,7 @@ Iterations defines number of iterations before reaching MaxDelay. Default to 5 ### .spec.backoff.max_delay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L29) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L29) MaxDelay defines maximum delay in seconds. Default to 600 @@ -26,7 +26,7 @@ MaxDelay defines maximum delay in seconds. Default to 600 ### .spec.backoff.max_iterations -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L33) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L33) MaxIterations defines maximum number of iterations after backoff will be disabled. Default to nil (no limit) @@ -34,7 +34,7 @@ MaxIterations defines maximum number of iterations after backoff will be disable ### .spec.backoff.min_delay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L27) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L27) MinDelay defines minimum delay in seconds. Default to 30 @@ -42,7 +42,7 @@ MinDelay defines minimum delay in seconds. Default to 30 ### .spec.deployment.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L54) Name of the ArangoDeployment Custom Resource within same namespace as ArangoBackup Custom Resource. @@ -52,7 +52,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.download.autoDelete -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L84) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L84) AutoDelete removes the ArangoBackup resource (which removes the backup from the cluster) after successful upload @@ -62,7 +62,7 @@ Default Value: `false` ### .spec.download.credentialsSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L81) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L81) CredentialsSecretName is the name of the secret used while accessing repository @@ -75,7 +75,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.download.id -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L92) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L92) ID of the ArangoBackup to be downloaded @@ -85,7 +85,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.download.repositoryURL -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L77) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L77) RepositoryURL is the URL path for file storage Same repositoryURL needs to be defined in `credentialsSecretName` if protocol is other than local. @@ -106,7 +106,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.lifetime -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L47) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L47) Lifetime is the time after which the backup will be deleted. Format: "1.5h" or "2h45m". @@ -114,7 +114,7 @@ Lifetime is the time after which the backup will be deleted. Format: "1.5h" or " ### .spec.options.allowInconsistent -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L66) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L66) AllowInconsistent flag for Backup creation request. If this value is set to true, backup is taken even if we are not able to acquire lock. @@ -127,7 +127,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.options.timeout -Type: `number` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L61) +Type: `number` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L61) Timeout for Backup creation request in seconds. Works only when AsyncBackupCreation feature is set to false. @@ -139,7 +139,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.policyName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L42) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L42) PolicyName name of the ArangoBackupPolicy which created this Custom Resource @@ -149,7 +149,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.upload.autoDelete -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L84) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L84) AutoDelete removes the ArangoBackup resource (which removes the backup from the cluster) after successful upload @@ -159,7 +159,7 @@ Default Value: `false` ### .spec.upload.credentialsSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L81) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L81) CredentialsSecretName is the name of the secret used while accessing repository @@ -172,7 +172,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.upload.repositoryURL -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L77) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L77) RepositoryURL is the URL path for file storage Same repositoryURL needs to be defined in `credentialsSecretName` if protocol is other than local. @@ -193,7 +193,7 @@ This field is **immutable**: can't be changed after backup creation ### .status.available -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L36) Available Determines if we can restore from ArangoBackup @@ -201,13 +201,13 @@ Available Determines if we can restore from ArangoBackup ### .status.backoff.iterations -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status_backoff.go#L30) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status_backoff.go#L30) *** ### .status.backup.downloaded -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L66) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L66) Downloaded Determines if ArangoBackup has been downloaded. @@ -215,25 +215,25 @@ Downloaded Determines if ArangoBackup has been downloaded. ### .status.backup.id -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L56) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L56) *** ### .status.backup.imported -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L67) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L67) *** ### .status.backup.keys -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L70) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L70) *** ### .status.backup.numberOfDBServers -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L62) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L62) NumberOfDBServers Cluster size of the Backup in ArangoDB @@ -241,13 +241,13 @@ NumberOfDBServers Cluster size of the Backup in ArangoDB ### .status.backup.potentiallyInconsistent -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L58) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L58) *** ### .status.backup.sizeInBytes -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L60) SizeInBytes Size of the Backup in ArangoDB. @@ -255,7 +255,7 @@ SizeInBytes Size of the Backup in ArangoDB. ### .status.backup.uploaded -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L64) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L64) Uploaded Determines if ArangoBackup has been uploaded @@ -263,13 +263,13 @@ Uploaded Determines if ArangoBackup has been uploaded ### .status.backup.version -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_status.go#L57) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_status.go#L57) *** ### .status.message -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_state.go#L91) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_state.go#L91) Message for the state this object is in. @@ -277,7 +277,7 @@ Message for the state this object is in. ### .status.progress.jobID -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_state.go#L114) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_state.go#L114) JobID ArangoDB job ID for uploading or downloading @@ -285,7 +285,7 @@ JobID ArangoDB job ID for uploading or downloading ### .status.progress.progress -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_state.go#L117) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_state.go#L117) Progress ArangoDB job progress in percents @@ -298,7 +298,7 @@ Example: ### .status.state -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_state.go#L85) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_state.go#L85) State holds the current high level state of the backup diff --git a/docs/api/ArangoBackupPolicy.V1.md b/docs/api/ArangoBackupPolicy.V1.md index f99e9fdaa..fdf6f2760 100644 --- a/docs/api/ArangoBackupPolicy.V1.md +++ b/docs/api/ArangoBackupPolicy.V1.md @@ -10,7 +10,7 @@ title: ArangoBackupPolicy V1 ### .spec.allowConcurrent -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_policy_spec.go#L35) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_policy_spec.go#L35) AllowConcurrent if false, ArangoBackup will not be created when previous Backups are not finished @@ -20,7 +20,7 @@ Default Value: `true` ### .spec.maxBackups -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_policy_spec.go#L43) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_policy_spec.go#L43) MaxBackups defines how many backups should be kept in history (per deployment). Oldest healthy Backups will be deleted. If not specified or 0 then no limit is applied @@ -31,7 +31,7 @@ Default Value: `0` ### .spec.schedule -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_policy_spec.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_policy_spec.go#L32) Schedule is cron-compatible specification of backup schedule Parsed by https://godoc.org/github.com/robfig/cron @@ -40,7 +40,7 @@ Parsed by https://godoc.org/github.com/robfig/cron ### .spec.selector -Type: `meta.LabelSelector` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_policy_spec.go#L39) +Type: `meta.LabelSelector` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_policy_spec.go#L39) DeploymentSelector Selector definition for selecting matching ArangoBackup Custom Resources. @@ -51,7 +51,7 @@ Links: ### .spec.template.backoff.iterations -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L31) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L31) Iterations defines number of iterations before reaching MaxDelay. Default to 5 @@ -59,7 +59,7 @@ Iterations defines number of iterations before reaching MaxDelay. Default to 5 ### .spec.template.backoff.max_delay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L29) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L29) MaxDelay defines maximum delay in seconds. Default to 600 @@ -67,7 +67,7 @@ MaxDelay defines maximum delay in seconds. Default to 600 ### .spec.template.backoff.max_iterations -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L33) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L33) MaxIterations defines maximum number of iterations after backoff will be disabled. Default to nil (no limit) @@ -75,7 +75,7 @@ MaxIterations defines maximum number of iterations after backoff will be disable ### .spec.template.backoff.min_delay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec_backoff.go#L27) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec_backoff.go#L27) MinDelay defines minimum delay in seconds. Default to 30 @@ -83,7 +83,7 @@ MinDelay defines minimum delay in seconds. Default to 30 ### .spec.template.lifetime -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_policy_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_policy_spec.go#L61) Lifetime is the time after which the backup will be deleted. Format: "1.5h" or "2h45m". @@ -91,7 +91,7 @@ Lifetime is the time after which the backup will be deleted. Format: "1.5h" or " ### .spec.template.options.allowInconsistent -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L66) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L66) AllowInconsistent flag for Backup creation request. If this value is set to true, backup is taken even if we are not able to acquire lock. @@ -104,7 +104,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.template.options.timeout -Type: `number` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L61) +Type: `number` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L61) Timeout for Backup creation request in seconds. Works only when AsyncBackupCreation feature is set to false. @@ -116,7 +116,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.template.upload.autoDelete -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L84) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L84) AutoDelete removes the ArangoBackup resource (which removes the backup from the cluster) after successful upload @@ -126,7 +126,7 @@ Default Value: `false` ### .spec.template.upload.credentialsSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L81) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L81) CredentialsSecretName is the name of the secret used while accessing repository @@ -139,7 +139,7 @@ This field is **immutable**: can't be changed after backup creation ### .spec.template.upload.repositoryURL -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_spec.go#L77) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_spec.go#L77) RepositoryURL is the URL path for file storage Same repositoryURL needs to be defined in `credentialsSecretName` if protocol is other than local. @@ -160,7 +160,7 @@ This field is **immutable**: can't be changed after backup creation ### .status.message -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_policy_status.go#L33) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_policy_status.go#L33) Message from the operator in case of failures - schedule not valid, ArangoBackupPolicy not valid @@ -168,7 +168,7 @@ Message from the operator in case of failures - schedule not valid, ArangoBackup ### .status.scheduled -Type: `meta.Time` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/backup/v1/backup_policy_status.go#L31) +Type: `meta.Time` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/backup/v1/backup_policy_status.go#L31) Scheduled Next scheduled time in UTC diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 2e63316dd..da6cab973 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -10,7 +10,7 @@ title: ArangoDeployment V1 ### .spec.agents.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -21,7 +21,7 @@ Links: ### .spec.agents.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -32,7 +32,7 @@ This setting changes the member recreation logic based on group: ### .spec.agents.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -41,7 +41,7 @@ Annotations are merged with `spec.annotations`. ### .spec.agents.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -49,7 +49,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.agents.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -57,7 +57,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.agents.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -68,7 +68,7 @@ Links: ### .spec.agents.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -78,7 +78,7 @@ Default Value: `[]` ### .spec.agents.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -91,7 +91,7 @@ as for the `dbservers` group. ### .spec.agents.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -99,19 +99,19 @@ Entrypoint overrides container executable ### .spec.agents.envs\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L26) *** ### .spec.agents.envs\[int\].value -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L27) *** ### .spec.agents.ephemeralVolumes.apps.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -122,7 +122,7 @@ Links: ### .spec.agents.ephemeralVolumes.temp.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -133,7 +133,7 @@ Links: ### .spec.agents.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -141,7 +141,7 @@ ExporterPort define Port used by exporter ### .spec.agents.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -149,7 +149,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.agents.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -157,7 +157,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.agents.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -169,7 +169,7 @@ Possible Values: ### .spec.agents.initContainers.containers -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L91) Containers contains list of containers @@ -180,7 +180,7 @@ Links: ### .spec.agents.initContainers.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L94) Mode keep container replace mode @@ -188,7 +188,7 @@ Mode keep container replace mode ### .spec.agents.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -196,7 +196,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.agents.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -204,7 +204,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.agents.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -212,7 +212,7 @@ Labels specified the labels added to Pods in this group. ### .spec.agents.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -220,7 +220,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.agents.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -228,7 +228,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.agents.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -236,7 +236,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.agents.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -251,7 +251,7 @@ Default Value: `0` ### .spec.agents.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -259,7 +259,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.agents.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -270,7 +270,7 @@ Links: ### .spec.agents.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -281,7 +281,7 @@ Links: ### .spec.agents.numactl.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) Args define list of the numactl process @@ -291,7 +291,7 @@ Default Value: `[]` ### .spec.agents.numactl.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) Enabled define if numactl should be enabled @@ -301,7 +301,7 @@ Default Value: `false` ### .spec.agents.numactl.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) Path define numactl path within the container @@ -311,7 +311,7 @@ Default Value: `/usr/bin/numactl` ### .spec.agents.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -328,7 +328,7 @@ Default Value: `true` ### .spec.agents.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -345,19 +345,19 @@ Default Value: `true` ### .spec.agents.podModes.network -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) *** ### .spec.agents.podModes.pid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) *** ### .spec.agents.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -365,7 +365,7 @@ Port define Port used by member ### .spec.agents.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -377,7 +377,7 @@ Links: ### .spec.agents.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -387,7 +387,7 @@ Default Value: `false` ### .spec.agents.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -399,7 +399,7 @@ Default Value: `3` ### .spec.agents.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -410,7 +410,7 @@ Default Value: `2` ### .spec.agents.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -421,7 +421,7 @@ Default Value: `10` ### .spec.agents.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -432,7 +432,7 @@ Default Value: `1` ### .spec.agents.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -443,7 +443,7 @@ Default Value: `2` ### .spec.agents.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -456,7 +456,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.agents.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -464,7 +464,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.agents.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -476,7 +476,7 @@ Default Value: `3` ### .spec.agents.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -487,7 +487,7 @@ Default Value: `2` ### .spec.agents.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -498,7 +498,7 @@ Default Value: `10` ### .spec.agents.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -509,7 +509,7 @@ Default Value: `1` ### .spec.agents.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -520,7 +520,7 @@ Default Value: `2` ### .spec.agents.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -528,7 +528,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.agents.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -540,7 +540,7 @@ Default Value: `3` ### .spec.agents.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -551,7 +551,7 @@ Default Value: `2` ### .spec.agents.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -562,7 +562,7 @@ Default Value: `10` ### .spec.agents.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -573,7 +573,7 @@ Default Value: `1` ### .spec.agents.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -584,7 +584,7 @@ Default Value: `2` ### .spec.agents.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -596,7 +596,7 @@ Possible Values: ### .spec.agents.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -607,7 +607,7 @@ Links: ### .spec.agents.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -615,7 +615,7 @@ SchedulerName define scheduler name used for group ### .spec.agents.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -623,7 +623,7 @@ AddCapabilities add new capabilities to containers ### .spec.agents.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -631,7 +631,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.agents.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -644,7 +644,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.agents.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -652,7 +652,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.agents.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -661,7 +661,7 @@ essentially equivalent to root on the host. ### .spec.agents.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -669,7 +669,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.agents.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -677,7 +677,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.agents.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -685,7 +685,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.agents.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -693,7 +693,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.agents.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -704,7 +704,7 @@ Links: ### .spec.agents.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -715,7 +715,7 @@ Links: ### .spec.agents.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -724,7 +724,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.agents.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -745,7 +745,7 @@ sysctls: ### .spec.agents.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -760,7 +760,7 @@ to that service account. ### .spec.agents.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -768,7 +768,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.agents.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -776,7 +776,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.agents.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -785,7 +785,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.agents.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -796,7 +796,7 @@ Links: ### .spec.agents.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -809,7 +809,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.agents.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -817,7 +817,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.agents.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -833,7 +833,7 @@ Links: ### .spec.agents.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -846,7 +846,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.agents.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -862,7 +862,7 @@ Links: ### .spec.agents.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -873,7 +873,7 @@ Links: ### .spec.agents.volumes\[int\].configMap -Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L138) ConfigMap which should be mounted into pod @@ -884,7 +884,7 @@ Links: ### .spec.agents.volumes\[int\].emptyDir -Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L143) EmptyDir @@ -895,7 +895,7 @@ Links: ### .spec.agents.volumes\[int\].hostPath -Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L148) HostPath @@ -906,7 +906,7 @@ Links: ### .spec.agents.volumes\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L128) Name of volume @@ -914,7 +914,7 @@ Name of volume ### .spec.agents.volumes\[int\].persistentVolumeClaim -Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L153) PersistentVolumeClaim @@ -925,7 +925,7 @@ Links: ### .spec.agents.volumes\[int\].secret -Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L133) Secret which should be mounted into pod @@ -936,7 +936,7 @@ Links: ### .spec.allowUnsafeUpgrade -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L152) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L152) AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed @@ -944,7 +944,7 @@ AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync s ### .spec.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L115) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L115) Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVC’s, PDB’s). @@ -952,7 +952,7 @@ Annotations specifies the annotations added to all ArangoDeployment owned resour ### .spec.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L118) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L118) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -960,7 +960,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L124) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L124) AnnotationsMode defines annotations mode which should be use while overriding annotations. @@ -973,7 +973,7 @@ Possible Values: ### .spec.architecture -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L257) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L257) Architecture defines the list of supported architectures. First element on the list is marked as default architecture. @@ -994,7 +994,7 @@ Default Value: `['amd64']` ### .spec.auth.jwtSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/authentication_spec.go#L38) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/authentication_spec.go#L38) JWTSecretName setting specifies the name of a kubernetes `Secret` that contains a secret key used for generating JWT tokens to access all ArangoDB servers. @@ -1008,7 +1008,7 @@ Changing secret key results in restarting of a whole cluster. ### .spec.bootstrap.passwordSecretNames -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/bootstrap.go#L62) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/bootstrap.go#L62) PasswordSecretNames contains a map of username to password-secret-name This setting specifies a secret name for the credentials per specific users. @@ -1026,7 +1026,7 @@ Links: ### .spec.chaos.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/chaos_spec.go#L33) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/chaos_spec.go#L33) Enabled switches the chaos monkey for a deployment on or off. @@ -1034,7 +1034,7 @@ Enabled switches the chaos monkey for a deployment on or off. ### .spec.chaos.interval -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/chaos_spec.go#L35) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/chaos_spec.go#L35) Interval is the time between events @@ -1042,7 +1042,7 @@ Interval is the time between events ### .spec.chaos.kill-pod-probability -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/chaos_spec.go#L37) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/chaos_spec.go#L37) KillPodProbability is the chance of a pod being killed during an event @@ -1050,7 +1050,7 @@ KillPodProbability is the chance of a pod being killed during an event ### .spec.ClusterDomain -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L229) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L229) ClusterDomain define domain used in the kubernetes cluster. Required only of domain is not set to default (cluster.local) @@ -1061,7 +1061,7 @@ Default Value: `cluster.local` ### .spec.communicationMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L237) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L237) CommunicationMethod define communication method used in deployment @@ -1076,7 +1076,7 @@ Possible Values: ### .spec.coordinators.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -1087,7 +1087,7 @@ Links: ### .spec.coordinators.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -1098,7 +1098,7 @@ This setting changes the member recreation logic based on group: ### .spec.coordinators.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -1107,7 +1107,7 @@ Annotations are merged with `spec.annotations`. ### .spec.coordinators.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -1115,7 +1115,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.coordinators.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -1123,7 +1123,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.coordinators.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -1134,7 +1134,7 @@ Links: ### .spec.coordinators.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -1144,7 +1144,7 @@ Default Value: `[]` ### .spec.coordinators.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -1157,7 +1157,7 @@ as for the `dbservers` group. ### .spec.coordinators.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -1165,19 +1165,19 @@ Entrypoint overrides container executable ### .spec.coordinators.envs\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L26) *** ### .spec.coordinators.envs\[int\].value -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L27) *** ### .spec.coordinators.ephemeralVolumes.apps.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -1188,7 +1188,7 @@ Links: ### .spec.coordinators.ephemeralVolumes.temp.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -1199,7 +1199,7 @@ Links: ### .spec.coordinators.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -1207,7 +1207,7 @@ ExporterPort define Port used by exporter ### .spec.coordinators.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -1215,7 +1215,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.coordinators.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -1223,7 +1223,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.coordinators.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -1235,7 +1235,7 @@ Possible Values: ### .spec.coordinators.initContainers.containers -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L91) Containers contains list of containers @@ -1246,7 +1246,7 @@ Links: ### .spec.coordinators.initContainers.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L94) Mode keep container replace mode @@ -1254,7 +1254,7 @@ Mode keep container replace mode ### .spec.coordinators.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -1262,7 +1262,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.coordinators.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -1270,7 +1270,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.coordinators.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -1278,7 +1278,7 @@ Labels specified the labels added to Pods in this group. ### .spec.coordinators.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -1286,7 +1286,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.coordinators.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -1294,7 +1294,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.coordinators.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -1302,7 +1302,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.coordinators.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -1317,7 +1317,7 @@ Default Value: `0` ### .spec.coordinators.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -1325,7 +1325,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.coordinators.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -1336,7 +1336,7 @@ Links: ### .spec.coordinators.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -1347,7 +1347,7 @@ Links: ### .spec.coordinators.numactl.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) Args define list of the numactl process @@ -1357,7 +1357,7 @@ Default Value: `[]` ### .spec.coordinators.numactl.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) Enabled define if numactl should be enabled @@ -1367,7 +1367,7 @@ Default Value: `false` ### .spec.coordinators.numactl.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) Path define numactl path within the container @@ -1377,7 +1377,7 @@ Default Value: `/usr/bin/numactl` ### .spec.coordinators.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -1394,7 +1394,7 @@ Default Value: `true` ### .spec.coordinators.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -1411,19 +1411,19 @@ Default Value: `true` ### .spec.coordinators.podModes.network -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) *** ### .spec.coordinators.podModes.pid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) *** ### .spec.coordinators.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -1431,7 +1431,7 @@ Port define Port used by member ### .spec.coordinators.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -1443,7 +1443,7 @@ Links: ### .spec.coordinators.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -1453,7 +1453,7 @@ Default Value: `false` ### .spec.coordinators.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -1465,7 +1465,7 @@ Default Value: `3` ### .spec.coordinators.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -1476,7 +1476,7 @@ Default Value: `2` ### .spec.coordinators.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -1487,7 +1487,7 @@ Default Value: `10` ### .spec.coordinators.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -1498,7 +1498,7 @@ Default Value: `1` ### .spec.coordinators.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -1509,7 +1509,7 @@ Default Value: `2` ### .spec.coordinators.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -1522,7 +1522,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.coordinators.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -1530,7 +1530,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.coordinators.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -1542,7 +1542,7 @@ Default Value: `3` ### .spec.coordinators.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -1553,7 +1553,7 @@ Default Value: `2` ### .spec.coordinators.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -1564,7 +1564,7 @@ Default Value: `10` ### .spec.coordinators.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -1575,7 +1575,7 @@ Default Value: `1` ### .spec.coordinators.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -1586,7 +1586,7 @@ Default Value: `2` ### .spec.coordinators.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -1594,7 +1594,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.coordinators.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -1606,7 +1606,7 @@ Default Value: `3` ### .spec.coordinators.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -1617,7 +1617,7 @@ Default Value: `2` ### .spec.coordinators.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -1628,7 +1628,7 @@ Default Value: `10` ### .spec.coordinators.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -1639,7 +1639,7 @@ Default Value: `1` ### .spec.coordinators.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -1650,7 +1650,7 @@ Default Value: `2` ### .spec.coordinators.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -1662,7 +1662,7 @@ Possible Values: ### .spec.coordinators.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -1673,7 +1673,7 @@ Links: ### .spec.coordinators.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -1681,7 +1681,7 @@ SchedulerName define scheduler name used for group ### .spec.coordinators.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -1689,7 +1689,7 @@ AddCapabilities add new capabilities to containers ### .spec.coordinators.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -1697,7 +1697,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.coordinators.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -1710,7 +1710,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.coordinators.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -1718,7 +1718,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.coordinators.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -1727,7 +1727,7 @@ essentially equivalent to root on the host. ### .spec.coordinators.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -1735,7 +1735,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.coordinators.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -1743,7 +1743,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.coordinators.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -1751,7 +1751,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.coordinators.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -1759,7 +1759,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.coordinators.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -1770,7 +1770,7 @@ Links: ### .spec.coordinators.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -1781,7 +1781,7 @@ Links: ### .spec.coordinators.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -1790,7 +1790,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.coordinators.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -1811,7 +1811,7 @@ sysctls: ### .spec.coordinators.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -1826,7 +1826,7 @@ to that service account. ### .spec.coordinators.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -1834,7 +1834,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.coordinators.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -1842,7 +1842,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.coordinators.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -1851,7 +1851,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.coordinators.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -1862,7 +1862,7 @@ Links: ### .spec.coordinators.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -1875,7 +1875,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.coordinators.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -1883,7 +1883,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.coordinators.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -1899,7 +1899,7 @@ Links: ### .spec.coordinators.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -1912,7 +1912,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.coordinators.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -1928,7 +1928,7 @@ Links: ### .spec.coordinators.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -1939,7 +1939,7 @@ Links: ### .spec.coordinators.volumes\[int\].configMap -Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L138) ConfigMap which should be mounted into pod @@ -1950,7 +1950,7 @@ Links: ### .spec.coordinators.volumes\[int\].emptyDir -Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L143) EmptyDir @@ -1961,7 +1961,7 @@ Links: ### .spec.coordinators.volumes\[int\].hostPath -Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L148) HostPath @@ -1972,7 +1972,7 @@ Links: ### .spec.coordinators.volumes\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L128) Name of volume @@ -1980,7 +1980,7 @@ Name of volume ### .spec.coordinators.volumes\[int\].persistentVolumeClaim -Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L153) PersistentVolumeClaim @@ -1991,7 +1991,7 @@ Links: ### .spec.coordinators.volumes\[int\].secret -Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L133) Secret which should be mounted into pod @@ -2002,7 +2002,7 @@ Links: ### .spec.database.maintenance -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/database_spec.go#L25) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/database_spec.go#L25) Maintenance manage maintenance mode on Cluster side. Requires maintenance feature to be enabled @@ -2010,7 +2010,7 @@ Maintenance manage maintenance mode on Cluster side. Requires maintenance featur ### .spec.dbservers.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -2021,7 +2021,7 @@ Links: ### .spec.dbservers.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -2032,7 +2032,7 @@ This setting changes the member recreation logic based on group: ### .spec.dbservers.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -2041,7 +2041,7 @@ Annotations are merged with `spec.annotations`. ### .spec.dbservers.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -2049,7 +2049,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.dbservers.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -2057,7 +2057,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.dbservers.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -2068,7 +2068,7 @@ Links: ### .spec.dbservers.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -2078,7 +2078,7 @@ Default Value: `[]` ### .spec.dbservers.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -2091,7 +2091,7 @@ as for the `dbservers` group. ### .spec.dbservers.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -2099,19 +2099,19 @@ Entrypoint overrides container executable ### .spec.dbservers.envs\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L26) *** ### .spec.dbservers.envs\[int\].value -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L27) *** ### .spec.dbservers.ephemeralVolumes.apps.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -2122,7 +2122,7 @@ Links: ### .spec.dbservers.ephemeralVolumes.temp.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -2133,7 +2133,7 @@ Links: ### .spec.dbservers.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -2141,7 +2141,7 @@ ExporterPort define Port used by exporter ### .spec.dbservers.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -2149,7 +2149,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.dbservers.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -2157,7 +2157,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.dbservers.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -2169,7 +2169,7 @@ Possible Values: ### .spec.dbservers.initContainers.containers -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L91) Containers contains list of containers @@ -2180,7 +2180,7 @@ Links: ### .spec.dbservers.initContainers.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L94) Mode keep container replace mode @@ -2188,7 +2188,7 @@ Mode keep container replace mode ### .spec.dbservers.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -2196,7 +2196,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.dbservers.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -2204,7 +2204,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.dbservers.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -2212,7 +2212,7 @@ Labels specified the labels added to Pods in this group. ### .spec.dbservers.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -2220,7 +2220,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.dbservers.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -2228,7 +2228,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.dbservers.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -2236,7 +2236,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.dbservers.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -2251,7 +2251,7 @@ Default Value: `0` ### .spec.dbservers.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -2259,7 +2259,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.dbservers.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -2270,7 +2270,7 @@ Links: ### .spec.dbservers.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -2281,7 +2281,7 @@ Links: ### .spec.dbservers.numactl.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) Args define list of the numactl process @@ -2291,7 +2291,7 @@ Default Value: `[]` ### .spec.dbservers.numactl.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) Enabled define if numactl should be enabled @@ -2301,7 +2301,7 @@ Default Value: `false` ### .spec.dbservers.numactl.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) Path define numactl path within the container @@ -2311,7 +2311,7 @@ Default Value: `/usr/bin/numactl` ### .spec.dbservers.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -2328,7 +2328,7 @@ Default Value: `true` ### .spec.dbservers.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -2345,19 +2345,19 @@ Default Value: `true` ### .spec.dbservers.podModes.network -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) *** ### .spec.dbservers.podModes.pid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) *** ### .spec.dbservers.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -2365,7 +2365,7 @@ Port define Port used by member ### .spec.dbservers.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -2377,7 +2377,7 @@ Links: ### .spec.dbservers.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -2387,7 +2387,7 @@ Default Value: `false` ### .spec.dbservers.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -2399,7 +2399,7 @@ Default Value: `3` ### .spec.dbservers.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -2410,7 +2410,7 @@ Default Value: `2` ### .spec.dbservers.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -2421,7 +2421,7 @@ Default Value: `10` ### .spec.dbservers.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -2432,7 +2432,7 @@ Default Value: `1` ### .spec.dbservers.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -2443,7 +2443,7 @@ Default Value: `2` ### .spec.dbservers.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -2456,7 +2456,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.dbservers.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -2464,7 +2464,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.dbservers.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -2476,7 +2476,7 @@ Default Value: `3` ### .spec.dbservers.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -2487,7 +2487,7 @@ Default Value: `2` ### .spec.dbservers.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -2498,7 +2498,7 @@ Default Value: `10` ### .spec.dbservers.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -2509,7 +2509,7 @@ Default Value: `1` ### .spec.dbservers.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -2520,7 +2520,7 @@ Default Value: `2` ### .spec.dbservers.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -2528,7 +2528,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.dbservers.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -2540,7 +2540,7 @@ Default Value: `3` ### .spec.dbservers.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -2551,7 +2551,7 @@ Default Value: `2` ### .spec.dbservers.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -2562,7 +2562,7 @@ Default Value: `10` ### .spec.dbservers.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -2573,7 +2573,7 @@ Default Value: `1` ### .spec.dbservers.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -2584,7 +2584,7 @@ Default Value: `2` ### .spec.dbservers.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -2596,7 +2596,7 @@ Possible Values: ### .spec.dbservers.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -2607,7 +2607,7 @@ Links: ### .spec.dbservers.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -2615,7 +2615,7 @@ SchedulerName define scheduler name used for group ### .spec.dbservers.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -2623,7 +2623,7 @@ AddCapabilities add new capabilities to containers ### .spec.dbservers.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -2631,7 +2631,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.dbservers.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -2644,7 +2644,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.dbservers.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -2652,7 +2652,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.dbservers.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -2661,7 +2661,7 @@ essentially equivalent to root on the host. ### .spec.dbservers.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -2669,7 +2669,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.dbservers.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -2677,7 +2677,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.dbservers.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -2685,7 +2685,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.dbservers.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -2693,7 +2693,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.dbservers.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -2704,7 +2704,7 @@ Links: ### .spec.dbservers.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -2715,7 +2715,7 @@ Links: ### .spec.dbservers.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -2724,7 +2724,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.dbservers.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -2745,7 +2745,7 @@ sysctls: ### .spec.dbservers.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -2760,7 +2760,7 @@ to that service account. ### .spec.dbservers.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -2768,7 +2768,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.dbservers.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -2776,7 +2776,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.dbservers.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -2785,7 +2785,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.dbservers.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -2796,7 +2796,7 @@ Links: ### .spec.dbservers.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -2809,7 +2809,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.dbservers.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -2817,7 +2817,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.dbservers.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -2833,7 +2833,7 @@ Links: ### .spec.dbservers.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -2846,7 +2846,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.dbservers.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -2862,7 +2862,7 @@ Links: ### .spec.dbservers.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -2873,7 +2873,7 @@ Links: ### .spec.dbservers.volumes\[int\].configMap -Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L138) ConfigMap which should be mounted into pod @@ -2884,7 +2884,7 @@ Links: ### .spec.dbservers.volumes\[int\].emptyDir -Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L143) EmptyDir @@ -2895,7 +2895,7 @@ Links: ### .spec.dbservers.volumes\[int\].hostPath -Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L148) HostPath @@ -2906,7 +2906,7 @@ Links: ### .spec.dbservers.volumes\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L128) Name of volume @@ -2914,7 +2914,7 @@ Name of volume ### .spec.dbservers.volumes\[int\].persistentVolumeClaim -Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L153) PersistentVolumeClaim @@ -2925,7 +2925,7 @@ Links: ### .spec.dbservers.volumes\[int\].secret -Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L133) Secret which should be mounted into pod @@ -2936,7 +2936,7 @@ Links: ### .spec.disableIPv6 -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L98) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L98) DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers. This setting cannot be changed after the deployment has been created. @@ -2947,7 +2947,7 @@ Default Value: `false` ### .spec.downtimeAllowed -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L93) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L93) DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment. When this setting is set to false, no automatic action that may result in downtime is allowed. @@ -2963,7 +2963,7 @@ Default Value: `false` ### .spec.environment -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L54) Environment setting specifies the type of environment in which the deployment is created. @@ -2975,7 +2975,7 @@ Possible Values: ### .spec.externalAccess.advertisedEndpoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L58) AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint @@ -2983,7 +2983,7 @@ AdvertisedEndpoint is passed to the coordinators/single servers for advertising ### .spec.externalAccess.loadBalancerIP -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L48) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L48) LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. @@ -2992,7 +2992,7 @@ If you do not specify this setting, an IP will be chosen automatically by the lo ### .spec.externalAccess.loadBalancerSourceRanges -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L55) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L55) LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type If specified and supported by the platform, this will restrict traffic through the cloud-provider @@ -3006,7 +3006,7 @@ Links: ### .spec.externalAccess.managedServiceNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L62) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L62) ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. It is only relevant when type of service is `managed`. @@ -3015,7 +3015,7 @@ It is only relevant when type of service is `managed`. ### .spec.externalAccess.nodePort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L44) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L44) NodePort define optional port used in case of Auto or NodePort type. This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. @@ -3025,7 +3025,7 @@ If you do not specify this setting, a random port will be chosen automatically. ### .spec.externalAccess.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L39) Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. @@ -3039,13 +3039,13 @@ Possible Values: ### .spec.features.foxx.queues -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_features.go#L24) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_features.go#L24) *** ### .spec.gateway.dynamic -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec_gateway.go#L36) Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster. When enabled, gateway config will be reloaded by ConfigMap live updates. @@ -3056,7 +3056,7 @@ Default Value: `false` ### .spec.gateway.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L31) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec_gateway.go#L31) Enabled setting enables/disables support for gateway in the cluster. When enabled, the cluster will contain a number of `gateway` servers. @@ -3067,7 +3067,7 @@ Default Value: `false` ### .spec.gateway.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L40) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec_gateway.go#L40) Image is the image to use for the gateway. By default, the image is determined by the operator. @@ -3076,7 +3076,7 @@ By default, the image is determined by the operator. ### .spec.gateways.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -3087,7 +3087,7 @@ Links: ### .spec.gateways.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -3098,7 +3098,7 @@ This setting changes the member recreation logic based on group: ### .spec.gateways.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -3107,7 +3107,7 @@ Annotations are merged with `spec.annotations`. ### .spec.gateways.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -3115,7 +3115,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.gateways.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -3123,7 +3123,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.gateways.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -3134,7 +3134,7 @@ Links: ### .spec.gateways.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -3144,7 +3144,7 @@ Default Value: `[]` ### .spec.gateways.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -3157,7 +3157,7 @@ as for the `dbservers` group. ### .spec.gateways.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -3165,19 +3165,19 @@ Entrypoint overrides container executable ### .spec.gateways.envs\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L26) *** ### .spec.gateways.envs\[int\].value -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L27) *** ### .spec.gateways.ephemeralVolumes.apps.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -3188,7 +3188,7 @@ Links: ### .spec.gateways.ephemeralVolumes.temp.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -3199,7 +3199,7 @@ Links: ### .spec.gateways.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -3207,7 +3207,7 @@ ExporterPort define Port used by exporter ### .spec.gateways.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -3215,7 +3215,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.gateways.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -3223,7 +3223,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.gateways.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -3235,7 +3235,7 @@ Possible Values: ### .spec.gateways.initContainers.containers -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L91) Containers contains list of containers @@ -3246,7 +3246,7 @@ Links: ### .spec.gateways.initContainers.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L94) Mode keep container replace mode @@ -3254,7 +3254,7 @@ Mode keep container replace mode ### .spec.gateways.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3262,7 +3262,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.gateways.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3270,7 +3270,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.gateways.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -3278,7 +3278,7 @@ Labels specified the labels added to Pods in this group. ### .spec.gateways.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -3286,7 +3286,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.gateways.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -3294,7 +3294,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.gateways.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -3302,7 +3302,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.gateways.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -3317,7 +3317,7 @@ Default Value: `0` ### .spec.gateways.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -3325,7 +3325,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.gateways.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -3336,7 +3336,7 @@ Links: ### .spec.gateways.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -3347,7 +3347,7 @@ Links: ### .spec.gateways.numactl.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) Args define list of the numactl process @@ -3357,7 +3357,7 @@ Default Value: `[]` ### .spec.gateways.numactl.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) Enabled define if numactl should be enabled @@ -3367,7 +3367,7 @@ Default Value: `false` ### .spec.gateways.numactl.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) Path define numactl path within the container @@ -3377,7 +3377,7 @@ Default Value: `/usr/bin/numactl` ### .spec.gateways.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -3394,7 +3394,7 @@ Default Value: `true` ### .spec.gateways.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -3411,19 +3411,19 @@ Default Value: `true` ### .spec.gateways.podModes.network -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) *** ### .spec.gateways.podModes.pid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) *** ### .spec.gateways.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -3431,7 +3431,7 @@ Port define Port used by member ### .spec.gateways.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -3443,7 +3443,7 @@ Links: ### .spec.gateways.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -3453,7 +3453,7 @@ Default Value: `false` ### .spec.gateways.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3465,7 +3465,7 @@ Default Value: `3` ### .spec.gateways.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3476,7 +3476,7 @@ Default Value: `2` ### .spec.gateways.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3487,7 +3487,7 @@ Default Value: `10` ### .spec.gateways.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3498,7 +3498,7 @@ Default Value: `1` ### .spec.gateways.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3509,7 +3509,7 @@ Default Value: `2` ### .spec.gateways.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -3522,7 +3522,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.gateways.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -3530,7 +3530,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.gateways.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3542,7 +3542,7 @@ Default Value: `3` ### .spec.gateways.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3553,7 +3553,7 @@ Default Value: `2` ### .spec.gateways.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3564,7 +3564,7 @@ Default Value: `10` ### .spec.gateways.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3575,7 +3575,7 @@ Default Value: `1` ### .spec.gateways.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3586,7 +3586,7 @@ Default Value: `2` ### .spec.gateways.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -3594,7 +3594,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.gateways.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3606,7 +3606,7 @@ Default Value: `3` ### .spec.gateways.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3617,7 +3617,7 @@ Default Value: `2` ### .spec.gateways.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3628,7 +3628,7 @@ Default Value: `10` ### .spec.gateways.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3639,7 +3639,7 @@ Default Value: `1` ### .spec.gateways.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3650,7 +3650,7 @@ Default Value: `2` ### .spec.gateways.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -3662,7 +3662,7 @@ Possible Values: ### .spec.gateways.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -3673,7 +3673,7 @@ Links: ### .spec.gateways.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -3681,7 +3681,7 @@ SchedulerName define scheduler name used for group ### .spec.gateways.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -3689,7 +3689,7 @@ AddCapabilities add new capabilities to containers ### .spec.gateways.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -3697,7 +3697,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.gateways.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -3710,7 +3710,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.gateways.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -3718,7 +3718,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.gateways.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -3727,7 +3727,7 @@ essentially equivalent to root on the host. ### .spec.gateways.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -3735,7 +3735,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.gateways.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -3743,7 +3743,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.gateways.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -3751,7 +3751,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.gateways.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -3759,7 +3759,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.gateways.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -3770,7 +3770,7 @@ Links: ### .spec.gateways.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -3781,7 +3781,7 @@ Links: ### .spec.gateways.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -3790,7 +3790,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.gateways.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -3811,7 +3811,7 @@ sysctls: ### .spec.gateways.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -3826,7 +3826,7 @@ to that service account. ### .spec.gateways.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -3834,7 +3834,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.gateways.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -3842,7 +3842,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.gateways.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -3851,7 +3851,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.gateways.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -3862,7 +3862,7 @@ Links: ### .spec.gateways.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -3875,7 +3875,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.gateways.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -3883,7 +3883,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.gateways.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -3899,7 +3899,7 @@ Links: ### .spec.gateways.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -3912,7 +3912,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.gateways.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -3928,7 +3928,7 @@ Links: ### .spec.gateways.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -3939,7 +3939,7 @@ Links: ### .spec.gateways.volumes\[int\].configMap -Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L138) ConfigMap which should be mounted into pod @@ -3950,7 +3950,7 @@ Links: ### .spec.gateways.volumes\[int\].emptyDir -Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L143) EmptyDir @@ -3961,7 +3961,7 @@ Links: ### .spec.gateways.volumes\[int\].hostPath -Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L148) HostPath @@ -3972,7 +3972,7 @@ Links: ### .spec.gateways.volumes\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L128) Name of volume @@ -3980,7 +3980,7 @@ Name of volume ### .spec.gateways.volumes\[int\].persistentVolumeClaim -Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L153) PersistentVolumeClaim @@ -3991,7 +3991,7 @@ Links: ### .spec.gateways.volumes\[int\].secret -Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L133) Secret which should be mounted into pod @@ -4002,7 +4002,7 @@ Links: ### .spec.id.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L48) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L48) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -4013,7 +4013,7 @@ Links: ### .spec.id.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L44) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L44) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -4024,7 +4024,7 @@ Links: ### .spec.id.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L32) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L32) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -4034,7 +4034,7 @@ Default Value: `[]` ### .spec.id.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L28) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L28) Entrypoint overrides container executable @@ -4042,7 +4042,7 @@ Entrypoint overrides container executable ### .spec.id.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L52) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L52) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -4053,7 +4053,7 @@ Links: ### .spec.id.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L38) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L38) NodeSelector specifies a set of selectors for nodes @@ -4061,7 +4061,7 @@ NodeSelector specifies a set of selectors for nodes ### .spec.id.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L40) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L40) PriorityClassName specifies a priority class name @@ -4069,7 +4069,7 @@ PriorityClassName specifies a priority class name ### .spec.id.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L60) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L60) Resources holds resource requests & limits @@ -4080,7 +4080,7 @@ Links: ### .spec.id.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -4088,7 +4088,7 @@ AddCapabilities add new capabilities to containers ### .spec.id.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -4096,7 +4096,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.id.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -4109,7 +4109,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.id.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -4117,7 +4117,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.id.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -4126,7 +4126,7 @@ essentially equivalent to root on the host. ### .spec.id.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -4134,7 +4134,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.id.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -4142,7 +4142,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.id.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -4150,7 +4150,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.id.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -4158,7 +4158,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.id.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -4169,7 +4169,7 @@ Links: ### .spec.id.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -4180,7 +4180,7 @@ Links: ### .spec.id.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -4189,7 +4189,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.id.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -4210,7 +4210,7 @@ sysctls: ### .spec.id.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L54) ServiceAccountName specifies the name of the service account used for Pods in this group. @@ -4218,7 +4218,7 @@ ServiceAccountName specifies the name of the service account used for Pods in th ### .spec.id.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_id_group_spec.go#L36) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_id_group_spec.go#L36) Tolerations specifies the tolerations added to Pods in this group. @@ -4229,7 +4229,7 @@ Links: ### .spec.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L67) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L67) Image specifies the docker image to use for all ArangoDB servers. In a development environment this setting defaults to arangodb/arangodb:latest. @@ -4240,7 +4240,7 @@ It is highly recommend to use explicit version (not latest) for production envir ### .spec.imageDiscoveryMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L83) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L83) ImageDiscoveryMode specifies the image discovery mode. @@ -4252,7 +4252,7 @@ Possible Values: ### .spec.imagePullPolicy -Type: `core.PullPolicy` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L75) +Type: `core.PullPolicy` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L75) ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers. @@ -4268,7 +4268,7 @@ Possible Values: ### .spec.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L78) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L78) ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers. @@ -4276,7 +4276,7 @@ ImagePullSecrets specifies the list of image pull secrets for the docker image t ### .spec.integration.sidecar.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -4293,7 +4293,7 @@ Links: ### .spec.integration.sidecar.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -4310,7 +4310,7 @@ Links: ### .spec.integration.sidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -4320,7 +4320,7 @@ Default Value: `9202` ### .spec.integration.sidecar.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -4331,7 +4331,7 @@ Links: ### .spec.integration.sidecar.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -4342,7 +4342,7 @@ Links: ### .spec.integration.sidecar.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -4350,7 +4350,7 @@ Image define image details ### .spec.integration.sidecar.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -4360,7 +4360,7 @@ Default Value: `IfNotPresent` ### .spec.integration.sidecar.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -4368,7 +4368,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.integration.sidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) ListenPort defines on which port the sidecar container will be listening for connections @@ -4378,7 +4378,7 @@ Default Value: `9201` ### .spec.integration.sidecar.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -4390,7 +4390,7 @@ Links: ### .spec.integration.sidecar.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -4402,7 +4402,7 @@ Possible Values: ### .spec.integration.sidecar.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -4413,7 +4413,7 @@ accessible from the network. ### .spec.integration.sidecar.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -4425,7 +4425,7 @@ Links: ### .spec.integration.sidecar.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -4436,7 +4436,7 @@ Links: ### .spec.integration.sidecar.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -4447,7 +4447,7 @@ Links: ### .spec.integration.sidecar.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -4462,7 +4462,7 @@ Links: ### .spec.integration.sidecar.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -4470,7 +4470,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.integration.sidecar.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -4480,7 +4480,7 @@ might be configured in the container image. ### .spec.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L127) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L127) Labels specifies the labels added to Pods in this group. @@ -4488,7 +4488,7 @@ Labels specifies the labels added to Pods in this group. ### .spec.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L130) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -4496,7 +4496,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L136) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L136) LabelsMode Define labels mode which should be use while overriding labels @@ -4509,7 +4509,7 @@ Possible Values: ### .spec.license.secretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/license_spec.go#L33) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/license_spec.go#L33) SecretName setting specifies the name of a kubernetes `Secret` that contains the license key token used for enterprise images. This value is not used for @@ -4519,7 +4519,7 @@ the Community Edition. ### .spec.lifecycle.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/lifecycle_spec.go#L31) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/lifecycle_spec.go#L31) Resources holds resource requests & limits @@ -4530,7 +4530,7 @@ Links: ### .spec.memberPropagationMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L212) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L212) MemberPropagationMode defines how changes to pod spec should be propogated. Changes to a pod’s configuration require a restart of that pod in almost all cases. @@ -4546,7 +4546,7 @@ Possible Values: ### .spec.metrics.authentication.jwtTokenSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec.go#L34) JWTTokenSecretName contains the name of the JWT kubernetes secret used for authentication @@ -4554,7 +4554,7 @@ JWTTokenSecretName contains the name of the JWT kubernetes secret used for authe ### .spec.metrics.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec.go#L81) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec.go#L81) Enabled if this is set to `true`, the operator runs a sidecar container for every Agent, DB-Server, Coordinator and Single server. @@ -4568,7 +4568,7 @@ Default Value: `false` ### .spec.metrics.extensions.usageMetrics -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec_extensions.go#L29) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec_extensions.go#L29) > [!IMPORTANT] > **UsageMetrics needs to be also enabled via DBServer Arguments** @@ -4584,7 +4584,7 @@ Default Value: `false` ### .spec.metrics.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec.go#L86) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec.go#L86) > [!WARNING] > ***DEPRECATED*** @@ -4597,7 +4597,7 @@ Image used for the Metrics Sidecar ### .spec.metrics.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec.go#L97) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec.go#L97) > [!WARNING] > ***DEPRECATED*** @@ -4610,13 +4610,13 @@ Mode define metrics exported mode ### .spec.metrics.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec.go#L107) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec.go#L107) *** ### .spec.metrics.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec.go#L92) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec.go#L92) Resources holds resource requests & limits @@ -4627,19 +4627,19 @@ Links: ### .spec.metrics.serviceMonitor.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go#L24) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go#L24) *** ### .spec.metrics.serviceMonitor.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go#L25) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_service_monitor_spec.go#L25) *** ### .spec.metrics.tls -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_metrics_spec.go#L103) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_metrics_spec.go#L103) TLS defines if TLS should be enabled on Metrics exporter endpoint. This option will enable TLS only if TLS is enabled on ArangoDeployment, @@ -4651,7 +4651,7 @@ Default Value: `true` ### .spec.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L49) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L49) Mode specifies the type of ArangoDB deployment to create. @@ -4666,7 +4666,7 @@ This field is **immutable**: Change of the ArangoDeployment Mode is not possible ### .spec.networkAttachedVolumes -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L112) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L112) NetworkAttachedVolumes If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation). @@ -4680,25 +4680,25 @@ Default Value: `true` ### .spec.rebalancer.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/rebalancer_spec.go#L26) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/rebalancer_spec.go#L26) *** ### .spec.rebalancer.optimizers.leader -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/rebalancer_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/rebalancer_spec.go#L75) *** ### .spec.rebalancer.parallelMoves -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/rebalancer_spec.go#L28) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/rebalancer_spec.go#L28) *** ### .spec.rebalancer.readers.count -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/rebalancer_spec.go#L63) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/rebalancer_spec.go#L63) > [!WARNING] > ***DEPRECATED*** @@ -4711,13 +4711,13 @@ Count Enable Shard Count machanism ### .spec.recovery.autoRecover -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/recovery_spec.go#L26) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/recovery_spec.go#L26) *** ### .spec.restoreEncryptionSecret -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L149) RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore @@ -4725,7 +4725,7 @@ RestoreEncryptionSecret specifies optional name of secret which contains encrypt ### .spec.restoreFrom -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L146) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L146) RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from. After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key. @@ -4740,7 +4740,7 @@ A new restore attempt is made if and only if either in the status restore is not ### .spec.rocksdb.encryption.keySecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/rocksdb_spec.go#L37) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/rocksdb_spec.go#L37) KeySecretName setting specifies the name of a Kubernetes `Secret` that contains an encryption key used for encrypting all data stored by ArangoDB servers. When an encryption key is used, encryption of the data in the cluster is enabled, without it encryption is disabled. @@ -4753,7 +4753,7 @@ The secret specified by this setting, must have a data field named 'key' contain ### .spec.single.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -4764,7 +4764,7 @@ Links: ### .spec.single.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -4775,7 +4775,7 @@ This setting changes the member recreation logic based on group: ### .spec.single.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -4784,7 +4784,7 @@ Annotations are merged with `spec.annotations`. ### .spec.single.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -4792,7 +4792,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.single.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -4800,7 +4800,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.single.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -4811,7 +4811,7 @@ Links: ### .spec.single.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -4821,7 +4821,7 @@ Default Value: `[]` ### .spec.single.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -4834,7 +4834,7 @@ as for the `dbservers` group. ### .spec.single.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -4842,19 +4842,19 @@ Entrypoint overrides container executable ### .spec.single.envs\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L26) *** ### .spec.single.envs\[int\].value -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L27) *** ### .spec.single.ephemeralVolumes.apps.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -4865,7 +4865,7 @@ Links: ### .spec.single.ephemeralVolumes.temp.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -4876,7 +4876,7 @@ Links: ### .spec.single.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -4884,7 +4884,7 @@ ExporterPort define Port used by exporter ### .spec.single.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -4892,7 +4892,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.single.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -4900,7 +4900,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.single.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -4912,7 +4912,7 @@ Possible Values: ### .spec.single.initContainers.containers -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L91) Containers contains list of containers @@ -4923,7 +4923,7 @@ Links: ### .spec.single.initContainers.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L94) Mode keep container replace mode @@ -4931,7 +4931,7 @@ Mode keep container replace mode ### .spec.single.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -4939,7 +4939,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.single.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -4947,7 +4947,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.single.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -4955,7 +4955,7 @@ Labels specified the labels added to Pods in this group. ### .spec.single.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -4963,7 +4963,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.single.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -4971,7 +4971,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.single.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -4979,7 +4979,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.single.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -4994,7 +4994,7 @@ Default Value: `0` ### .spec.single.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -5002,7 +5002,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.single.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -5013,7 +5013,7 @@ Links: ### .spec.single.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -5024,7 +5024,7 @@ Links: ### .spec.single.numactl.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) Args define list of the numactl process @@ -5034,7 +5034,7 @@ Default Value: `[]` ### .spec.single.numactl.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) Enabled define if numactl should be enabled @@ -5044,7 +5044,7 @@ Default Value: `false` ### .spec.single.numactl.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) Path define numactl path within the container @@ -5054,7 +5054,7 @@ Default Value: `/usr/bin/numactl` ### .spec.single.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -5071,7 +5071,7 @@ Default Value: `true` ### .spec.single.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -5088,19 +5088,19 @@ Default Value: `true` ### .spec.single.podModes.network -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) *** ### .spec.single.podModes.pid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) *** ### .spec.single.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -5108,7 +5108,7 @@ Port define Port used by member ### .spec.single.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -5120,7 +5120,7 @@ Links: ### .spec.single.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -5130,7 +5130,7 @@ Default Value: `false` ### .spec.single.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -5142,7 +5142,7 @@ Default Value: `3` ### .spec.single.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -5153,7 +5153,7 @@ Default Value: `2` ### .spec.single.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -5164,7 +5164,7 @@ Default Value: `10` ### .spec.single.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -5175,7 +5175,7 @@ Default Value: `1` ### .spec.single.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -5186,7 +5186,7 @@ Default Value: `2` ### .spec.single.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -5199,7 +5199,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.single.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -5207,7 +5207,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.single.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -5219,7 +5219,7 @@ Default Value: `3` ### .spec.single.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -5230,7 +5230,7 @@ Default Value: `2` ### .spec.single.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -5241,7 +5241,7 @@ Default Value: `10` ### .spec.single.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -5252,7 +5252,7 @@ Default Value: `1` ### .spec.single.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -5263,7 +5263,7 @@ Default Value: `2` ### .spec.single.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -5271,7 +5271,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.single.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -5283,7 +5283,7 @@ Default Value: `3` ### .spec.single.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -5294,7 +5294,7 @@ Default Value: `2` ### .spec.single.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -5305,7 +5305,7 @@ Default Value: `10` ### .spec.single.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -5316,7 +5316,7 @@ Default Value: `1` ### .spec.single.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -5327,7 +5327,7 @@ Default Value: `2` ### .spec.single.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -5339,7 +5339,7 @@ Possible Values: ### .spec.single.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -5350,7 +5350,7 @@ Links: ### .spec.single.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -5358,7 +5358,7 @@ SchedulerName define scheduler name used for group ### .spec.single.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -5366,7 +5366,7 @@ AddCapabilities add new capabilities to containers ### .spec.single.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -5374,7 +5374,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.single.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -5387,7 +5387,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.single.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -5395,7 +5395,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.single.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -5404,7 +5404,7 @@ essentially equivalent to root on the host. ### .spec.single.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -5412,7 +5412,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.single.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -5420,7 +5420,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.single.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -5428,7 +5428,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.single.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -5436,7 +5436,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.single.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -5447,7 +5447,7 @@ Links: ### .spec.single.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -5458,7 +5458,7 @@ Links: ### .spec.single.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -5467,7 +5467,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.single.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -5488,7 +5488,7 @@ sysctls: ### .spec.single.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -5503,7 +5503,7 @@ to that service account. ### .spec.single.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -5511,7 +5511,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.single.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -5519,7 +5519,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.single.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -5528,7 +5528,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.single.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -5539,7 +5539,7 @@ Links: ### .spec.single.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -5552,7 +5552,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.single.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -5560,7 +5560,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.single.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -5576,7 +5576,7 @@ Links: ### .spec.single.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -5589,7 +5589,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.single.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -5605,7 +5605,7 @@ Links: ### .spec.single.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -5616,7 +5616,7 @@ Links: ### .spec.single.volumes\[int\].configMap -Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L138) ConfigMap which should be mounted into pod @@ -5627,7 +5627,7 @@ Links: ### .spec.single.volumes\[int\].emptyDir -Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L143) EmptyDir @@ -5638,7 +5638,7 @@ Links: ### .spec.single.volumes\[int\].hostPath -Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L148) HostPath @@ -5649,7 +5649,7 @@ Links: ### .spec.single.volumes\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L128) Name of volume @@ -5657,7 +5657,7 @@ Name of volume ### .spec.single.volumes\[int\].persistentVolumeClaim -Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L153) PersistentVolumeClaim @@ -5668,7 +5668,7 @@ Links: ### .spec.single.volumes\[int\].secret -Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L133) Secret which should be mounted into pod @@ -5679,7 +5679,7 @@ Links: ### .spec.storageEngine -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L61) StorageEngine specifies the type of storage engine used for all servers in the cluster. @@ -5693,7 +5693,7 @@ This field is **immutable**: This setting cannot be changed after the cluster ha ### .spec.sync.auth.clientCASecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/sync_authentication_spec.go#L41) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/sync_authentication_spec.go#L41) ClientCASecretName setting specifies the name of a kubernetes `Secret` that contains a PEM encoded CA certificate used for client certificate verification @@ -5704,7 +5704,7 @@ This is a required setting when `spec.sync.enabled` is `true`. ### .spec.sync.auth.jwtSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/sync_authentication_spec.go#L36) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/sync_authentication_spec.go#L36) JWTSecretName setting specifies the name of a kubernetes `Secret` that contains the JWT token used for accessing all ArangoSync master servers. @@ -5716,7 +5716,7 @@ and stored in a `Secret` with given name. ### .spec.sync.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/sync_spec.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/sync_spec.go#L34) Enabled setting enables/disables support for data center 2 data center replication in the cluster. When enabled, the cluster will contain @@ -5728,7 +5728,7 @@ Default Value: `false` ### .spec.sync.externalAccess.accessPackageSecretNames -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/sync_external_access_spec.go#L49) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/sync_external_access_spec.go#L49) AccessPackageSecretNames setting specifies the names of zero of more `Secrets` that will be created by the deployment operator containing "access packages". An access package contains those `Secrets` that are needed @@ -5744,7 +5744,7 @@ Links: ### .spec.sync.externalAccess.advertisedEndpoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L58) AdvertisedEndpoint is passed to the coordinators/single servers for advertising a specific endpoint @@ -5752,7 +5752,7 @@ AdvertisedEndpoint is passed to the coordinators/single servers for advertising ### .spec.sync.externalAccess.loadBalancerIP -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L48) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L48) LoadBalancerIP define optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type. If you do not specify this setting, an IP will be chosen automatically by the load-balancer provisioner. @@ -5761,7 +5761,7 @@ If you do not specify this setting, an IP will be chosen automatically by the lo ### .spec.sync.externalAccess.loadBalancerSourceRanges -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L55) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L55) LoadBalancerSourceRanges define LoadBalancerSourceRanges used for LoadBalancer Service type If specified and supported by the platform, this will restrict traffic through the cloud-provider @@ -5775,7 +5775,7 @@ Links: ### .spec.sync.externalAccess.managedServiceNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L62) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L62) ManagedServiceNames keeps names of services which are not managed by KubeArangoDB. It is only relevant when type of service is `managed`. @@ -5784,7 +5784,7 @@ It is only relevant when type of service is `managed`. ### .spec.sync.externalAccess.masterEndpoint -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/sync_external_access_spec.go#L40) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/sync_external_access_spec.go#L40) MasterEndpoint setting specifies the master endpoint(s) advertised by the ArangoSync SyncMasters. If not set, this setting defaults to: @@ -5795,7 +5795,7 @@ If not set, this setting defaults to: ### .spec.sync.externalAccess.nodePort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L44) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L44) NodePort define optional port used in case of Auto or NodePort type. This setting is used when `spec.externalAccess.type` is set to `NodePort` or `Auto`. @@ -5805,7 +5805,7 @@ If you do not specify this setting, a random port will be chosen automatically. ### .spec.sync.externalAccess.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/external_access_spec.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/external_access_spec.go#L39) Type specifies the type of Service that will be created to provide access to the ArangoDB deployment from outside the Kubernetes cluster. @@ -5819,13 +5819,13 @@ Possible Values: ### .spec.sync.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/sync_spec.go#L40) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/sync_spec.go#L40) *** ### .spec.sync.monitoring.tokenSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/sync_monitoring_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/sync_monitoring_spec.go#L34) TokenSecretName setting specifies the name of a kubernetes `Secret` that contains the bearer token used for accessing all monitoring endpoints of all arangod/arangosync servers. @@ -5835,7 +5835,7 @@ When not specified, no monitoring token is used. ### .spec.sync.tls.altNames -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L72) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L72) AltNames setting specifies a list of alternate names that will be added to all generated certificates. These names can be DNS names or email addresses. @@ -5845,7 +5845,7 @@ The default value is empty. ### .spec.sync.tls.caSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L67) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L67) CASecretName setting specifies the name of a kubernetes `Secret` that contains a standard CA certificate + private key used to sign certificates for individual @@ -5862,19 +5862,19 @@ The specified `Secret`, must contain the following data fields: ### .spec.sync.tls.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L81) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L81) *** ### .spec.sync.tls.sni.mapping.\ -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_sni_spec.go#L30) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_sni_spec.go#L30) *** ### .spec.sync.tls.ttl -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L79) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L79) TTL setting specifies the time to live of all generated server certificates. When the server certificate is about to expire, it will be automatically replaced @@ -5888,7 +5888,7 @@ Default Value: `"2160h" (about 3 months)` ### .spec.syncmasters.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -5899,7 +5899,7 @@ Links: ### .spec.syncmasters.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -5910,7 +5910,7 @@ This setting changes the member recreation logic based on group: ### .spec.syncmasters.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -5919,7 +5919,7 @@ Annotations are merged with `spec.annotations`. ### .spec.syncmasters.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -5927,7 +5927,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.syncmasters.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -5935,7 +5935,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.syncmasters.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -5946,7 +5946,7 @@ Links: ### .spec.syncmasters.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -5956,7 +5956,7 @@ Default Value: `[]` ### .spec.syncmasters.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -5969,7 +5969,7 @@ as for the `dbservers` group. ### .spec.syncmasters.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -5977,19 +5977,19 @@ Entrypoint overrides container executable ### .spec.syncmasters.envs\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L26) *** ### .spec.syncmasters.envs\[int\].value -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L27) *** ### .spec.syncmasters.ephemeralVolumes.apps.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -6000,7 +6000,7 @@ Links: ### .spec.syncmasters.ephemeralVolumes.temp.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -6011,7 +6011,7 @@ Links: ### .spec.syncmasters.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -6019,7 +6019,7 @@ ExporterPort define Port used by exporter ### .spec.syncmasters.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -6027,7 +6027,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.syncmasters.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -6035,7 +6035,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.syncmasters.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -6047,7 +6047,7 @@ Possible Values: ### .spec.syncmasters.initContainers.containers -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L91) Containers contains list of containers @@ -6058,7 +6058,7 @@ Links: ### .spec.syncmasters.initContainers.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L94) Mode keep container replace mode @@ -6066,7 +6066,7 @@ Mode keep container replace mode ### .spec.syncmasters.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -6074,7 +6074,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.syncmasters.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -6082,7 +6082,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.syncmasters.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -6090,7 +6090,7 @@ Labels specified the labels added to Pods in this group. ### .spec.syncmasters.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -6098,7 +6098,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.syncmasters.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -6106,7 +6106,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.syncmasters.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -6114,7 +6114,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.syncmasters.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -6129,7 +6129,7 @@ Default Value: `0` ### .spec.syncmasters.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -6137,7 +6137,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.syncmasters.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -6148,7 +6148,7 @@ Links: ### .spec.syncmasters.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -6159,7 +6159,7 @@ Links: ### .spec.syncmasters.numactl.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) Args define list of the numactl process @@ -6169,7 +6169,7 @@ Default Value: `[]` ### .spec.syncmasters.numactl.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) Enabled define if numactl should be enabled @@ -6179,7 +6179,7 @@ Default Value: `false` ### .spec.syncmasters.numactl.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) Path define numactl path within the container @@ -6189,7 +6189,7 @@ Default Value: `/usr/bin/numactl` ### .spec.syncmasters.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -6206,7 +6206,7 @@ Default Value: `true` ### .spec.syncmasters.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -6223,19 +6223,19 @@ Default Value: `true` ### .spec.syncmasters.podModes.network -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) *** ### .spec.syncmasters.podModes.pid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) *** ### .spec.syncmasters.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -6243,7 +6243,7 @@ Port define Port used by member ### .spec.syncmasters.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -6255,7 +6255,7 @@ Links: ### .spec.syncmasters.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -6265,7 +6265,7 @@ Default Value: `false` ### .spec.syncmasters.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -6277,7 +6277,7 @@ Default Value: `3` ### .spec.syncmasters.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -6288,7 +6288,7 @@ Default Value: `2` ### .spec.syncmasters.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -6299,7 +6299,7 @@ Default Value: `10` ### .spec.syncmasters.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -6310,7 +6310,7 @@ Default Value: `1` ### .spec.syncmasters.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -6321,7 +6321,7 @@ Default Value: `2` ### .spec.syncmasters.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -6334,7 +6334,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.syncmasters.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -6342,7 +6342,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.syncmasters.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -6354,7 +6354,7 @@ Default Value: `3` ### .spec.syncmasters.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -6365,7 +6365,7 @@ Default Value: `2` ### .spec.syncmasters.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -6376,7 +6376,7 @@ Default Value: `10` ### .spec.syncmasters.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -6387,7 +6387,7 @@ Default Value: `1` ### .spec.syncmasters.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -6398,7 +6398,7 @@ Default Value: `2` ### .spec.syncmasters.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -6406,7 +6406,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.syncmasters.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -6418,7 +6418,7 @@ Default Value: `3` ### .spec.syncmasters.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -6429,7 +6429,7 @@ Default Value: `2` ### .spec.syncmasters.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -6440,7 +6440,7 @@ Default Value: `10` ### .spec.syncmasters.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -6451,7 +6451,7 @@ Default Value: `1` ### .spec.syncmasters.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -6462,7 +6462,7 @@ Default Value: `2` ### .spec.syncmasters.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -6474,7 +6474,7 @@ Possible Values: ### .spec.syncmasters.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -6485,7 +6485,7 @@ Links: ### .spec.syncmasters.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -6493,7 +6493,7 @@ SchedulerName define scheduler name used for group ### .spec.syncmasters.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -6501,7 +6501,7 @@ AddCapabilities add new capabilities to containers ### .spec.syncmasters.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -6509,7 +6509,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.syncmasters.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -6522,7 +6522,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.syncmasters.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -6530,7 +6530,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.syncmasters.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -6539,7 +6539,7 @@ essentially equivalent to root on the host. ### .spec.syncmasters.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -6547,7 +6547,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.syncmasters.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -6555,7 +6555,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.syncmasters.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -6563,7 +6563,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.syncmasters.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -6571,7 +6571,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.syncmasters.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -6582,7 +6582,7 @@ Links: ### .spec.syncmasters.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -6593,7 +6593,7 @@ Links: ### .spec.syncmasters.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -6602,7 +6602,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.syncmasters.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -6623,7 +6623,7 @@ sysctls: ### .spec.syncmasters.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -6638,7 +6638,7 @@ to that service account. ### .spec.syncmasters.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -6646,7 +6646,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.syncmasters.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -6654,7 +6654,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.syncmasters.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -6663,7 +6663,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.syncmasters.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -6674,7 +6674,7 @@ Links: ### .spec.syncmasters.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -6687,7 +6687,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.syncmasters.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -6695,7 +6695,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.syncmasters.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -6711,7 +6711,7 @@ Links: ### .spec.syncmasters.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -6724,7 +6724,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.syncmasters.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -6740,7 +6740,7 @@ Links: ### .spec.syncmasters.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -6751,7 +6751,7 @@ Links: ### .spec.syncmasters.volumes\[int\].configMap -Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L138) ConfigMap which should be mounted into pod @@ -6762,7 +6762,7 @@ Links: ### .spec.syncmasters.volumes\[int\].emptyDir -Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L143) EmptyDir @@ -6773,7 +6773,7 @@ Links: ### .spec.syncmasters.volumes\[int\].hostPath -Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L148) HostPath @@ -6784,7 +6784,7 @@ Links: ### .spec.syncmasters.volumes\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L128) Name of volume @@ -6792,7 +6792,7 @@ Name of volume ### .spec.syncmasters.volumes\[int\].persistentVolumeClaim -Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L153) PersistentVolumeClaim @@ -6803,7 +6803,7 @@ Links: ### .spec.syncmasters.volumes\[int\].secret -Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L133) Secret which should be mounted into pod @@ -6814,7 +6814,7 @@ Links: ### .spec.syncworkers.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -6825,7 +6825,7 @@ Links: ### .spec.syncworkers.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -6836,7 +6836,7 @@ This setting changes the member recreation logic based on group: ### .spec.syncworkers.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -6845,7 +6845,7 @@ Annotations are merged with `spec.annotations`. ### .spec.syncworkers.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -6853,7 +6853,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.syncworkers.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -6861,7 +6861,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.syncworkers.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -6872,7 +6872,7 @@ Links: ### .spec.syncworkers.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -6882,7 +6882,7 @@ Default Value: `[]` ### .spec.syncworkers.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -6895,7 +6895,7 @@ as for the `dbservers` group. ### .spec.syncworkers.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -6903,19 +6903,19 @@ Entrypoint overrides container executable ### .spec.syncworkers.envs\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L26) *** ### .spec.syncworkers.envs\[int\].value -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_env_var.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_env_var.go#L27) *** ### .spec.syncworkers.ephemeralVolumes.apps.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -6926,7 +6926,7 @@ Links: ### .spec.syncworkers.ephemeralVolumes.temp.size -Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) +Type: `resource.Quantity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_ephemeral_volumes.go#L64) Size define size of the ephemeral volume @@ -6937,7 +6937,7 @@ Links: ### .spec.syncworkers.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -6945,7 +6945,7 @@ ExporterPort define Port used by exporter ### .spec.syncworkers.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -6953,7 +6953,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.syncworkers.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -6961,7 +6961,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.syncworkers.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -6973,7 +6973,7 @@ Possible Values: ### .spec.syncworkers.initContainers.containers -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L91) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L91) Containers contains list of containers @@ -6984,7 +6984,7 @@ Links: ### .spec.syncworkers.initContainers.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_init_containers.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_init_containers.go#L94) Mode keep container replace mode @@ -6992,7 +6992,7 @@ Mode keep container replace mode ### .spec.syncworkers.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -7000,7 +7000,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.syncworkers.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -7008,7 +7008,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.syncworkers.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -7016,7 +7016,7 @@ Labels specified the labels added to Pods in this group. ### .spec.syncworkers.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -7024,7 +7024,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.syncworkers.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -7032,7 +7032,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.syncworkers.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -7040,7 +7040,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.syncworkers.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -7055,7 +7055,7 @@ Default Value: `0` ### .spec.syncworkers.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -7063,7 +7063,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.syncworkers.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -7074,7 +7074,7 @@ Links: ### .spec.syncworkers.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -7085,7 +7085,7 @@ Links: ### .spec.syncworkers.numactl.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L38) Args define list of the numactl process @@ -7095,7 +7095,7 @@ Default Value: `[]` ### .spec.syncworkers.numactl.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L30) Enabled define if numactl should be enabled @@ -7105,7 +7105,7 @@ Default Value: `false` ### .spec.syncworkers.numactl.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_numactl_spec.go#L34) Path define numactl path within the container @@ -7115,7 +7115,7 @@ Default Value: `/usr/bin/numactl` ### .spec.syncworkers.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -7132,7 +7132,7 @@ Default Value: `true` ### .spec.syncworkers.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -7149,19 +7149,19 @@ Default Value: `true` ### .spec.syncworkers.podModes.network -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L31) *** ### .spec.syncworkers.podModes.pid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_pod_modes.go#L32) *** ### .spec.syncworkers.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -7169,7 +7169,7 @@ Port define Port used by member ### .spec.syncworkers.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -7181,7 +7181,7 @@ Links: ### .spec.syncworkers.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -7191,7 +7191,7 @@ Default Value: `false` ### .spec.syncworkers.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -7203,7 +7203,7 @@ Default Value: `3` ### .spec.syncworkers.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -7214,7 +7214,7 @@ Default Value: `2` ### .spec.syncworkers.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -7225,7 +7225,7 @@ Default Value: `10` ### .spec.syncworkers.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -7236,7 +7236,7 @@ Default Value: `1` ### .spec.syncworkers.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -7247,7 +7247,7 @@ Default Value: `2` ### .spec.syncworkers.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -7260,7 +7260,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.syncworkers.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -7268,7 +7268,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.syncworkers.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -7280,7 +7280,7 @@ Default Value: `3` ### .spec.syncworkers.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -7291,7 +7291,7 @@ Default Value: `2` ### .spec.syncworkers.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -7302,7 +7302,7 @@ Default Value: `10` ### .spec.syncworkers.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -7313,7 +7313,7 @@ Default Value: `1` ### .spec.syncworkers.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -7324,7 +7324,7 @@ Default Value: `2` ### .spec.syncworkers.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -7332,7 +7332,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.syncworkers.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -7344,7 +7344,7 @@ Default Value: `3` ### .spec.syncworkers.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -7355,7 +7355,7 @@ Default Value: `2` ### .spec.syncworkers.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -7366,7 +7366,7 @@ Default Value: `10` ### .spec.syncworkers.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -7377,7 +7377,7 @@ Default Value: `1` ### .spec.syncworkers.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -7388,7 +7388,7 @@ Default Value: `2` ### .spec.syncworkers.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -7400,7 +7400,7 @@ Possible Values: ### .spec.syncworkers.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -7411,7 +7411,7 @@ Links: ### .spec.syncworkers.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -7419,7 +7419,7 @@ SchedulerName define scheduler name used for group ### .spec.syncworkers.securityContext.addCapabilities -Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) +Type: `[]core.Capability` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L41) AddCapabilities add new capabilities to containers @@ -7427,7 +7427,7 @@ AddCapabilities add new capabilities to containers ### .spec.syncworkers.securityContext.allowPrivilegeEscalation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L44) AllowPrivilegeEscalation Controls whether a process can gain more privileges than its parent process. @@ -7435,7 +7435,7 @@ AllowPrivilegeEscalation Controls whether a process can gain more privileges tha ### .spec.syncworkers.securityContext.dropAllCapabilities -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L38) > [!WARNING] > ***DEPRECATED*** @@ -7448,7 +7448,7 @@ DropAllCapabilities specifies if capabilities should be dropped for this pod con ### .spec.syncworkers.securityContext.fsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L61) FSGroup is a special supplemental group that applies to all containers in a pod. @@ -7456,7 +7456,7 @@ FSGroup is a special supplemental group that applies to all containers in a pod. ### .spec.syncworkers.securityContext.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L47) Privileged If true, runs container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. @@ -7465,7 +7465,7 @@ essentially equivalent to root on the host. ### .spec.syncworkers.securityContext.readOnlyRootFilesystem -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L49) ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-only. @@ -7473,7 +7473,7 @@ ReadOnlyRootFilesystem if true, mounts the container's root filesystem as read-o ### .spec.syncworkers.securityContext.runAsGroup -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L55) RunAsGroup is the GID to run the entrypoint of the container process. @@ -7481,7 +7481,7 @@ RunAsGroup is the GID to run the entrypoint of the container process. ### .spec.syncworkers.securityContext.runAsNonRoot -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L51) RunAsNonRoot if true, indicates that the container must run as a non-root user. @@ -7489,7 +7489,7 @@ RunAsNonRoot if true, indicates that the container must run as a non-root user. ### .spec.syncworkers.securityContext.runAsUser -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L53) RunAsUser is the UID to run the entrypoint of the container process. @@ -7497,7 +7497,7 @@ RunAsUser is the UID to run the entrypoint of the container process. ### .spec.syncworkers.securityContext.seccompProfile -Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) +Type: `core.SeccompProfile` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L77) SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. @@ -7508,7 +7508,7 @@ Links: ### .spec.syncworkers.securityContext.seLinuxOptions -Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) +Type: `core.SELinuxOptions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L82) SELinuxOptions are the labels to be applied to the container @@ -7519,7 +7519,7 @@ Links: ### .spec.syncworkers.securityContext.supplementalGroups -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L59) SupplementalGroups is a list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. @@ -7528,7 +7528,7 @@ the fsGroup (if specified), and group memberships defined in the container image ### .spec.syncworkers.securityContext.sysctls -Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) +Type: `map[string]intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_security_context_spec.go#L72) Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. @@ -7549,7 +7549,7 @@ sysctls: ### .spec.syncworkers.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -7564,7 +7564,7 @@ to that service account. ### .spec.syncworkers.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -7572,7 +7572,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.syncworkers.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -7580,7 +7580,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.syncworkers.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -7589,7 +7589,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.syncworkers.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -7600,7 +7600,7 @@ Links: ### .spec.syncworkers.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -7613,7 +7613,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.syncworkers.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -7621,7 +7621,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.syncworkers.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -7637,7 +7637,7 @@ Links: ### .spec.syncworkers.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -7650,7 +7650,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.syncworkers.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -7666,7 +7666,7 @@ Links: ### .spec.syncworkers.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container @@ -7677,7 +7677,7 @@ Links: ### .spec.syncworkers.volumes\[int\].configMap -Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L138) +Type: `core.ConfigMapVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L138) ConfigMap which should be mounted into pod @@ -7688,7 +7688,7 @@ Links: ### .spec.syncworkers.volumes\[int\].emptyDir -Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L143) +Type: `core.EmptyDirVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L143) EmptyDir @@ -7699,7 +7699,7 @@ Links: ### .spec.syncworkers.volumes\[int\].hostPath -Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L148) +Type: `core.HostPathVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L148) HostPath @@ -7710,7 +7710,7 @@ Links: ### .spec.syncworkers.volumes\[int\].name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L128) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L128) Name of volume @@ -7718,7 +7718,7 @@ Name of volume ### .spec.syncworkers.volumes\[int\].persistentVolumeClaim -Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L153) +Type: `core.PersistentVolumeClaimVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L153) PersistentVolumeClaim @@ -7729,7 +7729,7 @@ Links: ### .spec.syncworkers.volumes\[int\].secret -Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_volume.go#L133) +Type: `core.SecretVolumeSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/server_group_volume.go#L133) Secret which should be mounted into pod @@ -7740,7 +7740,7 @@ Links: ### .spec.timeouts.actions -Type: `map[string]meta.Duration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/timeouts.go#L44) +Type: `map[string]meta.Duration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/timeouts.go#L44) Actions keep map of the actions timeouts. @@ -7758,7 +7758,7 @@ actions: ### .spec.timeouts.maintenanceGracePeriod -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/timeouts.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/timeouts.go#L36) MaintenanceGracePeriod action timeout @@ -7766,7 +7766,7 @@ MaintenanceGracePeriod action timeout ### .spec.timezone -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec.go#L261) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_spec.go#L261) Timezone if specified, will set a timezone for deployment. Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London` @@ -7775,7 +7775,7 @@ Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/Londo ### .spec.tls.altNames -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L72) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L72) AltNames setting specifies a list of alternate names that will be added to all generated certificates. These names can be DNS names or email addresses. @@ -7785,7 +7785,7 @@ The default value is empty. ### .spec.tls.caSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L67) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L67) CASecretName setting specifies the name of a kubernetes `Secret` that contains a standard CA certificate + private key used to sign certificates for individual @@ -7802,19 +7802,19 @@ The specified `Secret`, must contain the following data fields: ### .spec.tls.mode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L81) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L81) *** ### .spec.tls.sni.mapping.\ -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_sni_spec.go#L30) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_sni_spec.go#L30) *** ### .spec.tls.ttl -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/tls_spec.go#L79) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/tls_spec.go#L79) TTL setting specifies the time to live of all generated server certificates. When the server certificate is about to expire, it will be automatically replaced @@ -7828,25 +7828,25 @@ Default Value: `"2160h" (about 3 months)` ### .spec.topology.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/topology_spec.go#L26) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/topology_spec.go#L26) *** ### .spec.topology.label -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/topology_spec.go#L28) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/topology_spec.go#L28) *** ### .spec.topology.zones -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/topology_spec.go#L27) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/topology_spec.go#L27) *** ### .spec.upgrade.autoUpgrade -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_upgrade_spec.go#L26) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_upgrade_spec.go#L26) AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck) @@ -7856,7 +7856,7 @@ Default Value: `false` ### .spec.upgrade.debugLog -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_upgrade_spec.go#L30) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/deployment_upgrade_spec.go#L30) DebugLog flag specifies if containers running upgrade process should print more debugging information. This applies only to init containers. diff --git a/docs/api/ArangoDeploymentReplication.V1.md b/docs/api/ArangoDeploymentReplication.V1.md index af84bfc4c..d1b58868a 100644 --- a/docs/api/ArangoDeploymentReplication.V1.md +++ b/docs/api/ArangoDeploymentReplication.V1.md @@ -10,7 +10,7 @@ title: ArangoDeploymentReplication V1 ### .spec.cancellation.ensureInSync -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/replication_spec.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/replication_spec.go#L38) EnsureInSync if it is true then during cancellation process data consistency is required. Default value is true. @@ -19,7 +19,7 @@ Default value is true. ### .spec.cancellation.sourceReadOnly -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/replication_spec.go#L41) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/replication_spec.go#L41) SourceReadOnly if it true then after cancellation source data center should be in read-only mode. Default value is false. @@ -28,7 +28,7 @@ Default value is false. ### .spec.destination.auth.keyfileSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_authentication_spec.go#L37) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_authentication_spec.go#L37) KeyfileSecretName holds the name of a Secret containing a client authentication certificate formatted at keyfile in a `tls.keyfile` field. @@ -40,7 +40,7 @@ the synchronization and fetch the synchronization status. ### .spec.destination.auth.userSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_authentication_spec.go#L42) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_authentication_spec.go#L42) UserSecretName holds the name of a Secret containing a `username` & `password` field used for basic authentication. @@ -51,7 +51,7 @@ of the ArangoDB cluster at the endpoint. ### .spec.destination.deploymentName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_spec.go#L36) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_spec.go#L36) DeploymentName holds the name of an ArangoDeployment resource. If set, this provides default values for masterEndpoint, auth & tls. @@ -60,7 +60,7 @@ If set, this provides default values for masterEndpoint, auth & tls. ### .spec.destination.masterEndpoint -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_spec.go#L42) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_spec.go#L42) MasterEndpoint holds a list of URLs used to reach the syncmaster(s) Use this setting if the source cluster is not running inside a Kubernetes cluster @@ -73,7 +73,7 @@ Default Value: `[]` ### .spec.destination.tls.caSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_tls_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_tls_spec.go#L34) CASecretName holds the name of a Secret containing a ca.crt public key for TLS validation. This setting is required, unless `deploymentName` has been set. @@ -82,7 +82,7 @@ This setting is required, unless `deploymentName` has been set. ### .spec.source.auth.keyfileSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_authentication_spec.go#L37) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_authentication_spec.go#L37) KeyfileSecretName holds the name of a Secret containing a client authentication certificate formatted at keyfile in a `tls.keyfile` field. @@ -94,7 +94,7 @@ the synchronization and fetch the synchronization status. ### .spec.source.auth.userSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_authentication_spec.go#L42) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_authentication_spec.go#L42) UserSecretName holds the name of a Secret containing a `username` & `password` field used for basic authentication. @@ -105,7 +105,7 @@ of the ArangoDB cluster at the endpoint. ### .spec.source.deploymentName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_spec.go#L36) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_spec.go#L36) DeploymentName holds the name of an ArangoDeployment resource. If set, this provides default values for masterEndpoint, auth & tls. @@ -114,7 +114,7 @@ If set, this provides default values for masterEndpoint, auth & tls. ### .spec.source.masterEndpoint -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_spec.go#L42) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_spec.go#L42) MasterEndpoint holds a list of URLs used to reach the syncmaster(s) Use this setting if the source cluster is not running inside a Kubernetes cluster @@ -127,7 +127,7 @@ Default Value: `[]` ### .spec.source.tls.caSecretName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/replication/v1/endpoint_tls_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/replication/v1/endpoint_tls_spec.go#L34) CASecretName holds the name of a Secret containing a ca.crt public key for TLS validation. This setting is required, unless `deploymentName` has been set. diff --git a/docs/api/ArangoJob.V1.md b/docs/api/ArangoJob.V1.md index 20345b134..12c3b51ab 100644 --- a/docs/api/ArangoJob.V1.md +++ b/docs/api/ArangoJob.V1.md @@ -10,7 +10,7 @@ title: ArangoJob V1 ### .spec.arangoDeploymentName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/apps/v1/job_spec.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/apps/v1/job_spec.go#L27) ArangoDeploymentName holds the name of ArangoDeployment @@ -18,7 +18,7 @@ ArangoDeploymentName holds the name of ArangoDeployment ### .spec.jobTemplate -Type: `batch.JobSpec` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/apps/v1/job_spec.go#L33) +Type: `batch.JobSpec` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/apps/v1/job_spec.go#L33) JobTemplate holds the Kubernetes Job Template diff --git a/docs/api/ArangoLocalStorage.V1Alpha.md b/docs/api/ArangoLocalStorage.V1Alpha.md index 1b44b3e61..c5562f0a4 100644 --- a/docs/api/ArangoLocalStorage.V1Alpha.md +++ b/docs/api/ArangoLocalStorage.V1Alpha.md @@ -10,7 +10,7 @@ title: ArangoLocalStorage V1Alpha ### .spec.localPath -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/local_storage_spec.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/local_storage_spec.go#L36) LocalPath setting specifies one or more local directories (on the nodes) used to create persistent volumes in. @@ -18,7 +18,7 @@ LocalPath setting specifies one or more local directories (on the nodes) used to ### .spec.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/local_storage_spec.go#L43) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/local_storage_spec.go#L43) NodeSelector setting specifies which nodes the operator will provision persistent volumes on. @@ -26,7 +26,7 @@ NodeSelector setting specifies which nodes the operator will provision persisten ### .spec.podCustomization.priority -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/local_storage_pod_customization.go#L25) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/local_storage_pod_customization.go#L25) Priority if defined, sets the priority for pods of storage provisioner @@ -34,7 +34,7 @@ Priority if defined, sets the priority for pods of storage provisioner ### .spec.privileged -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/local_storage_spec.go#L45) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/local_storage_spec.go#L45) Privileged if set, passes Privileged flag to SecurityContext for pods of storage provisioner @@ -42,7 +42,7 @@ Privileged if set, passes Privileged flag to SecurityContext for pods of storage ### .spec.storageClass.isDefault -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/storage_class_spec.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/storage_class_spec.go#L42) IsDefault setting specifies if the created `StorageClass` will be marked as default storage class. @@ -53,7 +53,7 @@ Default Value: `false` ### .spec.storageClass.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/storage_class_spec.go#L38) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/storage_class_spec.go#L38) Name setting specifies the name of the storage class that created `PersistentVolume` will use. @@ -66,7 +66,7 @@ Default Value: `""` ### .spec.storageClass.reclaimPolicy -Type: `core.PersistentVolumeReclaimPolicy` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/storage_class_spec.go#L46) +Type: `core.PersistentVolumeReclaimPolicy` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/storage_class_spec.go#L46) ReclaimPolicy defines what happens to a persistent volume when released from its claim. @@ -77,7 +77,7 @@ Links: ### .spec.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/storage/v1alpha/local_storage_spec.go#L41) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/storage/v1alpha/local_storage_spec.go#L41) Tolerations specifies the tolerations added to pods of storage provisioner diff --git a/docs/api/ArangoMLBatchJob.V1Alpha1.md b/docs/api/ArangoMLBatchJob.V1Alpha1.md index 12f938fdd..df52ebc09 100644 --- a/docs/api/ArangoMLBatchJob.V1Alpha1.md +++ b/docs/api/ArangoMLBatchJob.V1Alpha1.md @@ -10,7 +10,7 @@ title: ArangoMLBatchJob V1Alpha1 ### .spec -Type: `batch.Job` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/batchjob_spec.go#L33) +Type: `batch.Job` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/batchjob_spec.go#L33) Links: * [Kubernetes Documentation](https://godoc.org/k8s.io/api/batch/v1#JobSpec) @@ -19,7 +19,7 @@ Links: ### .status -Type: `batch.JobStatus` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/batchjob_status.go#L37) +Type: `batch.JobStatus` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/batchjob_status.go#L37) Links: * [Kubernetes Documentation](https://godoc.org/k8s.io/api/batch/v1#JobStatus) @@ -28,7 +28,7 @@ Links: ### .status.mlConditions -Type: `api.MLConditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/batchjob_status.go#L33) +Type: `api.MLConditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/batchjob_status.go#L33) MLConditions specific to the entire batch job @@ -36,7 +36,7 @@ MLConditions specific to the entire batch job ### .status.ref.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -44,7 +44,7 @@ UID keeps the information about object Checksum ### .status.ref.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -52,7 +52,7 @@ Name of the object ### .status.ref.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -60,7 +60,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.ref.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID diff --git a/docs/api/ArangoMLCronJob.V1Alpha1.md b/docs/api/ArangoMLCronJob.V1Alpha1.md index 9647c84fc..8453adc79 100644 --- a/docs/api/ArangoMLCronJob.V1Alpha1.md +++ b/docs/api/ArangoMLCronJob.V1Alpha1.md @@ -10,7 +10,7 @@ title: ArangoMLCronJob V1Alpha1 ### .spec -Type: `batch.CronJobSpec` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/cronjob_spec.go#L33) +Type: `batch.CronJobSpec` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/cronjob_spec.go#L33) Links: * [Kubernetes Documentation](https://godoc.org/k8s.io/api/batch/v1#CronJobSpec) @@ -19,7 +19,7 @@ Links: ### .status -Type: `batch.CronJobStatus` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/cronjob_status.go#L37) +Type: `batch.CronJobStatus` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/cronjob_status.go#L37) Links: * [Kubernetes Documentation](https://godoc.org/k8s.io/api/batch/v1#CronJobStatus) @@ -28,7 +28,7 @@ Links: ### .status.mlConditions -Type: `api.MLConditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/cronjob_status.go#L33) +Type: `api.MLConditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/cronjob_status.go#L33) MLConditions specific to the entire cron job @@ -36,7 +36,7 @@ MLConditions specific to the entire cron job ### .status.ref.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -44,7 +44,7 @@ UID keeps the information about object Checksum ### .status.ref.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -52,7 +52,7 @@ Name of the object ### .status.ref.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -60,7 +60,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.ref.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID diff --git a/docs/api/ArangoMLExtension.V1Alpha1.md b/docs/api/ArangoMLExtension.V1Alpha1.md index 742db462a..ebe6af4a2 100644 --- a/docs/api/ArangoMLExtension.V1Alpha1.md +++ b/docs/api/ArangoMLExtension.V1Alpha1.md @@ -10,7 +10,7 @@ title: ArangoMLExtension V1Alpha1 ### .spec.deployment.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -21,7 +21,7 @@ Links: ### .spec.deployment.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -34,7 +34,7 @@ Links: ### .spec.deployment.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -51,7 +51,7 @@ Links: ### .spec.deployment.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -59,7 +59,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.deployment.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -76,7 +76,7 @@ Links: ### .spec.deployment.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -87,7 +87,7 @@ Links: ### .spec.deployment.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -98,7 +98,7 @@ Links: ### .spec.deployment.gpu -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L56) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L56) GPU defined if GPU Jobs are enabled. @@ -108,7 +108,7 @@ Default Value: `false` ### .spec.deployment.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -118,7 +118,7 @@ Default Value: `false` ### .spec.deployment.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -129,7 +129,7 @@ Default Value: `false` ### .spec.deployment.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -139,7 +139,7 @@ Default Value: `false` ### .spec.deployment.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -147,7 +147,7 @@ Image define image details ### .spec.deployment.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -157,7 +157,7 @@ Default Value: `IfNotPresent` ### .spec.deployment.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -165,7 +165,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.deployment.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -178,7 +178,7 @@ Links: ### .spec.deployment.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -186,7 +186,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.deployment.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -198,7 +198,7 @@ Links: ### .spec.deployment.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -209,7 +209,7 @@ Links: ### .spec.deployment.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -220,7 +220,7 @@ There cannot be more than one managing controller. ### .spec.deployment.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -231,7 +231,7 @@ Links: ### .spec.deployment.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L59) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L59) Port defines on which port the container will be listening for connections @@ -239,7 +239,7 @@ Port defines on which port the container will be listening for connections ### .spec.deployment.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -250,7 +250,7 @@ accessible from the network. ### .spec.deployment.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -262,7 +262,7 @@ Links: ### .spec.deployment.replicas -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L40) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_spec_deployment.go#L40) Replicas defines the number of replicas running specified components. No replicas created if no components are defined. @@ -272,7 +272,7 @@ Default Value: `1` ### .spec.deployment.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -283,7 +283,7 @@ Links: ### .spec.deployment.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -294,7 +294,7 @@ Default Value: `""` ### .spec.deployment.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -305,7 +305,7 @@ Links: ### .spec.deployment.service.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_spec_deployment_service.go#L38) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_spec_deployment_service.go#L38) Type determines how the Service is exposed @@ -323,7 +323,7 @@ Possible Values: ### .spec.deployment.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -334,7 +334,7 @@ Links: ### .spec.deployment.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -347,7 +347,7 @@ Default Value: `false` ### .spec.deployment.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -362,7 +362,7 @@ Links: ### .spec.deployment.tls.altNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/tls.go#L28) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/tls.go#L28) AltNames define TLS AltNames used when TLS on the ArangoDB is enabled @@ -370,7 +370,7 @@ AltNames define TLS AltNames used when TLS on the ArangoDB is enabled ### .spec.deployment.tls.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/tls.go#L25) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/tls.go#L25) Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings @@ -378,7 +378,7 @@ Enabled define if TLS Should be enabled. If is not set then default is taken fro ### .spec.deployment.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -389,7 +389,7 @@ Links: ### .spec.deployment.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -397,7 +397,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.deployment.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -408,7 +408,7 @@ Links: ### .spec.deployment.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -418,7 +418,7 @@ might be configured in the container image. ### .spec.init.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -429,7 +429,7 @@ Links: ### .spec.init.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -442,7 +442,7 @@ Links: ### .spec.init.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -459,7 +459,7 @@ Links: ### .spec.init.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -467,7 +467,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.init.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -484,7 +484,7 @@ Links: ### .spec.init.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -495,7 +495,7 @@ Links: ### .spec.init.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -506,7 +506,7 @@ Links: ### .spec.init.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -516,7 +516,7 @@ Default Value: `false` ### .spec.init.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -527,7 +527,7 @@ Default Value: `false` ### .spec.init.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -537,7 +537,7 @@ Default Value: `false` ### .spec.init.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -545,7 +545,7 @@ Image define image details ### .spec.init.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -555,7 +555,7 @@ Default Value: `IfNotPresent` ### .spec.init.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -563,7 +563,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.init.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -576,7 +576,7 @@ Links: ### .spec.init.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -584,7 +584,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.init.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -596,7 +596,7 @@ Links: ### .spec.init.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -607,7 +607,7 @@ Links: ### .spec.init.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -618,7 +618,7 @@ There cannot be more than one managing controller. ### .spec.init.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -629,7 +629,7 @@ Links: ### .spec.init.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -640,7 +640,7 @@ accessible from the network. ### .spec.init.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -652,7 +652,7 @@ Links: ### .spec.init.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -663,7 +663,7 @@ Links: ### .spec.init.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -674,7 +674,7 @@ Default Value: `""` ### .spec.init.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -685,7 +685,7 @@ Links: ### .spec.init.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -696,7 +696,7 @@ Links: ### .spec.init.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -709,7 +709,7 @@ Default Value: `false` ### .spec.init.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -724,7 +724,7 @@ Links: ### .spec.init.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -735,7 +735,7 @@ Links: ### .spec.init.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -743,7 +743,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.init.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -754,7 +754,7 @@ Links: ### .spec.init.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -764,7 +764,7 @@ might be configured in the container image. ### .spec.jobsTemplates.featurization.cpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -775,7 +775,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -788,7 +788,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -805,7 +805,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -813,7 +813,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.featurization.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -830,7 +830,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -841,7 +841,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -852,7 +852,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -862,7 +862,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -873,7 +873,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -883,7 +883,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -891,7 +891,7 @@ Image define image details ### .spec.jobsTemplates.featurization.cpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -901,7 +901,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.featurization.cpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -909,7 +909,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.featurization.cpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -922,7 +922,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -930,7 +930,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.featurization.cpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -942,7 +942,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -953,7 +953,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -964,7 +964,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.featurization.cpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -975,7 +975,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -986,7 +986,7 @@ accessible from the network. ### .spec.jobsTemplates.featurization.cpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -998,7 +998,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -1009,7 +1009,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -1020,7 +1020,7 @@ Default Value: `""` ### .spec.jobsTemplates.featurization.cpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -1031,7 +1031,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -1042,7 +1042,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -1055,7 +1055,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -1070,7 +1070,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -1081,7 +1081,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -1089,7 +1089,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.featurization.cpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -1100,7 +1100,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -1110,7 +1110,7 @@ might be configured in the container image. ### .spec.jobsTemplates.featurization.gpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -1121,7 +1121,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -1134,7 +1134,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1151,7 +1151,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -1159,7 +1159,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.featurization.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1176,7 +1176,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -1187,7 +1187,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -1198,7 +1198,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -1208,7 +1208,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -1219,7 +1219,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -1229,7 +1229,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -1237,7 +1237,7 @@ Image define image details ### .spec.jobsTemplates.featurization.gpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -1247,7 +1247,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.featurization.gpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -1255,7 +1255,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.featurization.gpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -1268,7 +1268,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -1276,7 +1276,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.featurization.gpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -1288,7 +1288,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -1299,7 +1299,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -1310,7 +1310,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.featurization.gpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -1321,7 +1321,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -1332,7 +1332,7 @@ accessible from the network. ### .spec.jobsTemplates.featurization.gpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -1344,7 +1344,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -1355,7 +1355,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -1366,7 +1366,7 @@ Default Value: `""` ### .spec.jobsTemplates.featurization.gpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -1377,7 +1377,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -1388,7 +1388,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -1401,7 +1401,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -1416,7 +1416,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -1427,7 +1427,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -1435,7 +1435,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.featurization.gpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -1446,7 +1446,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -1456,7 +1456,7 @@ might be configured in the container image. ### .spec.jobsTemplates.prediction.cpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -1467,7 +1467,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -1480,7 +1480,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1497,7 +1497,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -1505,7 +1505,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.prediction.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1522,7 +1522,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -1533,7 +1533,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -1544,7 +1544,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -1554,7 +1554,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -1565,7 +1565,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -1575,7 +1575,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -1583,7 +1583,7 @@ Image define image details ### .spec.jobsTemplates.prediction.cpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -1593,7 +1593,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.prediction.cpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -1601,7 +1601,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.prediction.cpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -1614,7 +1614,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -1622,7 +1622,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.prediction.cpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -1634,7 +1634,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -1645,7 +1645,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -1656,7 +1656,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.prediction.cpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -1667,7 +1667,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -1678,7 +1678,7 @@ accessible from the network. ### .spec.jobsTemplates.prediction.cpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -1690,7 +1690,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -1701,7 +1701,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -1712,7 +1712,7 @@ Default Value: `""` ### .spec.jobsTemplates.prediction.cpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -1723,7 +1723,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -1734,7 +1734,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -1747,7 +1747,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -1762,7 +1762,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -1773,7 +1773,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -1781,7 +1781,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.prediction.cpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -1792,7 +1792,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -1802,7 +1802,7 @@ might be configured in the container image. ### .spec.jobsTemplates.prediction.gpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -1813,7 +1813,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -1826,7 +1826,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1843,7 +1843,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -1851,7 +1851,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.prediction.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1868,7 +1868,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -1879,7 +1879,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -1890,7 +1890,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -1900,7 +1900,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -1911,7 +1911,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -1921,7 +1921,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -1929,7 +1929,7 @@ Image define image details ### .spec.jobsTemplates.prediction.gpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -1939,7 +1939,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.prediction.gpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -1947,7 +1947,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.prediction.gpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -1960,7 +1960,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -1968,7 +1968,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.prediction.gpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -1980,7 +1980,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -1991,7 +1991,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -2002,7 +2002,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.prediction.gpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -2013,7 +2013,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -2024,7 +2024,7 @@ accessible from the network. ### .spec.jobsTemplates.prediction.gpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -2036,7 +2036,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -2047,7 +2047,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -2058,7 +2058,7 @@ Default Value: `""` ### .spec.jobsTemplates.prediction.gpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -2069,7 +2069,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -2080,7 +2080,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -2093,7 +2093,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -2108,7 +2108,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -2119,7 +2119,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -2127,7 +2127,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.prediction.gpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -2138,7 +2138,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2148,7 +2148,7 @@ might be configured in the container image. ### .spec.jobsTemplates.training.cpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -2159,7 +2159,7 @@ Links: ### .spec.jobsTemplates.training.cpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -2172,7 +2172,7 @@ Links: ### .spec.jobsTemplates.training.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2189,7 +2189,7 @@ Links: ### .spec.jobsTemplates.training.cpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -2197,7 +2197,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.training.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2214,7 +2214,7 @@ Links: ### .spec.jobsTemplates.training.cpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -2225,7 +2225,7 @@ Links: ### .spec.jobsTemplates.training.cpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -2236,7 +2236,7 @@ Links: ### .spec.jobsTemplates.training.cpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -2246,7 +2246,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -2257,7 +2257,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -2267,7 +2267,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -2275,7 +2275,7 @@ Image define image details ### .spec.jobsTemplates.training.cpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -2285,7 +2285,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.training.cpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -2293,7 +2293,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.training.cpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -2306,7 +2306,7 @@ Links: ### .spec.jobsTemplates.training.cpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -2314,7 +2314,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.training.cpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -2326,7 +2326,7 @@ Links: ### .spec.jobsTemplates.training.cpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -2337,7 +2337,7 @@ Links: ### .spec.jobsTemplates.training.cpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -2348,7 +2348,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.training.cpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -2359,7 +2359,7 @@ Links: ### .spec.jobsTemplates.training.cpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -2370,7 +2370,7 @@ accessible from the network. ### .spec.jobsTemplates.training.cpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -2382,7 +2382,7 @@ Links: ### .spec.jobsTemplates.training.cpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -2393,7 +2393,7 @@ Links: ### .spec.jobsTemplates.training.cpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -2404,7 +2404,7 @@ Default Value: `""` ### .spec.jobsTemplates.training.cpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -2415,7 +2415,7 @@ Links: ### .spec.jobsTemplates.training.cpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -2426,7 +2426,7 @@ Links: ### .spec.jobsTemplates.training.cpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -2439,7 +2439,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -2454,7 +2454,7 @@ Links: ### .spec.jobsTemplates.training.cpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -2465,7 +2465,7 @@ Links: ### .spec.jobsTemplates.training.cpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -2473,7 +2473,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.training.cpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -2484,7 +2484,7 @@ Links: ### .spec.jobsTemplates.training.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2494,7 +2494,7 @@ might be configured in the container image. ### .spec.jobsTemplates.training.gpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -2505,7 +2505,7 @@ Links: ### .spec.jobsTemplates.training.gpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -2518,7 +2518,7 @@ Links: ### .spec.jobsTemplates.training.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2535,7 +2535,7 @@ Links: ### .spec.jobsTemplates.training.gpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -2543,7 +2543,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.training.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2560,7 +2560,7 @@ Links: ### .spec.jobsTemplates.training.gpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -2571,7 +2571,7 @@ Links: ### .spec.jobsTemplates.training.gpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -2582,7 +2582,7 @@ Links: ### .spec.jobsTemplates.training.gpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -2592,7 +2592,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -2603,7 +2603,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -2613,7 +2613,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -2621,7 +2621,7 @@ Image define image details ### .spec.jobsTemplates.training.gpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -2631,7 +2631,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.training.gpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -2639,7 +2639,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.training.gpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -2652,7 +2652,7 @@ Links: ### .spec.jobsTemplates.training.gpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -2660,7 +2660,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.training.gpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -2672,7 +2672,7 @@ Links: ### .spec.jobsTemplates.training.gpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -2683,7 +2683,7 @@ Links: ### .spec.jobsTemplates.training.gpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -2694,7 +2694,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.training.gpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -2705,7 +2705,7 @@ Links: ### .spec.jobsTemplates.training.gpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -2716,7 +2716,7 @@ accessible from the network. ### .spec.jobsTemplates.training.gpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -2728,7 +2728,7 @@ Links: ### .spec.jobsTemplates.training.gpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -2739,7 +2739,7 @@ Links: ### .spec.jobsTemplates.training.gpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -2750,7 +2750,7 @@ Default Value: `""` ### .spec.jobsTemplates.training.gpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -2761,7 +2761,7 @@ Links: ### .spec.jobsTemplates.training.gpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -2772,7 +2772,7 @@ Links: ### .spec.jobsTemplates.training.gpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -2785,7 +2785,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -2800,7 +2800,7 @@ Links: ### .spec.jobsTemplates.training.gpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -2811,7 +2811,7 @@ Links: ### .spec.jobsTemplates.training.gpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -2819,7 +2819,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.training.gpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -2830,7 +2830,7 @@ Links: ### .spec.jobsTemplates.training.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2840,7 +2840,7 @@ might be configured in the container image. ### .spec.metadataService.local.arangoMLFeatureStore -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_spec_metadata_service.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_spec_metadata_service.go#L65) ArangoMLFeatureStoreDatabase define Database name to be used as MetadataService Backend in ArangoMLFeatureStoreDatabase @@ -2850,7 +2850,7 @@ Default Value: `arangomlfeaturestore` ### .spec.metadataService.local.arangoPipeDatabase -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_spec_metadata_service.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_spec_metadata_service.go#L61) ArangoPipeDatabase define Database name to be used as MetadataService Backend in ArangoPipe @@ -2860,7 +2860,7 @@ Default Value: `arangopipe` ### .spec.storage.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -2868,7 +2868,7 @@ UID keeps the information about object Checksum ### .spec.storage.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -2876,7 +2876,7 @@ Name of the object ### .spec.storage.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -2884,7 +2884,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.storage.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -2892,7 +2892,7 @@ UID keeps the information about object UID ### .status.arangoDB.secret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -2900,7 +2900,7 @@ UID keeps the information about object Checksum ### .status.arangoDB.secret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -2908,7 +2908,7 @@ Name of the object ### .status.arangoDB.secret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -2916,7 +2916,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.arangoDB.secret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -2924,7 +2924,7 @@ UID keeps the information about object UID ### .status.arangoDB.tls.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -2932,7 +2932,7 @@ UID keeps the information about object Checksum ### .status.arangoDB.tls.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -2940,7 +2940,7 @@ Name of the object ### .status.arangoDB.tls.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -2948,7 +2948,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.arangoDB.tls.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -2956,7 +2956,7 @@ UID keeps the information about object UID ### .status.conditions -Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_status.go#L31) +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_status.go#L31) Conditions specific to the entire extension @@ -2964,7 +2964,7 @@ Conditions specific to the entire extension ### .status.metadataService.local.arangoMLFeatureStore -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_status_metadata_service.go#L38) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_status_metadata_service.go#L38) ArangoMLFeatureStoreDatabase define Database name to be used as MetadataService Backend @@ -2972,7 +2972,7 @@ ArangoMLFeatureStoreDatabase define Database name to be used as MetadataService ### .status.metadataService.local.arangoPipe -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/extension_status_metadata_service.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/extension_status_metadata_service.go#L35) ArangoPipeDatabase define Database name to be used as MetadataService Backend @@ -2980,7 +2980,7 @@ ArangoPipeDatabase define Database name to be used as MetadataService Backend ### .status.metadataService.secret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -2988,7 +2988,7 @@ UID keeps the information about object Checksum ### .status.metadataService.secret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -2996,7 +2996,7 @@ Name of the object ### .status.metadataService.secret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3004,7 +3004,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.metadataService.secret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3012,7 +3012,7 @@ UID keeps the information about object UID ### .status.reconciliation.service.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3020,7 +3020,7 @@ UID keeps the information about object Checksum ### .status.reconciliation.service.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3028,7 +3028,7 @@ Name of the object ### .status.reconciliation.service.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3036,7 +3036,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.reconciliation.service.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3044,7 +3044,7 @@ UID keeps the information about object UID ### .status.reconciliation.statefulSet.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3052,7 +3052,7 @@ UID keeps the information about object Checksum ### .status.reconciliation.statefulSet.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3060,7 +3060,7 @@ Name of the object ### .status.reconciliation.statefulSet.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3068,7 +3068,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.reconciliation.statefulSet.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3076,7 +3076,7 @@ UID keeps the information about object UID ### .status.serviceAccount.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3084,7 +3084,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.cluster.binding.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3092,7 +3092,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.cluster.binding.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3100,7 +3100,7 @@ Name of the object ### .status.serviceAccount.cluster.binding.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3108,7 +3108,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.cluster.binding.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3116,7 +3116,7 @@ UID keeps the information about object UID ### .status.serviceAccount.cluster.role.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3124,7 +3124,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.cluster.role.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3132,7 +3132,7 @@ Name of the object ### .status.serviceAccount.cluster.role.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3140,7 +3140,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.cluster.role.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3148,7 +3148,7 @@ UID keeps the information about object UID ### .status.serviceAccount.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3156,7 +3156,7 @@ Name of the object ### .status.serviceAccount.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3164,7 +3164,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.namespaced.binding.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3172,7 +3172,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.namespaced.binding.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3180,7 +3180,7 @@ Name of the object ### .status.serviceAccount.namespaced.binding.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3188,7 +3188,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.namespaced.binding.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3196,7 +3196,7 @@ UID keeps the information about object UID ### .status.serviceAccount.namespaced.role.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3204,7 +3204,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.namespaced.role.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3212,7 +3212,7 @@ Name of the object ### .status.serviceAccount.namespaced.role.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3220,7 +3220,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.namespaced.role.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3228,7 +3228,7 @@ UID keeps the information about object UID ### .status.serviceAccount.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID diff --git a/docs/api/ArangoMLExtension.V1Beta1.md b/docs/api/ArangoMLExtension.V1Beta1.md index 729fafd28..7cd7e931a 100644 --- a/docs/api/ArangoMLExtension.V1Beta1.md +++ b/docs/api/ArangoMLExtension.V1Beta1.md @@ -10,7 +10,7 @@ title: ArangoMLExtension V1Beta1 ### .spec.deployment.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -21,7 +21,7 @@ Links: ### .spec.deployment.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -34,7 +34,7 @@ Links: ### .spec.deployment.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -51,7 +51,7 @@ Links: ### .spec.deployment.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -59,7 +59,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.deployment.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -76,7 +76,7 @@ Links: ### .spec.deployment.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -87,7 +87,7 @@ Links: ### .spec.deployment.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -98,7 +98,7 @@ Links: ### .spec.deployment.gpu -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L56) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L56) GPU defined if GPU Jobs are enabled. @@ -108,7 +108,7 @@ Default Value: `false` ### .spec.deployment.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -118,7 +118,7 @@ Default Value: `false` ### .spec.deployment.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -129,7 +129,7 @@ Default Value: `false` ### .spec.deployment.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -139,7 +139,7 @@ Default Value: `false` ### .spec.deployment.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -147,7 +147,7 @@ Image define image details ### .spec.deployment.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -157,7 +157,7 @@ Default Value: `IfNotPresent` ### .spec.deployment.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -165,7 +165,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.deployment.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -178,7 +178,7 @@ Links: ### .spec.deployment.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -186,7 +186,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.deployment.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -198,7 +198,7 @@ Links: ### .spec.deployment.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -210,7 +210,7 @@ Possible Values: ### .spec.deployment.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -221,7 +221,7 @@ Links: ### .spec.deployment.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -232,7 +232,7 @@ There cannot be more than one managing controller. ### .spec.deployment.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -243,7 +243,7 @@ Links: ### .spec.deployment.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L59) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L59) Port defines on which port the container will be listening for connections @@ -251,7 +251,7 @@ Port defines on which port the container will be listening for connections ### .spec.deployment.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -262,7 +262,7 @@ accessible from the network. ### .spec.deployment.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -274,7 +274,7 @@ Links: ### .spec.deployment.replicas -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L40) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_spec_deployment.go#L40) Replicas defines the number of replicas running specified components. No replicas created if no components are defined. @@ -284,7 +284,7 @@ Default Value: `1` ### .spec.deployment.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -295,7 +295,7 @@ Links: ### .spec.deployment.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -306,7 +306,7 @@ Default Value: `""` ### .spec.deployment.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -317,7 +317,7 @@ Links: ### .spec.deployment.service.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_spec_deployment_service.go#L38) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_spec_deployment_service.go#L38) Type determines how the Service is exposed @@ -335,7 +335,7 @@ Possible Values: ### .spec.deployment.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -346,7 +346,7 @@ Links: ### .spec.deployment.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -359,7 +359,7 @@ Default Value: `false` ### .spec.deployment.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -374,7 +374,7 @@ Links: ### .spec.deployment.tls.altNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/tls.go#L28) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/tls.go#L28) AltNames define TLS AltNames used when TLS on the ArangoDB is enabled @@ -382,7 +382,7 @@ AltNames define TLS AltNames used when TLS on the ArangoDB is enabled ### .spec.deployment.tls.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/tls.go#L25) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/tls.go#L25) Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings @@ -390,7 +390,7 @@ Enabled define if TLS Should be enabled. If is not set then default is taken fro ### .spec.deployment.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -401,7 +401,7 @@ Links: ### .spec.deployment.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -409,7 +409,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.deployment.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -420,7 +420,7 @@ Links: ### .spec.deployment.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -430,7 +430,7 @@ might be configured in the container image. ### .spec.init.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -441,7 +441,7 @@ Links: ### .spec.init.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -454,7 +454,7 @@ Links: ### .spec.init.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -471,7 +471,7 @@ Links: ### .spec.init.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -479,7 +479,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.init.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -496,7 +496,7 @@ Links: ### .spec.init.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -507,7 +507,7 @@ Links: ### .spec.init.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -518,7 +518,7 @@ Links: ### .spec.init.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -528,7 +528,7 @@ Default Value: `false` ### .spec.init.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -539,7 +539,7 @@ Default Value: `false` ### .spec.init.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -549,7 +549,7 @@ Default Value: `false` ### .spec.init.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -557,7 +557,7 @@ Image define image details ### .spec.init.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -567,7 +567,7 @@ Default Value: `IfNotPresent` ### .spec.init.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -575,7 +575,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.init.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -588,7 +588,7 @@ Links: ### .spec.init.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -596,7 +596,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.init.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -608,7 +608,7 @@ Links: ### .spec.init.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -620,7 +620,7 @@ Possible Values: ### .spec.init.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -631,7 +631,7 @@ Links: ### .spec.init.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -642,7 +642,7 @@ There cannot be more than one managing controller. ### .spec.init.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -653,7 +653,7 @@ Links: ### .spec.init.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -664,7 +664,7 @@ accessible from the network. ### .spec.init.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -676,7 +676,7 @@ Links: ### .spec.init.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -687,7 +687,7 @@ Links: ### .spec.init.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -698,7 +698,7 @@ Default Value: `""` ### .spec.init.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -709,7 +709,7 @@ Links: ### .spec.init.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -720,7 +720,7 @@ Links: ### .spec.init.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -733,7 +733,7 @@ Default Value: `false` ### .spec.init.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -748,7 +748,7 @@ Links: ### .spec.init.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -759,7 +759,7 @@ Links: ### .spec.init.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -767,7 +767,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.init.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -778,7 +778,7 @@ Links: ### .spec.init.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -788,7 +788,7 @@ might be configured in the container image. ### .spec.integrationSidecar.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -805,7 +805,7 @@ Links: ### .spec.integrationSidecar.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -822,7 +822,7 @@ Links: ### .spec.integrationSidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -832,7 +832,7 @@ Default Value: `9202` ### .spec.integrationSidecar.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -843,7 +843,7 @@ Links: ### .spec.integrationSidecar.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -854,7 +854,7 @@ Links: ### .spec.integrationSidecar.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -862,7 +862,7 @@ Image define image details ### .spec.integrationSidecar.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -872,7 +872,7 @@ Default Value: `IfNotPresent` ### .spec.integrationSidecar.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -880,7 +880,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.integrationSidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) ListenPort defines on which port the sidecar container will be listening for connections @@ -890,7 +890,7 @@ Default Value: `9201` ### .spec.integrationSidecar.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -902,7 +902,7 @@ Links: ### .spec.integrationSidecar.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -914,7 +914,7 @@ Possible Values: ### .spec.integrationSidecar.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -925,7 +925,7 @@ accessible from the network. ### .spec.integrationSidecar.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -937,7 +937,7 @@ Links: ### .spec.integrationSidecar.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -948,7 +948,7 @@ Links: ### .spec.integrationSidecar.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -959,7 +959,7 @@ Links: ### .spec.integrationSidecar.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -974,7 +974,7 @@ Links: ### .spec.integrationSidecar.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -982,7 +982,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.integrationSidecar.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -992,7 +992,7 @@ might be configured in the container image. ### .spec.jobsTemplates.featurization.cpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -1003,7 +1003,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -1016,7 +1016,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1033,7 +1033,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -1041,7 +1041,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.featurization.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1058,7 +1058,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -1069,7 +1069,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -1080,7 +1080,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -1090,7 +1090,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -1101,7 +1101,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -1111,7 +1111,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -1119,7 +1119,7 @@ Image define image details ### .spec.jobsTemplates.featurization.cpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -1129,7 +1129,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.featurization.cpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -1137,7 +1137,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.featurization.cpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -1150,7 +1150,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -1158,7 +1158,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.featurization.cpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -1170,7 +1170,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -1182,7 +1182,7 @@ Possible Values: ### .spec.jobsTemplates.featurization.cpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -1193,7 +1193,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -1204,7 +1204,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.featurization.cpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -1215,7 +1215,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -1226,7 +1226,7 @@ accessible from the network. ### .spec.jobsTemplates.featurization.cpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -1238,7 +1238,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -1249,7 +1249,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -1260,7 +1260,7 @@ Default Value: `""` ### .spec.jobsTemplates.featurization.cpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -1271,7 +1271,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -1282,7 +1282,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -1295,7 +1295,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.cpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -1310,7 +1310,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -1321,7 +1321,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -1329,7 +1329,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.featurization.cpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -1340,7 +1340,7 @@ Links: ### .spec.jobsTemplates.featurization.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -1350,7 +1350,7 @@ might be configured in the container image. ### .spec.jobsTemplates.featurization.gpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -1361,7 +1361,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -1374,7 +1374,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1391,7 +1391,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -1399,7 +1399,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.featurization.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1416,7 +1416,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -1427,7 +1427,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -1438,7 +1438,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -1448,7 +1448,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -1459,7 +1459,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -1469,7 +1469,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -1477,7 +1477,7 @@ Image define image details ### .spec.jobsTemplates.featurization.gpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -1487,7 +1487,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.featurization.gpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -1495,7 +1495,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.featurization.gpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -1508,7 +1508,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -1516,7 +1516,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.featurization.gpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -1528,7 +1528,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -1540,7 +1540,7 @@ Possible Values: ### .spec.jobsTemplates.featurization.gpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -1551,7 +1551,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -1562,7 +1562,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.featurization.gpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -1573,7 +1573,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -1584,7 +1584,7 @@ accessible from the network. ### .spec.jobsTemplates.featurization.gpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -1596,7 +1596,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -1607,7 +1607,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -1618,7 +1618,7 @@ Default Value: `""` ### .spec.jobsTemplates.featurization.gpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -1629,7 +1629,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -1640,7 +1640,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -1653,7 +1653,7 @@ Default Value: `false` ### .spec.jobsTemplates.featurization.gpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -1668,7 +1668,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -1679,7 +1679,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -1687,7 +1687,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.featurization.gpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -1698,7 +1698,7 @@ Links: ### .spec.jobsTemplates.featurization.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -1708,7 +1708,7 @@ might be configured in the container image. ### .spec.jobsTemplates.prediction.cpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -1719,7 +1719,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -1732,7 +1732,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -1749,7 +1749,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -1757,7 +1757,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.prediction.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -1774,7 +1774,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -1785,7 +1785,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -1796,7 +1796,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -1806,7 +1806,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -1817,7 +1817,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -1827,7 +1827,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -1835,7 +1835,7 @@ Image define image details ### .spec.jobsTemplates.prediction.cpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -1845,7 +1845,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.prediction.cpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -1853,7 +1853,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.prediction.cpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -1866,7 +1866,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -1874,7 +1874,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.prediction.cpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -1886,7 +1886,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -1898,7 +1898,7 @@ Possible Values: ### .spec.jobsTemplates.prediction.cpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -1909,7 +1909,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -1920,7 +1920,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.prediction.cpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -1931,7 +1931,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -1942,7 +1942,7 @@ accessible from the network. ### .spec.jobsTemplates.prediction.cpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -1954,7 +1954,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -1965,7 +1965,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -1976,7 +1976,7 @@ Default Value: `""` ### .spec.jobsTemplates.prediction.cpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -1987,7 +1987,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -1998,7 +1998,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -2011,7 +2011,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.cpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -2026,7 +2026,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -2037,7 +2037,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -2045,7 +2045,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.prediction.cpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -2056,7 +2056,7 @@ Links: ### .spec.jobsTemplates.prediction.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2066,7 +2066,7 @@ might be configured in the container image. ### .spec.jobsTemplates.prediction.gpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -2077,7 +2077,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -2090,7 +2090,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2107,7 +2107,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -2115,7 +2115,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.prediction.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2132,7 +2132,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -2143,7 +2143,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -2154,7 +2154,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -2164,7 +2164,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -2175,7 +2175,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -2185,7 +2185,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -2193,7 +2193,7 @@ Image define image details ### .spec.jobsTemplates.prediction.gpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -2203,7 +2203,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.prediction.gpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -2211,7 +2211,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.prediction.gpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -2224,7 +2224,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -2232,7 +2232,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.prediction.gpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -2244,7 +2244,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -2256,7 +2256,7 @@ Possible Values: ### .spec.jobsTemplates.prediction.gpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -2267,7 +2267,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -2278,7 +2278,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.prediction.gpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -2289,7 +2289,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -2300,7 +2300,7 @@ accessible from the network. ### .spec.jobsTemplates.prediction.gpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -2312,7 +2312,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -2323,7 +2323,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -2334,7 +2334,7 @@ Default Value: `""` ### .spec.jobsTemplates.prediction.gpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -2345,7 +2345,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -2356,7 +2356,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -2369,7 +2369,7 @@ Default Value: `false` ### .spec.jobsTemplates.prediction.gpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -2384,7 +2384,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -2395,7 +2395,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -2403,7 +2403,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.prediction.gpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -2414,7 +2414,7 @@ Links: ### .spec.jobsTemplates.prediction.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2424,7 +2424,7 @@ might be configured in the container image. ### .spec.jobsTemplates.training.cpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -2435,7 +2435,7 @@ Links: ### .spec.jobsTemplates.training.cpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -2448,7 +2448,7 @@ Links: ### .spec.jobsTemplates.training.cpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2465,7 +2465,7 @@ Links: ### .spec.jobsTemplates.training.cpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -2473,7 +2473,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.training.cpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2490,7 +2490,7 @@ Links: ### .spec.jobsTemplates.training.cpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -2501,7 +2501,7 @@ Links: ### .spec.jobsTemplates.training.cpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -2512,7 +2512,7 @@ Links: ### .spec.jobsTemplates.training.cpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -2522,7 +2522,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -2533,7 +2533,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -2543,7 +2543,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -2551,7 +2551,7 @@ Image define image details ### .spec.jobsTemplates.training.cpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -2561,7 +2561,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.training.cpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -2569,7 +2569,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.training.cpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -2582,7 +2582,7 @@ Links: ### .spec.jobsTemplates.training.cpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -2590,7 +2590,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.training.cpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -2602,7 +2602,7 @@ Links: ### .spec.jobsTemplates.training.cpu.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -2614,7 +2614,7 @@ Possible Values: ### .spec.jobsTemplates.training.cpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -2625,7 +2625,7 @@ Links: ### .spec.jobsTemplates.training.cpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -2636,7 +2636,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.training.cpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -2647,7 +2647,7 @@ Links: ### .spec.jobsTemplates.training.cpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -2658,7 +2658,7 @@ accessible from the network. ### .spec.jobsTemplates.training.cpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -2670,7 +2670,7 @@ Links: ### .spec.jobsTemplates.training.cpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -2681,7 +2681,7 @@ Links: ### .spec.jobsTemplates.training.cpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -2692,7 +2692,7 @@ Default Value: `""` ### .spec.jobsTemplates.training.cpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -2703,7 +2703,7 @@ Links: ### .spec.jobsTemplates.training.cpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -2714,7 +2714,7 @@ Links: ### .spec.jobsTemplates.training.cpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -2727,7 +2727,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.cpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -2742,7 +2742,7 @@ Links: ### .spec.jobsTemplates.training.cpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -2753,7 +2753,7 @@ Links: ### .spec.jobsTemplates.training.cpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -2761,7 +2761,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.training.cpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -2772,7 +2772,7 @@ Links: ### .spec.jobsTemplates.training.cpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -2782,7 +2782,7 @@ might be configured in the container image. ### .spec.jobsTemplates.training.gpu.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -2793,7 +2793,7 @@ Links: ### .spec.jobsTemplates.training.gpu.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -2806,7 +2806,7 @@ Links: ### .spec.jobsTemplates.training.gpu.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -2823,7 +2823,7 @@ Links: ### .spec.jobsTemplates.training.gpu.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -2831,7 +2831,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.jobsTemplates.training.gpu.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -2848,7 +2848,7 @@ Links: ### .spec.jobsTemplates.training.gpu.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -2859,7 +2859,7 @@ Links: ### .spec.jobsTemplates.training.gpu.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -2870,7 +2870,7 @@ Links: ### .spec.jobsTemplates.training.gpu.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -2880,7 +2880,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -2891,7 +2891,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -2901,7 +2901,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -2909,7 +2909,7 @@ Image define image details ### .spec.jobsTemplates.training.gpu.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -2919,7 +2919,7 @@ Default Value: `IfNotPresent` ### .spec.jobsTemplates.training.gpu.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -2927,7 +2927,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.jobsTemplates.training.gpu.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -2940,7 +2940,7 @@ Links: ### .spec.jobsTemplates.training.gpu.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -2948,7 +2948,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.jobsTemplates.training.gpu.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -2960,7 +2960,7 @@ Links: ### .spec.jobsTemplates.training.gpu.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -2972,7 +2972,7 @@ Possible Values: ### .spec.jobsTemplates.training.gpu.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -2983,7 +2983,7 @@ Links: ### .spec.jobsTemplates.training.gpu.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -2994,7 +2994,7 @@ There cannot be more than one managing controller. ### .spec.jobsTemplates.training.gpu.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -3005,7 +3005,7 @@ Links: ### .spec.jobsTemplates.training.gpu.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -3016,7 +3016,7 @@ accessible from the network. ### .spec.jobsTemplates.training.gpu.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -3028,7 +3028,7 @@ Links: ### .spec.jobsTemplates.training.gpu.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -3039,7 +3039,7 @@ Links: ### .spec.jobsTemplates.training.gpu.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -3050,7 +3050,7 @@ Default Value: `""` ### .spec.jobsTemplates.training.gpu.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -3061,7 +3061,7 @@ Links: ### .spec.jobsTemplates.training.gpu.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -3072,7 +3072,7 @@ Links: ### .spec.jobsTemplates.training.gpu.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -3085,7 +3085,7 @@ Default Value: `false` ### .spec.jobsTemplates.training.gpu.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -3100,7 +3100,7 @@ Links: ### .spec.jobsTemplates.training.gpu.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -3111,7 +3111,7 @@ Links: ### .spec.jobsTemplates.training.gpu.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -3119,7 +3119,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.jobsTemplates.training.gpu.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -3130,7 +3130,7 @@ Links: ### .spec.jobsTemplates.training.gpu.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -3140,7 +3140,7 @@ might be configured in the container image. ### .spec.metadataService.local.arangoMLFeatureStore -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_spec_metadata_service.go#L65) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_spec_metadata_service.go#L65) ArangoMLFeatureStoreDatabase define Database name to be used as MetadataService Backend in ArangoMLFeatureStoreDatabase @@ -3150,7 +3150,7 @@ Default Value: `arangomlfeaturestore` ### .spec.metadataService.local.arangoPipeDatabase -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_spec_metadata_service.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_spec_metadata_service.go#L61) ArangoPipeDatabase define Database name to be used as MetadataService Backend in ArangoPipe @@ -3160,7 +3160,7 @@ Default Value: `arangopipe` ### .spec.storage.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3168,7 +3168,7 @@ UID keeps the information about object Checksum ### .spec.storage.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3176,7 +3176,7 @@ Name of the object ### .spec.storage.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3184,7 +3184,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.storage.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3192,7 +3192,7 @@ UID keeps the information about object UID ### .status.arangoDB.secret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3200,7 +3200,7 @@ UID keeps the information about object Checksum ### .status.arangoDB.secret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3208,7 +3208,7 @@ Name of the object ### .status.arangoDB.secret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3216,7 +3216,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.arangoDB.secret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3224,7 +3224,7 @@ UID keeps the information about object UID ### .status.arangoDB.tls.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3232,7 +3232,7 @@ UID keeps the information about object Checksum ### .status.arangoDB.tls.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3240,7 +3240,7 @@ Name of the object ### .status.arangoDB.tls.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3248,7 +3248,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.arangoDB.tls.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3256,7 +3256,7 @@ UID keeps the information about object UID ### .status.conditions -Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_status.go#L31) +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_status.go#L31) Conditions specific to the entire extension @@ -3264,7 +3264,7 @@ Conditions specific to the entire extension ### .status.metadataService.arangoMLFeatureStore -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L28) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L28) ArangoMLFeatureStoreDatabase define Database name to be used as MetadataService Backend @@ -3272,7 +3272,7 @@ ArangoMLFeatureStoreDatabase define Database name to be used as MetadataService ### .status.metadataService.arangoPipe -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L25) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L25) ArangoPipeDatabase define Database name to be used as MetadataService Backend @@ -3280,7 +3280,7 @@ ArangoPipeDatabase define Database name to be used as MetadataService Backend ### .status.reconciliation.service.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3288,7 +3288,7 @@ UID keeps the information about object Checksum ### .status.reconciliation.service.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3296,7 +3296,7 @@ Name of the object ### .status.reconciliation.service.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3304,7 +3304,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.reconciliation.service.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3312,7 +3312,7 @@ UID keeps the information about object UID ### .status.reconciliation.statefulSet.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3320,7 +3320,7 @@ UID keeps the information about object Checksum ### .status.reconciliation.statefulSet.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3328,7 +3328,7 @@ Name of the object ### .status.reconciliation.statefulSet.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3336,7 +3336,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.reconciliation.statefulSet.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3344,7 +3344,7 @@ UID keeps the information about object UID ### .status.serviceAccount.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3352,7 +3352,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.cluster.binding.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3360,7 +3360,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.cluster.binding.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3368,7 +3368,7 @@ Name of the object ### .status.serviceAccount.cluster.binding.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3376,7 +3376,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.cluster.binding.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3384,7 +3384,7 @@ UID keeps the information about object UID ### .status.serviceAccount.cluster.role.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3392,7 +3392,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.cluster.role.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3400,7 +3400,7 @@ Name of the object ### .status.serviceAccount.cluster.role.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3408,7 +3408,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.cluster.role.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3416,7 +3416,7 @@ UID keeps the information about object UID ### .status.serviceAccount.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3424,7 +3424,7 @@ Name of the object ### .status.serviceAccount.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3432,7 +3432,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.namespaced.binding.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3440,7 +3440,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.namespaced.binding.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3448,7 +3448,7 @@ Name of the object ### .status.serviceAccount.namespaced.binding.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3456,7 +3456,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.namespaced.binding.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3464,7 +3464,7 @@ UID keeps the information about object UID ### .status.serviceAccount.namespaced.role.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -3472,7 +3472,7 @@ UID keeps the information about object Checksum ### .status.serviceAccount.namespaced.role.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -3480,7 +3480,7 @@ Name of the object ### .status.serviceAccount.namespaced.role.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -3488,7 +3488,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.serviceAccount.namespaced.role.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -3496,7 +3496,7 @@ UID keeps the information about object UID ### .status.serviceAccount.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID diff --git a/docs/api/ArangoMLStorage.V1Alpha1.md b/docs/api/ArangoMLStorage.V1Alpha1.md index 15a1ca527..76e273d7c 100644 --- a/docs/api/ArangoMLStorage.V1Alpha1.md +++ b/docs/api/ArangoMLStorage.V1Alpha1.md @@ -10,7 +10,7 @@ title: ArangoMLStorage V1Alpha1 ### .spec.backend.s3.allowInsecure -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_spec_backend_s3.go#L40) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_spec_backend_s3.go#L40) AllowInsecure if set to true, the Endpoint certificates won't be checked @@ -20,7 +20,7 @@ Default Value: `false` ### .spec.backend.s3.caSecret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -28,7 +28,7 @@ UID keeps the information about object Checksum ### .spec.backend.s3.caSecret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -36,7 +36,7 @@ Name of the object ### .spec.backend.s3.caSecret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -44,7 +44,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.backend.s3.caSecret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -52,7 +52,7 @@ UID keeps the information about object UID ### .spec.backend.s3.credentialsSecret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -60,7 +60,7 @@ UID keeps the information about object Checksum ### .spec.backend.s3.credentialsSecret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -68,7 +68,7 @@ Name of the object ### .spec.backend.s3.credentialsSecret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -76,7 +76,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.backend.s3.credentialsSecret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -84,7 +84,7 @@ UID keeps the information about object UID ### .spec.backend.s3.endpoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_spec_backend_s3.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_spec_backend_s3.go#L34) Endpoint specifies the S3 API-compatible endpoint which implements storage Required @@ -93,7 +93,7 @@ Required ### .spec.backend.s3.region -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_spec_backend_s3.go#L49) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_spec_backend_s3.go#L49) Region defines the availability zone name. @@ -103,7 +103,7 @@ Default Value: `""` ### .spec.bucketName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_spec.go#L30) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_spec.go#L30) BucketName specifies the name of the bucket Required @@ -112,7 +112,7 @@ Required ### .spec.bucketPath -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_spec.go#L34) BucketPath specifies the path within the bucket @@ -122,7 +122,7 @@ Default Value: `/` ### .spec.mode.sidecar.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -139,7 +139,7 @@ Links: ### .spec.mode.sidecar.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -156,7 +156,7 @@ Links: ### .spec.mode.sidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_spec_mode_sidecar.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_spec_mode_sidecar.go#L36) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -166,7 +166,7 @@ Default Value: `9202` ### .spec.mode.sidecar.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -177,7 +177,7 @@ Links: ### .spec.mode.sidecar.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -188,7 +188,7 @@ Links: ### .spec.mode.sidecar.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -196,7 +196,7 @@ Image define image details ### .spec.mode.sidecar.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -206,7 +206,7 @@ Default Value: `IfNotPresent` ### .spec.mode.sidecar.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -214,7 +214,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.mode.sidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_spec_mode_sidecar.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_spec_mode_sidecar.go#L32) ListenPort defines on which port the sidecar container will be listening for connections @@ -224,7 +224,7 @@ Default Value: `9201` ### .spec.mode.sidecar.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -236,7 +236,7 @@ Links: ### .spec.mode.sidecar.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -247,7 +247,7 @@ accessible from the network. ### .spec.mode.sidecar.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -259,7 +259,7 @@ Links: ### .spec.mode.sidecar.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -270,7 +270,7 @@ Links: ### .spec.mode.sidecar.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -281,7 +281,7 @@ Links: ### .spec.mode.sidecar.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -296,7 +296,7 @@ Links: ### .spec.mode.sidecar.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -304,7 +304,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.mode.sidecar.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -314,7 +314,7 @@ might be configured in the container image. ### .status.conditions -Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1alpha1/storage_status.go#L28) +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1alpha1/storage_status.go#L28) Conditions specific to the entire storage diff --git a/docs/api/ArangoMLStorage.V1Beta1.md b/docs/api/ArangoMLStorage.V1Beta1.md index 79b47d523..c6169d908 100644 --- a/docs/api/ArangoMLStorage.V1Beta1.md +++ b/docs/api/ArangoMLStorage.V1Beta1.md @@ -10,7 +10,7 @@ title: ArangoMLStorage V1Beta1 ### .spec.backend.s3.allowInsecure -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/storage_spec_backend_s3.go#L40) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/storage_spec_backend_s3.go#L40) AllowInsecure if set to true, the Endpoint certificates won't be checked @@ -20,7 +20,7 @@ Default Value: `false` ### .spec.backend.s3.caSecret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -28,7 +28,7 @@ UID keeps the information about object Checksum ### .spec.backend.s3.caSecret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -36,7 +36,7 @@ Name of the object ### .spec.backend.s3.caSecret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -44,7 +44,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.backend.s3.caSecret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -52,7 +52,7 @@ UID keeps the information about object UID ### .spec.backend.s3.credentialsSecret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -60,7 +60,7 @@ UID keeps the information about object Checksum ### .spec.backend.s3.credentialsSecret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -68,7 +68,7 @@ Name of the object ### .spec.backend.s3.credentialsSecret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -76,7 +76,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.backend.s3.credentialsSecret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -84,7 +84,7 @@ UID keeps the information about object UID ### .spec.backend.s3.endpoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/storage_spec_backend_s3.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/storage_spec_backend_s3.go#L34) Endpoint specifies the S3 API-compatible endpoint which implements storage Required @@ -93,7 +93,7 @@ Required ### .spec.backend.s3.region -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/storage_spec_backend_s3.go#L49) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/storage_spec_backend_s3.go#L49) Region defines the availability zone name. @@ -103,7 +103,7 @@ Default Value: `""` ### .spec.bucketName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/storage_spec.go#L30) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/storage_spec.go#L30) BucketName specifies the name of the bucket Required @@ -112,7 +112,7 @@ Required ### .spec.bucketPath -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/storage_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/storage_spec.go#L34) BucketPath specifies the path within the bucket @@ -122,7 +122,7 @@ Default Value: `/` ### .status.conditions -Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/ml/v1beta1/storage_status.go#L28) +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/storage_status.go#L28) Conditions specific to the entire storage diff --git a/docs/api/ArangoMember.V1.md b/docs/api/ArangoMember.V1.md index fdf0ca10f..2d345e64d 100644 --- a/docs/api/ArangoMember.V1.md +++ b/docs/api/ArangoMember.V1.md @@ -10,7 +10,7 @@ title: ArangoMember V1 ### .spec.deletion_priority -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_spec.go#L48) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_spec.go#L48) DeletionPriority define Deletion Priority. Higher value means higher priority. Default is 0. @@ -20,7 +20,7 @@ Example: set 1 for Coordinator which should be deleted first and scale down coor ### .spec.deploymentUID -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_spec.go#L37) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_spec.go#L37) DeploymentUID define Deployment UID. @@ -28,7 +28,7 @@ DeploymentUID define Deployment UID. ### .spec.group -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_spec.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_spec.go#L32) Group define Member Groups. @@ -36,13 +36,13 @@ Group define Member Groups. ### .spec.id -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_spec.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_spec.go#L34) *** ### .spec.overrides.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_spec_overrides.go#L38) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_spec_overrides.go#L38) Resources holds resource requests & limits. Overrides template provided on the group level. @@ -53,7 +53,7 @@ Links: ### .spec.overrides.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_spec_overrides.go#L33) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_spec_overrides.go#L33) VolumeClaimTemplate specifies a template for volume claims. Overrides template provided on the group level. @@ -64,7 +64,7 @@ Links: ### .spec.template.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_pod_template.go#L60) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_pod_template.go#L60) Checksum keep the Pod Spec Checksum (with ignored fields). @@ -72,7 +72,7 @@ Checksum keep the Pod Spec Checksum (with ignored fields). ### .spec.template.endpoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_pod_template.go#L63) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_pod_template.go#L63) > [!WARNING] > ***DEPRECATED*** @@ -83,7 +83,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.template.podSpec -Type: `core.PodTemplateSpec` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_pod_template.go#L54) +Type: `core.PodTemplateSpec` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_pod_template.go#L54) PodSpec specifies the Pod Spec used for this Member. @@ -94,7 +94,7 @@ Links: ### .spec.template.podSpecChecksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/arango_member_pod_template.go#L57) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/deployment/v1/arango_member_pod_template.go#L57) PodSpecChecksum keep the Pod Spec Checksum (without ignored fields). diff --git a/docs/api/ArangoProfile.V1Alpha1.md b/docs/api/ArangoProfile.V1Alpha1.md index 1e2b3283f..b2b3d2a4d 100644 --- a/docs/api/ArangoProfile.V1Alpha1.md +++ b/docs/api/ArangoProfile.V1Alpha1.md @@ -10,7 +10,7 @@ title: ArangoProfile V1Alpha1 ### .spec.selectors.label -Type: `meta.LabelSelector` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/profile_selectors.go#L32) +Type: `meta.LabelSelector` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/profile_selectors.go#L32) Label keeps information about label selector @@ -18,7 +18,7 @@ Label keeps information about label selector ### .spec.template.container.all.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -29,7 +29,7 @@ Links: ### .spec.template.container.all.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -40,7 +40,7 @@ Links: ### .spec.template.container.all.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -48,7 +48,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.template.container.containers.\.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L50) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -65,7 +65,7 @@ Links: ### .spec.template.container.containers.\.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L40) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -82,7 +82,7 @@ Links: ### .spec.template.container.containers.\.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -93,7 +93,7 @@ Links: ### .spec.template.container.containers.\.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -104,7 +104,7 @@ Links: ### .spec.template.container.containers.\.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35) Image define image details @@ -112,7 +112,7 @@ Image define image details ### .spec.template.container.containers.\.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -122,7 +122,7 @@ Default Value: `IfNotPresent` ### .spec.template.container.containers.\.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -130,7 +130,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.template.container.containers.\.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -142,7 +142,7 @@ Links: ### .spec.template.container.containers.\.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -153,7 +153,7 @@ accessible from the network. ### .spec.template.container.containers.\.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -165,7 +165,7 @@ Links: ### .spec.template.container.containers.\.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -176,7 +176,7 @@ Links: ### .spec.template.container.containers.\.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -187,7 +187,7 @@ Links: ### .spec.template.container.containers.\.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -202,7 +202,7 @@ Links: ### .spec.template.container.containers.\.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -210,7 +210,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.template.container.containers.\.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/container/resources/core.go#L55) Container's working directory. If not specified, the container runtime's default will be used, which @@ -220,7 +220,7 @@ might be configured in the container image. ### .spec.template.pod.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -231,7 +231,7 @@ Links: ### .spec.template.pod.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -244,7 +244,7 @@ Links: ### .spec.template.pod.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -252,7 +252,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.template.pod.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -262,7 +262,7 @@ Default Value: `false` ### .spec.template.pod.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -273,7 +273,7 @@ Default Value: `false` ### .spec.template.pod.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -283,7 +283,7 @@ Default Value: `false` ### .spec.template.pod.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -291,7 +291,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.template.pod.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -304,7 +304,7 @@ Links: ### .spec.template.pod.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -315,7 +315,7 @@ Links: ### .spec.template.pod.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -326,7 +326,7 @@ There cannot be more than one managing controller. ### .spec.template.pod.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -337,7 +337,7 @@ Links: ### .spec.template.pod.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -348,7 +348,7 @@ Default Value: `""` ### .spec.template.pod.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -359,7 +359,7 @@ Links: ### .spec.template.pod.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -372,7 +372,7 @@ Default Value: `false` ### .spec.template.pod.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -383,7 +383,7 @@ Links: ### .spec.template.pod.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -394,5 +394,5 @@ Links: ### .spec.template.priority -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1alpha1/profile_template.go#L30) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1alpha1/profile_template.go#L30) diff --git a/docs/api/ArangoProfile.V1Beta1.md b/docs/api/ArangoProfile.V1Beta1.md index df8c51628..6b9cd3812 100644 --- a/docs/api/ArangoProfile.V1Beta1.md +++ b/docs/api/ArangoProfile.V1Beta1.md @@ -10,7 +10,7 @@ title: ArangoProfile V1Beta1 ### .spec.selectors.label -Type: `meta.LabelSelector` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/profile_selectors.go#L32) +Type: `meta.LabelSelector` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/profile_selectors.go#L32) Label keeps information about label selector @@ -18,7 +18,7 @@ Label keeps information about label selector ### .spec.template.container.all.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -29,7 +29,7 @@ Links: ### .spec.template.container.all.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -40,7 +40,7 @@ Links: ### .spec.template.container.all.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -48,7 +48,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.template.container.containers.\.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -65,7 +65,7 @@ Links: ### .spec.template.container.containers.\.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -82,7 +82,7 @@ Links: ### .spec.template.container.containers.\.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -93,7 +93,7 @@ Links: ### .spec.template.container.containers.\.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -104,7 +104,7 @@ Links: ### .spec.template.container.containers.\.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -112,7 +112,7 @@ Image define image details ### .spec.template.container.containers.\.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -122,7 +122,7 @@ Default Value: `IfNotPresent` ### .spec.template.container.containers.\.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -130,7 +130,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.template.container.containers.\.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -142,7 +142,7 @@ Links: ### .spec.template.container.containers.\.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -154,7 +154,7 @@ Possible Values: ### .spec.template.container.containers.\.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -165,7 +165,7 @@ accessible from the network. ### .spec.template.container.containers.\.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -177,7 +177,7 @@ Links: ### .spec.template.container.containers.\.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -188,7 +188,7 @@ Links: ### .spec.template.container.containers.\.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -199,7 +199,7 @@ Links: ### .spec.template.container.containers.\.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -214,7 +214,7 @@ Links: ### .spec.template.container.containers.\.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -222,7 +222,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.template.container.containers.\.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -232,7 +232,7 @@ might be configured in the container image. ### .spec.template.pod.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -243,7 +243,7 @@ Links: ### .spec.template.pod.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -256,7 +256,7 @@ Links: ### .spec.template.pod.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -264,7 +264,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.template.pod.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -274,7 +274,7 @@ Default Value: `false` ### .spec.template.pod.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -285,7 +285,7 @@ Default Value: `false` ### .spec.template.pod.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -295,7 +295,7 @@ Default Value: `false` ### .spec.template.pod.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -303,7 +303,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.template.pod.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -316,7 +316,7 @@ Links: ### .spec.template.pod.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -327,7 +327,7 @@ Links: ### .spec.template.pod.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -338,7 +338,7 @@ There cannot be more than one managing controller. ### .spec.template.pod.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -349,7 +349,7 @@ Links: ### .spec.template.pod.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -360,7 +360,7 @@ Default Value: `""` ### .spec.template.pod.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -371,7 +371,7 @@ Links: ### .spec.template.pod.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -384,7 +384,7 @@ Default Value: `false` ### .spec.template.pod.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -395,7 +395,7 @@ Links: ### .spec.template.pod.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -406,5 +406,5 @@ Links: ### .spec.template.priority -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/profile_template.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/profile_template.go#L32) diff --git a/docs/api/ArangoRoute.V1Alpha1.md b/docs/api/ArangoRoute.V1Alpha1.md index fea374ee0..a2398a1e7 100644 --- a/docs/api/ArangoRoute.V1Alpha1.md +++ b/docs/api/ArangoRoute.V1Alpha1.md @@ -10,7 +10,7 @@ title: ArangoRoute V1Alpha1 ### .spec.deployment -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec.go#L27) Deployment specifies the ArangoDeployment object name @@ -18,7 +18,7 @@ Deployment specifies the ArangoDeployment object name ### .spec.destination.authentication.passMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L32) PassMode define authorization details pass mode when authorization was successful @@ -31,7 +31,7 @@ Possible Values: ### .spec.destination.authentication.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L37) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_destination_authentication.go#L37) Type of the authentication @@ -43,7 +43,7 @@ Possible Values: ### .spec.destination.endpoints.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -51,7 +51,7 @@ UID keeps the information about object Checksum ### .spec.destination.endpoints.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -59,7 +59,7 @@ Name of the object ### .spec.destination.endpoints.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -67,7 +67,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.destination.endpoints.port -Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_endpoint.go#L36) +Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_destination_endpoint.go#L36) Port defines Port or Port Name used as destination @@ -75,7 +75,7 @@ Port defines Port or Port Name used as destination ### .spec.destination.endpoints.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -83,7 +83,7 @@ UID keeps the information about object UID ### .spec.destination.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_destination.go#L39) Path defines service path used for overrides @@ -91,7 +91,7 @@ Path defines service path used for overrides ### .spec.destination.schema -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination.go#L33) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_destination.go#L33) Schema defines HTTP/S schema used for connection @@ -99,7 +99,7 @@ Schema defines HTTP/S schema used for connection ### .spec.destination.service.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -107,7 +107,7 @@ UID keeps the information about object Checksum ### .spec.destination.service.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -115,7 +115,7 @@ Name of the object ### .spec.destination.service.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -123,7 +123,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .spec.destination.service.port -Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_service.go#L35) +Type: `intstr.IntOrString` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_destination_service.go#L35) Port defines Port or Port Name used as destination @@ -131,7 +131,7 @@ Port defines Port or Port Name used as destination ### .spec.destination.service.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -139,7 +139,7 @@ UID keeps the information about object UID ### .spec.destination.tls.insecure -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go#L25) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_destination_tls.go#L25) Insecure allows Insecure traffic @@ -147,7 +147,7 @@ Insecure allows Insecure traffic ### .spec.route.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_spec_route.go#L29) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_spec_route.go#L29) Path specifies the Path route @@ -155,7 +155,7 @@ Path specifies the Path route ### .status.conditions -Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status.go#L31) +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status.go#L31) Conditions specific to the entire extension @@ -163,7 +163,7 @@ Conditions specific to the entire extension ### .status.deployment.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -171,7 +171,7 @@ UID keeps the information about object Checksum ### .status.deployment.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -179,7 +179,7 @@ Name of the object ### .status.deployment.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -187,7 +187,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.deployment.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -195,31 +195,31 @@ UID keeps the information about object UID ### .status.target.authentication.passMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_authentication.go#L27) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status_target_authentication.go#L27) *** ### .status.target.authentication.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_authentication.go#L26) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status_target_authentication.go#L26) *** ### .status.target.destinations\[int\].host -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_destination.go#L38) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status_target_destination.go#L38) *** ### .status.target.destinations\[int\].port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_destination.go#L39) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status_target_destination.go#L39) *** ### .status.target.path -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L43) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status_target.go#L43) Path specifies request path override @@ -227,7 +227,7 @@ Path specifies request path override ### .status.target.TLS.insecure -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target_tls.go#L27) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status_target_tls.go#L27) Insecure allows Insecure traffic @@ -235,7 +235,7 @@ Insecure allows Insecure traffic ### .status.target.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/networking/v1alpha1/route_status_target.go#L34) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/networking/v1alpha1/route_status_target.go#L34) Type define destination type diff --git a/docs/api/GraphAnalyticsEngine.V1Alpha1.md b/docs/api/GraphAnalyticsEngine.V1Alpha1.md index 382e51bb1..e32df4be5 100644 --- a/docs/api/GraphAnalyticsEngine.V1Alpha1.md +++ b/docs/api/GraphAnalyticsEngine.V1Alpha1.md @@ -10,7 +10,7 @@ title: GraphAnalyticsEngine V1Alpha1 ### .spec.deployment.affinity -Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) +Type: `core.Affinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L44) Affinity defines scheduling constraints for workload @@ -21,7 +21,7 @@ Links: ### .spec.deployment.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L45) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not @@ -34,7 +34,7 @@ Links: ### .spec.deployment.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -51,7 +51,7 @@ Links: ### .spec.deployment.automountServiceAccountToken -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L38) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -59,7 +59,7 @@ AutomountServiceAccountToken indicates whether a service account token should be ### .spec.deployment.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -76,7 +76,7 @@ Links: ### .spec.deployment.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -87,7 +87,7 @@ Links: ### .spec.deployment.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -98,7 +98,7 @@ Links: ### .spec.deployment.hostIPC -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L42) HostIPC defines to use the host's ipc namespace. @@ -108,7 +108,7 @@ Default Value: `false` ### .spec.deployment.hostNetwork -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L36) HostNetwork requests Host network for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. @@ -119,7 +119,7 @@ Default Value: `false` ### .spec.deployment.hostPID -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L39) HostPID define to use the host's pid namespace. @@ -129,7 +129,7 @@ Default Value: `false` ### .spec.deployment.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -137,7 +137,7 @@ Image define image details ### .spec.deployment.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -147,7 +147,7 @@ Default Value: `IfNotPresent` ### .spec.deployment.imagePullSecrets -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/image.go#L36) ImagePullSecrets define Secrets used to pull Image from registry @@ -155,7 +155,7 @@ ImagePullSecrets define Secrets used to pull Image from registry ### .spec.deployment.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L39) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers @@ -168,7 +168,7 @@ Links: ### .spec.deployment.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -176,7 +176,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.deployment.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -188,7 +188,7 @@ Links: ### .spec.deployment.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -200,7 +200,7 @@ Possible Values: ### .spec.deployment.nodeSelector -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L39) NodeSelector is a selector that must be true for the workload to fit on a node. @@ -211,7 +211,7 @@ Links: ### .spec.deployment.ownerReferences -Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) +Type: `meta.OwnerReference` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/metadata.go#L52) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, @@ -222,7 +222,7 @@ There cannot be more than one managing controller. ### .spec.deployment.podSecurityContext -Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) +Type: `core.PodSecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/security.go#L35) PodSecurityContext holds pod-level security attributes and common container settings. @@ -233,7 +233,7 @@ Links: ### .spec.deployment.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/analytics/v1alpha1/gae_spec_deployment.go#L50) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/analytics/v1alpha1/gae_spec_deployment.go#L50) Port defines on which port the container will be listening for connections @@ -241,7 +241,7 @@ Port defines on which port the container will be listening for connections ### .spec.deployment.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -252,7 +252,7 @@ accessible from the network. ### .spec.deployment.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -264,7 +264,7 @@ Links: ### .spec.deployment.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -275,7 +275,7 @@ Links: ### .spec.deployment.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L54) SchedulerName specifies, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. @@ -286,7 +286,7 @@ Default Value: `""` ### .spec.deployment.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -297,7 +297,7 @@ Links: ### .spec.deployment.service.type -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/analytics/v1alpha1/gae_spec_deployment_service.go#L38) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/analytics/v1alpha1/gae_spec_deployment_service.go#L38) Type determines how the Service is exposed @@ -315,7 +315,7 @@ Possible Values: ### .spec.deployment.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/service_account.go#L35) ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -326,7 +326,7 @@ Links: ### .spec.deployment.shareProcessNamespace -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/namespace.go#L48) ShareProcessNamespace defines to share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers @@ -339,7 +339,7 @@ Default Value: `false` ### .spec.deployment.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -354,7 +354,7 @@ Links: ### .spec.deployment.tls.altNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/tls.go#L28) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/tls.go#L28) AltNames define TLS AltNames used when TLS on the ArangoDB is enabled @@ -362,7 +362,7 @@ AltNames define TLS AltNames used when TLS on the ArangoDB is enabled ### .spec.deployment.tls.enabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/tls.go#L25) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/tls.go#L25) Enabled define if TLS Should be enabled. If is not set then default is taken from ArangoDeployment settings @@ -370,7 +370,7 @@ Enabled define if TLS Should be enabled. If is not set then default is taken fro ### .spec.deployment.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go#L49) Tolerations defines tolerations @@ -381,7 +381,7 @@ Links: ### .spec.deployment.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -389,7 +389,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.deployment.volumes -Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) +Type: `[]core.Volume` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/pod/resources/volumes.go#L36) Volumes keeps list of volumes that can be mounted by containers belonging to the pod. @@ -400,7 +400,7 @@ Links: ### .spec.deployment.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -410,7 +410,7 @@ might be configured in the container image. ### .spec.deploymentName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/analytics/v1alpha1/gae_spec.go#L31) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/analytics/v1alpha1/gae_spec.go#L31) DeploymentName define deployment name used in the object. Immutable @@ -418,7 +418,7 @@ DeploymentName define deployment name used in the object. Immutable ### .spec.integrationSidecar.args -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L54) Arguments to the entrypoint. The container image's CMD is used if this is not provided. @@ -435,7 +435,7 @@ Links: ### .spec.integrationSidecar.command -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L44) Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. @@ -452,7 +452,7 @@ Links: ### .spec.integrationSidecar.controllerListenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/integration/integration.go#L36) ControllerListenPort defines on which port the sidecar container will be listening for controller requests @@ -462,7 +462,7 @@ Default Value: `9202` ### .spec.integrationSidecar.env -Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) +Type: `core.EnvVar` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L36) Env keeps the information about environment variables provided to the container @@ -473,7 +473,7 @@ Links: ### .spec.integrationSidecar.envFrom -Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) +Type: `core.EnvFromSource` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/environments.go#L41) EnvFrom keeps the information about environment variable sources provided to the container @@ -484,7 +484,7 @@ Links: ### .spec.integrationSidecar.image -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L35) Image define image details @@ -492,7 +492,7 @@ Image define image details ### .spec.integrationSidecar.imagePullPolicy -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/image.go#L39) ImagePullPolicy define Image pull policy @@ -502,7 +502,7 @@ Default Value: `IfNotPresent` ### .spec.integrationSidecar.lifecycle -Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) +Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/lifecycle.go#L35) Lifecycle keeps actions that the management system should take in response to container lifecycle events. @@ -510,7 +510,7 @@ Lifecycle keeps actions that the management system should take in response to co ### .spec.integrationSidecar.listenPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/integration/integration.go#L32) ListenPort defines on which port the sidecar container will be listening for connections @@ -520,7 +520,7 @@ Default Value: `9201` ### .spec.integrationSidecar.livenessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L37) LivenessProbe keeps configuration of periodic probe of container liveness. Container will be restarted if the probe fails. @@ -532,7 +532,7 @@ Links: ### .spec.integrationSidecar.method -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/policy/merge.go#L32) Method defines the merge method @@ -544,7 +544,7 @@ Possible Values: ### .spec.integrationSidecar.ports -Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) +Type: `[]core.ContainerPort` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/networking.go#L39) Ports contains list of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is @@ -555,7 +555,7 @@ accessible from the network. ### .spec.integrationSidecar.readinessProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L42) ReadinessProbe keeps configuration of periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. @@ -567,7 +567,7 @@ Links: ### .spec.integrationSidecar.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/resources.go#L37) Resources holds resource requests & limits for container @@ -578,7 +578,7 @@ Links: ### .spec.integrationSidecar.securityContext -Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) +Type: `core.SecurityContext` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/security.go#L35) SecurityContext holds container-level security attributes and common container settings. @@ -589,7 +589,7 @@ Links: ### .spec.integrationSidecar.startupProbe -Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) +Type: `core.Probe` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/probes.go#L50) StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. @@ -604,7 +604,7 @@ Links: ### .spec.integrationSidecar.volumeMounts -Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) +Type: `[]core.VolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/volume_mounts.go#L35) VolumeMounts keeps list of pod volumes to mount into the container's filesystem. @@ -612,7 +612,7 @@ VolumeMounts keeps list of pod volumes to mount into the container's filesystem. ### .spec.integrationSidecar.workingDir -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/scheduler/v1beta1/container/resources/core.go#L59) Container's working directory. If not specified, the container runtime's default will be used, which @@ -622,7 +622,7 @@ might be configured in the container image. ### .status.arangoDB.deployment.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -630,7 +630,7 @@ UID keeps the information about object Checksum ### .status.arangoDB.deployment.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -638,7 +638,7 @@ Name of the object ### .status.arangoDB.deployment.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -646,7 +646,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.arangoDB.deployment.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -654,7 +654,7 @@ UID keeps the information about object UID ### .status.arangoDB.secret.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -662,7 +662,7 @@ UID keeps the information about object Checksum ### .status.arangoDB.secret.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -670,7 +670,7 @@ Name of the object ### .status.arangoDB.secret.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -678,7 +678,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.arangoDB.secret.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -686,7 +686,7 @@ UID keeps the information about object UID ### .status.arangoDB.tls.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -694,7 +694,7 @@ UID keeps the information about object Checksum ### .status.arangoDB.tls.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -702,7 +702,7 @@ Name of the object ### .status.arangoDB.tls.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -710,7 +710,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.arangoDB.tls.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -718,7 +718,7 @@ UID keeps the information about object UID ### .status.conditions -Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/analytics/v1alpha1/gae_status.go#L30) +Type: `api.Conditions` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/analytics/v1alpha1/gae_status.go#L30) Conditions specific to the entire extension @@ -726,7 +726,7 @@ Conditions specific to the entire extension ### .status.reconciliation.service.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -734,7 +734,7 @@ UID keeps the information about object Checksum ### .status.reconciliation.service.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -742,7 +742,7 @@ Name of the object ### .status.reconciliation.service.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -750,7 +750,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.reconciliation.service.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID @@ -758,7 +758,7 @@ UID keeps the information about object UID ### .status.reconciliation.statefulSet.checksum -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L61) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L61) UID keeps the information about object Checksum @@ -766,7 +766,7 @@ UID keeps the information about object Checksum ### .status.reconciliation.statefulSet.name -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L52) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L52) Name of the object @@ -774,7 +774,7 @@ Name of the object ### .status.reconciliation.statefulSet.namespace -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L55) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L55) Namespace of the object. Should default to the namespace of the parent object @@ -782,7 +782,7 @@ Namespace of the object. Should default to the namespace of the parent object ### .status.reconciliation.statefulSet.uid -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/shared/v1/object.go#L58) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/shared/v1/object.go#L58) UID keeps the information about object UID diff --git a/examples/reboot-pod.yaml b/examples/reboot-pod.yaml index 34fd6ec09..ad0790a7d 100644 --- a/examples/reboot-pod.yaml +++ b/examples/reboot-pod.yaml @@ -6,7 +6,7 @@ spec: restartPolicy: Never serviceAccountName: arango-deployment-operator-reboot containers: - - image: arangodb/kube-arangodb:1.2.42 + - image: arangodb/kube-arangodb:1.2.43 name: reboot command: ["arangodb_operator", "reboot"] args: diff --git a/manifests/arango-all.yaml b/manifests/arango-all.yaml index 769a1e603..0225b65c8 100644 --- a/manifests/arango-all.yaml +++ b/manifests/arango-all.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -31,7 +31,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -54,6 +54,22 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/apps-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -61,7 +77,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -77,7 +93,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -93,24 +109,70 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all rules: + # analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" + # apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" + # backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" + # ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -119,7 +181,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -138,7 +200,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -157,7 +219,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -173,7 +235,39 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -189,7 +283,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -210,6 +304,26 @@ rules: resources: ["arangolocalstorages"] verbs: ["*"] --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -217,7 +331,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -237,7 +351,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -257,7 +371,7 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -277,7 +391,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -297,7 +411,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -317,7 +431,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -337,7 +451,7 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -350,6 +464,46 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -357,7 +511,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -370,6 +524,44 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/analytics-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "analytics.arangodb.com" + resources: + - "graphanalyticsengines" + - "graphanalyticsengines/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "secrets" + - "services" + verbs: ["*"] +--- # Source: kube-arangodb/templates/apps-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -378,7 +570,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -412,7 +604,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -429,7 +621,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -461,7 +653,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -478,7 +670,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -486,6 +678,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -519,7 +714,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -545,7 +740,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -574,7 +769,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -631,6 +826,131 @@ rules: - "serviceaccounts" verbs: ["*"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/storage-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -639,7 +959,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -657,6 +977,27 @@ rules: resources: ["deployments", "replicasets"] verbs: ["get"] --- +# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -665,7 +1006,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -685,7 +1026,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -706,7 +1047,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -727,7 +1068,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -748,7 +1089,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -769,7 +1110,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -790,7 +1131,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -811,7 +1152,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -824,6 +1165,48 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -832,7 +1215,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -853,7 +1236,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -888,7 +1271,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -906,7 +1289,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -945,7 +1328,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.deployment @@ -955,6 +1338,9 @@ spec: - --mode.single - --operator.apps - --operator.ml + - --operator.analytics + - --operator.networking + - --operator.scheduler - --operator.k2k-cluster-sync - --chaos.allowed=false env: @@ -1007,19 +1393,3 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 - -# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role.yaml ---- - diff --git a/manifests/arango-apps.yaml b/manifests/arango-apps.yaml index ccf222e79..003fd70ce 100644 --- a/manifests/arango-apps.yaml +++ b/manifests/arango-apps.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -31,7 +31,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -47,24 +47,17 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps rules: + # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -73,7 +66,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -93,7 +86,7 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -114,7 +107,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -148,7 +141,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -165,7 +158,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -185,7 +178,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -206,7 +199,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -241,7 +234,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -259,7 +252,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -298,7 +291,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --mode.single @@ -459,6 +452,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/arango-backup.yaml b/manifests/arango-backup.yaml index b37d8364f..e2c4c0b7a 100644 --- a/manifests/arango-backup.yaml +++ b/manifests/arango-backup.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -18,7 +18,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -34,24 +34,18 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup rules: + # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangobackups.backup.arangodb.com" --- # Source: kube-arangodb/templates/backup-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -60,7 +54,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -80,7 +74,7 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -101,7 +95,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -133,7 +127,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -154,7 +148,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -189,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -207,7 +201,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -246,7 +240,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.backup @@ -409,6 +403,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/arango-crd.yaml b/manifests/arango-crd.yaml index 4d0cb2117..ca3d5948b 100644 --- a/manifests/arango-crd.yaml +++ b/manifests/arango-crd.yaml @@ -534,6 +534,102 @@ spec: subresources: status: {} --- +# File: chart/kube-arangodb/crds/scheduler-pod.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-deployment.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-batchjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-cronjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- # File: chart/kube-arangodb/crds/analytics-graphanalyticsengine.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -557,3 +653,27 @@ spec: storage: true subresources: status: {} +--- +# File: chart/kube-arangodb/crds/networking-route.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/manifests/arango-deployment-replication.yaml b/manifests/arango-deployment-replication.yaml index 3888ef363..ce18ff7bc 100644 --- a/manifests/arango-deployment-replication.yaml +++ b/manifests/arango-deployment-replication.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -18,24 +18,17 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication rules: + # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/deployment-replications-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +37,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -63,7 +56,7 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -83,7 +76,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -104,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -130,7 +123,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -151,7 +144,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -186,7 +179,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -204,7 +197,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -243,7 +236,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.deployment-replication @@ -406,6 +399,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/arango-deployment.yaml b/manifests/arango-deployment.yaml index a7c9851c4..3ec56aea0 100644 --- a/manifests/arango-deployment.yaml +++ b/manifests/arango-deployment.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -18,24 +18,36 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment rules: + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +56,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -56,6 +68,38 @@ rules: resources: ["namespaces", "nodes", "persistentvolumes"] verbs: ["get", "list"] --- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/crd/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -63,7 +107,7 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -83,7 +127,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -96,6 +140,46 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/deployment-operator/default-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -104,7 +188,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -121,7 +205,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -129,6 +213,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -154,6 +241,131 @@ rules: resources: ["servicemonitors"] verbs: ["get", "create", "delete", "update", "list", "watch", "patch"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/deployment-operator/default-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -162,7 +374,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -183,7 +395,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -196,6 +408,48 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/service.yaml apiVersion: v1 kind: Service @@ -204,7 +458,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -239,7 +493,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -257,7 +511,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -296,11 +550,13 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.deployment - --mode.single + - --operator.networking + - --operator.scheduler - --chaos.allowed=false env: - name: MY_POD_NAMESPACE diff --git a/manifests/arango-k2kclustersync.yaml b/manifests/arango-k2kclustersync.yaml index 7eee9aec9..110d0d168 100644 --- a/manifests/arango-k2kclustersync.yaml +++ b/manifests/arango-k2kclustersync.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -18,24 +18,11 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/k2k-cluster-sync-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +31,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -60,7 +47,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -80,7 +67,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -101,7 +88,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -130,7 +117,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -151,7 +138,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -186,7 +173,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -204,7 +191,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -243,7 +230,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --mode.single @@ -406,6 +393,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/arango-ml.yaml b/manifests/arango-ml.yaml index 5d078973a..337bbbe06 100644 --- a/manifests/arango-ml.yaml +++ b/manifests/arango-ml.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -18,24 +18,20 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml rules: + # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" --- # Source: kube-arangodb/templates/ml-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +40,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -60,7 +56,7 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -80,7 +76,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -101,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -166,7 +162,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -187,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -222,7 +218,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -240,7 +236,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -279,7 +275,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --mode.single @@ -442,6 +438,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/arango-storage.yaml b/manifests/arango-storage.yaml index 7831badb9..50872274b 100644 --- a/manifests/arango-storage.yaml +++ b/manifests/arango-storage.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -18,7 +18,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -48,24 +48,11 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/storage-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -74,7 +61,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -102,7 +89,7 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -122,7 +109,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -143,7 +130,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -169,7 +156,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -190,7 +177,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -225,7 +212,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -243,7 +230,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -282,7 +269,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.storage @@ -460,3 +447,35 @@ spec: # Source: kube-arangodb/templates/ml-operator/role.yaml --- + +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + diff --git a/manifests/enterprise-all.yaml b/manifests/enterprise-all.yaml index 07ac730d0..84798b2e0 100644 --- a/manifests/enterprise-all.yaml +++ b/manifests/enterprise-all.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -31,7 +31,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -54,6 +54,22 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/apps-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -61,7 +77,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -77,7 +93,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -93,24 +109,70 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all rules: + # analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" + # apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" + # backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" + # ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -119,7 +181,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -138,7 +200,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -157,7 +219,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -173,7 +235,39 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -189,7 +283,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -210,6 +304,26 @@ rules: resources: ["arangolocalstorages"] verbs: ["*"] --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -217,7 +331,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -237,7 +351,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -257,7 +371,7 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -277,7 +391,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -297,7 +411,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -317,7 +431,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -337,7 +451,7 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -350,6 +464,46 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -357,7 +511,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -370,6 +524,44 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/analytics-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "analytics.arangodb.com" + resources: + - "graphanalyticsengines" + - "graphanalyticsengines/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "secrets" + - "services" + verbs: ["*"] +--- # Source: kube-arangodb/templates/apps-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -378,7 +570,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -412,7 +604,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -429,7 +621,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -461,7 +653,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -478,7 +670,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -486,6 +678,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -519,7 +714,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -545,7 +740,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -574,7 +769,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -631,6 +826,131 @@ rules: - "serviceaccounts" verbs: ["*"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/storage-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -639,7 +959,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -657,6 +977,27 @@ rules: resources: ["deployments", "replicasets"] verbs: ["get"] --- +# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -665,7 +1006,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -685,7 +1026,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -706,7 +1047,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -727,7 +1068,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -748,7 +1089,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -769,7 +1110,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -790,7 +1131,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -811,7 +1152,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -824,6 +1165,48 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -832,7 +1215,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -853,7 +1236,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -888,7 +1271,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -906,7 +1289,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -945,7 +1328,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.deployment @@ -955,6 +1338,9 @@ spec: - --mode.single - --operator.apps - --operator.ml + - --operator.analytics + - --operator.networking + - --operator.scheduler - --operator.k2k-cluster-sync - --chaos.allowed=false env: @@ -1007,19 +1393,3 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 - -# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role.yaml ---- - diff --git a/manifests/enterprise-apps.yaml b/manifests/enterprise-apps.yaml index 1cfd67de1..94c48a592 100644 --- a/manifests/enterprise-apps.yaml +++ b/manifests/enterprise-apps.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -31,7 +31,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -47,24 +47,17 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps rules: + # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -73,7 +66,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -93,7 +86,7 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -114,7 +107,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -148,7 +141,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -165,7 +158,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -185,7 +178,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -206,7 +199,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -241,7 +234,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -259,7 +252,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -298,7 +291,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --mode.single @@ -459,6 +452,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/enterprise-backup.yaml b/manifests/enterprise-backup.yaml index 31aa64ea7..9f4390f94 100644 --- a/manifests/enterprise-backup.yaml +++ b/manifests/enterprise-backup.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -18,7 +18,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -34,24 +34,18 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup rules: + # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangobackups.backup.arangodb.com" --- # Source: kube-arangodb/templates/backup-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -60,7 +54,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -80,7 +74,7 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -101,7 +95,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -133,7 +127,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -154,7 +148,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -189,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -207,7 +201,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -246,7 +240,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.backup @@ -409,6 +403,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/enterprise-crd.yaml b/manifests/enterprise-crd.yaml index 4d0cb2117..ca3d5948b 100644 --- a/manifests/enterprise-crd.yaml +++ b/manifests/enterprise-crd.yaml @@ -534,6 +534,102 @@ spec: subresources: status: {} --- +# File: chart/kube-arangodb/crds/scheduler-pod.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-deployment.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-batchjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-cronjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- # File: chart/kube-arangodb/crds/analytics-graphanalyticsengine.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -557,3 +653,27 @@ spec: storage: true subresources: status: {} +--- +# File: chart/kube-arangodb/crds/networking-route.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/manifests/enterprise-deployment-replication.yaml b/manifests/enterprise-deployment-replication.yaml index 11f1594a1..a372358a6 100644 --- a/manifests/enterprise-deployment-replication.yaml +++ b/manifests/enterprise-deployment-replication.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -18,24 +18,17 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication rules: + # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/deployment-replications-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +37,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -63,7 +56,7 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -83,7 +76,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -104,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -130,7 +123,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -151,7 +144,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -186,7 +179,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -204,7 +197,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -243,7 +236,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.deployment-replication @@ -406,6 +399,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/enterprise-deployment.yaml b/manifests/enterprise-deployment.yaml index 8462a9014..5ae14a524 100644 --- a/manifests/enterprise-deployment.yaml +++ b/manifests/enterprise-deployment.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -18,24 +18,36 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment rules: + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +56,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -56,6 +68,38 @@ rules: resources: ["namespaces", "nodes", "persistentvolumes"] verbs: ["get", "list"] --- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/crd/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -63,7 +107,7 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -83,7 +127,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -96,6 +140,46 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/deployment-operator/default-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -104,7 +188,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -121,7 +205,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -129,6 +213,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -154,6 +241,131 @@ rules: resources: ["servicemonitors"] verbs: ["get", "create", "delete", "update", "list", "watch", "patch"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/deployment-operator/default-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -162,7 +374,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -183,7 +395,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -196,6 +408,48 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/service.yaml apiVersion: v1 kind: Service @@ -204,7 +458,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -239,7 +493,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -257,7 +511,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -296,11 +550,13 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.deployment - --mode.single + - --operator.networking + - --operator.scheduler - --chaos.allowed=false env: - name: MY_POD_NAMESPACE diff --git a/manifests/enterprise-k2kclustersync.yaml b/manifests/enterprise-k2kclustersync.yaml index 4ef6e2760..453f817b0 100644 --- a/manifests/enterprise-k2kclustersync.yaml +++ b/manifests/enterprise-k2kclustersync.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -18,24 +18,11 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/k2k-cluster-sync-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +31,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -60,7 +47,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -80,7 +67,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -101,7 +88,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -130,7 +117,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -151,7 +138,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -186,7 +173,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -204,7 +191,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -243,7 +230,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --mode.single @@ -406,6 +393,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/enterprise-ml.yaml b/manifests/enterprise-ml.yaml index bed2ace0f..428c052e5 100644 --- a/manifests/enterprise-ml.yaml +++ b/manifests/enterprise-ml.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -18,24 +18,20 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml rules: + # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" --- # Source: kube-arangodb/templates/ml-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +40,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -60,7 +56,7 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -80,7 +76,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -101,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -166,7 +162,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -187,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -222,7 +218,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -240,7 +236,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -279,7 +275,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --mode.single @@ -442,6 +438,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/enterprise-storage.yaml b/manifests/enterprise-storage.yaml index 39a0d2419..0f7e51199 100644 --- a/manifests/enterprise-storage.yaml +++ b/manifests/enterprise-storage.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -18,7 +18,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -48,24 +48,11 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/storage-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -74,7 +61,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -102,7 +89,7 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -122,7 +109,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -143,7 +130,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -169,7 +156,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -190,7 +177,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -225,7 +212,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -243,7 +230,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -282,7 +269,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.storage @@ -460,3 +447,35 @@ spec: # Source: kube-arangodb/templates/ml-operator/role.yaml --- + +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + diff --git a/manifests/kustomize-enterprise/all/enterprise-all.yaml b/manifests/kustomize-enterprise/all/enterprise-all.yaml index 07ac730d0..84798b2e0 100644 --- a/manifests/kustomize-enterprise/all/enterprise-all.yaml +++ b/manifests/kustomize-enterprise/all/enterprise-all.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -31,7 +31,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -54,6 +54,22 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/apps-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -61,7 +77,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -77,7 +93,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -93,24 +109,70 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all rules: + # analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" + # apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" + # backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" + # ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -119,7 +181,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -138,7 +200,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -157,7 +219,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -173,7 +235,39 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -189,7 +283,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -210,6 +304,26 @@ rules: resources: ["arangolocalstorages"] verbs: ["*"] --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -217,7 +331,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -237,7 +351,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -257,7 +371,7 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -277,7 +391,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -297,7 +411,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -317,7 +431,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -337,7 +451,7 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -350,6 +464,46 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -357,7 +511,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -370,6 +524,44 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/analytics-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "analytics.arangodb.com" + resources: + - "graphanalyticsengines" + - "graphanalyticsengines/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "secrets" + - "services" + verbs: ["*"] +--- # Source: kube-arangodb/templates/apps-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -378,7 +570,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -412,7 +604,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -429,7 +621,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -461,7 +653,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -478,7 +670,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -486,6 +678,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -519,7 +714,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -545,7 +740,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -574,7 +769,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -631,6 +826,131 @@ rules: - "serviceaccounts" verbs: ["*"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/storage-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -639,7 +959,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -657,6 +977,27 @@ rules: resources: ["deployments", "replicasets"] verbs: ["get"] --- +# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -665,7 +1006,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -685,7 +1026,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -706,7 +1047,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -727,7 +1068,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -748,7 +1089,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -769,7 +1110,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -790,7 +1131,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -811,7 +1152,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -824,6 +1165,48 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -832,7 +1215,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -853,7 +1236,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -888,7 +1271,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -906,7 +1289,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -945,7 +1328,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.deployment @@ -955,6 +1338,9 @@ spec: - --mode.single - --operator.apps - --operator.ml + - --operator.analytics + - --operator.networking + - --operator.scheduler - --operator.k2k-cluster-sync - --chaos.allowed=false env: @@ -1007,19 +1393,3 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 - -# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role.yaml ---- - diff --git a/manifests/kustomize-enterprise/apps/enterprise-apps.yaml b/manifests/kustomize-enterprise/apps/enterprise-apps.yaml index 1cfd67de1..94c48a592 100644 --- a/manifests/kustomize-enterprise/apps/enterprise-apps.yaml +++ b/manifests/kustomize-enterprise/apps/enterprise-apps.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -31,7 +31,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -47,24 +47,17 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps rules: + # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -73,7 +66,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -93,7 +86,7 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -114,7 +107,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -148,7 +141,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -165,7 +158,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -185,7 +178,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -206,7 +199,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -241,7 +234,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -259,7 +252,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -298,7 +291,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --mode.single @@ -459,6 +452,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize-enterprise/backup/enterprise-backup.yaml b/manifests/kustomize-enterprise/backup/enterprise-backup.yaml index 31aa64ea7..9f4390f94 100644 --- a/manifests/kustomize-enterprise/backup/enterprise-backup.yaml +++ b/manifests/kustomize-enterprise/backup/enterprise-backup.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -18,7 +18,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -34,24 +34,18 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup rules: + # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangobackups.backup.arangodb.com" --- # Source: kube-arangodb/templates/backup-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -60,7 +54,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -80,7 +74,7 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -101,7 +95,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -133,7 +127,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -154,7 +148,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -189,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -207,7 +201,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -246,7 +240,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.backup @@ -409,6 +403,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize-enterprise/crd/enterprise-crd.yaml b/manifests/kustomize-enterprise/crd/enterprise-crd.yaml index 4d0cb2117..ca3d5948b 100644 --- a/manifests/kustomize-enterprise/crd/enterprise-crd.yaml +++ b/manifests/kustomize-enterprise/crd/enterprise-crd.yaml @@ -534,6 +534,102 @@ spec: subresources: status: {} --- +# File: chart/kube-arangodb/crds/scheduler-pod.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-deployment.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-batchjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-cronjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- # File: chart/kube-arangodb/crds/analytics-graphanalyticsengine.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -557,3 +653,27 @@ spec: storage: true subresources: status: {} +--- +# File: chart/kube-arangodb/crds/networking-route.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/manifests/kustomize-enterprise/deployment-replication/enterprise-deployment-replication.yaml b/manifests/kustomize-enterprise/deployment-replication/enterprise-deployment-replication.yaml index 11f1594a1..a372358a6 100644 --- a/manifests/kustomize-enterprise/deployment-replication/enterprise-deployment-replication.yaml +++ b/manifests/kustomize-enterprise/deployment-replication/enterprise-deployment-replication.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -18,24 +18,17 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication rules: + # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/deployment-replications-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +37,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -63,7 +56,7 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -83,7 +76,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -104,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -130,7 +123,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -151,7 +144,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -186,7 +179,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -204,7 +197,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -243,7 +236,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.deployment-replication @@ -406,6 +399,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize-enterprise/deployment/enterprise-deployment.yaml b/manifests/kustomize-enterprise/deployment/enterprise-deployment.yaml index 8462a9014..5ae14a524 100644 --- a/manifests/kustomize-enterprise/deployment/enterprise-deployment.yaml +++ b/manifests/kustomize-enterprise/deployment/enterprise-deployment.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -18,24 +18,36 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment rules: + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +56,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -56,6 +68,38 @@ rules: resources: ["namespaces", "nodes", "persistentvolumes"] verbs: ["get", "list"] --- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/crd/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -63,7 +107,7 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -83,7 +127,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -96,6 +140,46 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/deployment-operator/default-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -104,7 +188,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -121,7 +205,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -129,6 +213,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -154,6 +241,131 @@ rules: resources: ["servicemonitors"] verbs: ["get", "create", "delete", "update", "list", "watch", "patch"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/deployment-operator/default-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -162,7 +374,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -183,7 +395,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -196,6 +408,48 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/service.yaml apiVersion: v1 kind: Service @@ -204,7 +458,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -239,7 +493,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -257,7 +511,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -296,11 +550,13 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.deployment - --mode.single + - --operator.networking + - --operator.scheduler - --chaos.allowed=false env: - name: MY_POD_NAMESPACE diff --git a/manifests/kustomize-enterprise/k2kclustersync/enterprise-k2kclustersync.yaml b/manifests/kustomize-enterprise/k2kclustersync/enterprise-k2kclustersync.yaml index 4ef6e2760..453f817b0 100644 --- a/manifests/kustomize-enterprise/k2kclustersync/enterprise-k2kclustersync.yaml +++ b/manifests/kustomize-enterprise/k2kclustersync/enterprise-k2kclustersync.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -18,24 +18,11 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/k2k-cluster-sync-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +31,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -60,7 +47,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -80,7 +67,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -101,7 +88,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -130,7 +117,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -151,7 +138,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -186,7 +173,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -204,7 +191,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -243,7 +230,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --mode.single @@ -406,6 +393,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize-enterprise/storage/enterprise-storage.yaml b/manifests/kustomize-enterprise/storage/enterprise-storage.yaml index 39a0d2419..0f7e51199 100644 --- a/manifests/kustomize-enterprise/storage/enterprise-storage.yaml +++ b/manifests/kustomize-enterprise/storage/enterprise-storage.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -18,7 +18,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -48,24 +48,11 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/storage-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -74,7 +61,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -102,7 +89,7 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -122,7 +109,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -143,7 +130,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -169,7 +156,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -190,7 +177,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -225,7 +212,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -243,7 +230,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -282,7 +269,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --operator.storage @@ -460,3 +447,35 @@ spec: # Source: kube-arangodb/templates/ml-operator/role.yaml --- + +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + diff --git a/manifests/kustomize/all/arango-all.yaml b/manifests/kustomize/all/arango-all.yaml index 769a1e603..0225b65c8 100644 --- a/manifests/kustomize/all/arango-all.yaml +++ b/manifests/kustomize/all/arango-all.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -31,7 +31,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -54,6 +54,22 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/apps-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -61,7 +77,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -77,7 +93,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -93,24 +109,70 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all rules: + # analytics.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "graphanalyticsengines.analytics.arangodb.com" + # apps.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangojobs.apps.arangodb.com" + # backup.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangobackuppolicies.backup.arangodb.com" + - "arangobackups.backup.arangodb.com" + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" + # ml.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # replication.database.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -119,7 +181,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -138,7 +200,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -157,7 +219,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -173,7 +235,39 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -189,7 +283,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -210,6 +304,26 @@ rules: resources: ["arangolocalstorages"] verbs: ["*"] --- +# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-analytics + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -217,7 +331,7 @@ metadata: name: arango-all-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -237,7 +351,7 @@ metadata: name: arango-all-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -257,7 +371,7 @@ metadata: name: arango-all-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -277,7 +391,7 @@ metadata: name: arango-all-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -297,7 +411,7 @@ metadata: name: arango-all-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -317,7 +431,7 @@ metadata: name: arango-all-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -337,7 +451,7 @@ metadata: name: arango-all-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -350,6 +464,46 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -357,7 +511,7 @@ metadata: name: arango-all-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -370,6 +524,44 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/analytics-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "analytics.arangodb.com" + resources: + - "graphanalyticsengines" + - "graphanalyticsengines/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "secrets" + - "services" + verbs: ["*"] +--- # Source: kube-arangodb/templates/apps-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -378,7 +570,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -412,7 +604,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -429,7 +621,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -461,7 +653,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -478,7 +670,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -486,6 +678,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -519,7 +714,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -545,7 +740,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -574,7 +769,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -631,6 +826,131 @@ rules: - "serviceaccounts" verbs: ["*"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/storage-operator/role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -639,7 +959,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -657,6 +977,27 @@ rules: resources: ["deployments", "replicasets"] verbs: ["get"] --- +# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-analytics + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-analytics +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/apps-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -665,7 +1006,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -685,7 +1026,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -706,7 +1047,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -727,7 +1068,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -748,7 +1089,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -769,7 +1110,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -790,7 +1131,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -811,7 +1152,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -824,6 +1165,48 @@ subjects: name: arango-all-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-all-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: all + release: all +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-all-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-all-operator + namespace: default +--- # Source: kube-arangodb/templates/storage-operator/role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -832,7 +1215,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -853,7 +1236,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -888,7 +1271,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -906,7 +1289,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: all release: all @@ -945,7 +1328,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.deployment @@ -955,6 +1338,9 @@ spec: - --mode.single - --operator.apps - --operator.ml + - --operator.analytics + - --operator.networking + - --operator.scheduler - --operator.k2k-cluster-sync - --chaos.allowed=false env: @@ -1007,19 +1393,3 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 - -# Source: kube-arangodb/templates/analytics-operator/cluster-role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/cluster-role.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role-binding.yaml ---- - - -# Source: kube-arangodb/templates/analytics-operator/role.yaml ---- - diff --git a/manifests/kustomize/apps/arango-apps.yaml b/manifests/kustomize/apps/arango-apps.yaml index ccf222e79..003fd70ce 100644 --- a/manifests/kustomize/apps/arango-apps.yaml +++ b/manifests/kustomize/apps/arango-apps.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -19,7 +19,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -31,7 +31,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -47,24 +47,17 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps rules: + # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/apps-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -73,7 +66,7 @@ metadata: name: arango-apps-operator-rbac-apps labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -93,7 +86,7 @@ metadata: name: arango-apps-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -114,7 +107,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -148,7 +141,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -165,7 +158,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -185,7 +178,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -206,7 +199,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -241,7 +234,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -259,7 +252,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: apps release: apps @@ -298,7 +291,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --mode.single @@ -459,6 +452,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize/apps/arango-ml.yaml b/manifests/kustomize/apps/arango-ml.yaml index 5d078973a..337bbbe06 100644 --- a/manifests/kustomize/apps/arango-ml.yaml +++ b/manifests/kustomize/apps/arango-ml.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -18,24 +18,20 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml rules: + # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" --- # Source: kube-arangodb/templates/ml-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +40,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -60,7 +56,7 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -80,7 +76,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -101,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -166,7 +162,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -187,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -222,7 +218,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -240,7 +236,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -279,7 +275,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --mode.single @@ -442,6 +438,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize/apps/enterprise-ml.yaml b/manifests/kustomize/apps/enterprise-ml.yaml index bed2ace0f..428c052e5 100644 --- a/manifests/kustomize/apps/enterprise-ml.yaml +++ b/manifests/kustomize/apps/enterprise-ml.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -18,24 +18,20 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml rules: + # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangomlbatchjobs.ml.arangodb.com" + - "arangomlcronjobs.ml.arangodb.com" + - "arangomlextensions.ml.arangodb.com" + - "arangomlstorages.ml.arangodb.com" --- # Source: kube-arangodb/templates/ml-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +40,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -60,7 +56,7 @@ metadata: name: arango-ml-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -80,7 +76,7 @@ metadata: name: arango-ml-operator-rbac-ml labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -101,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -166,7 +162,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -187,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -222,7 +218,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -240,7 +236,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: ml release: ml @@ -279,7 +275,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb-enterprise:1.2.42 + image: arangodb/kube-arangodb-enterprise:1.2.43 args: - --scope=legacy - --mode.single @@ -442,6 +438,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize/backup/arango-backup.yaml b/manifests/kustomize/backup/arango-backup.yaml index b37d8364f..e2c4c0b7a 100644 --- a/manifests/kustomize/backup/arango-backup.yaml +++ b/manifests/kustomize/backup/arango-backup.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -18,7 +18,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -34,24 +34,18 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup rules: + # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + - "arangobackups.backup.arangodb.com" --- # Source: kube-arangodb/templates/backup-operator/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -60,7 +54,7 @@ metadata: name: arango-backup-operator-rbac-backup labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -80,7 +74,7 @@ metadata: name: arango-backup-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -101,7 +95,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -133,7 +127,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -154,7 +148,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -189,7 +183,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -207,7 +201,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: backup release: backup @@ -246,7 +240,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.backup @@ -409,6 +403,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize/crd/arango-crd.yaml b/manifests/kustomize/crd/arango-crd.yaml index 4d0cb2117..ca3d5948b 100644 --- a/manifests/kustomize/crd/arango-crd.yaml +++ b/manifests/kustomize/crd/arango-crd.yaml @@ -534,6 +534,102 @@ spec: subresources: status: {} --- +# File: chart/kube-arangodb/crds/scheduler-pod.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerpods.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerPod + listKind: ArangoSchedulerPodList + plural: arangoschedulerpods + singular: arangoschedulerpod + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-deployment.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerdeployments.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerDeployment + listKind: ArangoSchedulerDeploymentList + plural: arangoschedulerdeployments + singular: arangoschedulerdeployment + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-batchjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulerbatchjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerBatchJob + listKind: ArangoSchedulerBatchJobList + plural: arangoschedulerbatchjobs + singular: arangoschedulerbatchjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- +# File: chart/kube-arangodb/crds/scheduler-cronjob.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoschedulercronjobs.scheduler.arangodb.com +spec: + group: scheduler.arangodb.com + names: + kind: ArangoSchedulerCronJob + listKind: ArangoSchedulerCronJobList + plural: arangoschedulercronjobs + singular: arangoschedulercronjob + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +--- # File: chart/kube-arangodb/crds/analytics-graphanalyticsengine.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -557,3 +653,27 @@ spec: storage: true subresources: status: {} +--- +# File: chart/kube-arangodb/crds/networking-route.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: arangoroutes.networking.arangodb.com +spec: + group: networking.arangodb.com + names: + kind: ArangoRoute + listKind: ArangoRouteList + plural: arangoroutes + singular: arangoroute + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} diff --git a/manifests/kustomize/deployment-replication/arango-deployment-replication.yaml b/manifests/kustomize/deployment-replication/arango-deployment-replication.yaml index 3888ef363..ce18ff7bc 100644 --- a/manifests/kustomize/deployment-replication/arango-deployment-replication.yaml +++ b/manifests/kustomize/deployment-replication/arango-deployment-replication.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -18,24 +18,17 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication rules: + # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/deployment-replications-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +37,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -63,7 +56,7 @@ metadata: name: arango-deployment-replication-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -83,7 +76,7 @@ metadata: name: arango-deployment-replication-operator-rbac-deployment-replication labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -104,7 +97,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -130,7 +123,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -151,7 +144,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -186,7 +179,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -204,7 +197,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment-replication release: deployment-replication @@ -243,7 +236,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.deployment-replication @@ -406,6 +399,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize/deployment/arango-deployment.yaml b/manifests/kustomize/deployment/arango-deployment.yaml index a7c9851c4..3ec56aea0 100644 --- a/manifests/kustomize/deployment/arango-deployment.yaml +++ b/manifests/kustomize/deployment/arango-deployment.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -18,24 +18,36 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment rules: + # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" + # networking.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoroutes.networking.arangodb.com" + # scheduler.arangodb.com + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch", "update", "delete"] + resourceNames: + - "arangoprofiles.scheduler.arangodb.com" + - "arangoschedulerpods.scheduler.arangodb.com" + - "arangoschedulerdeploymets.scheduler.arangodb.com" + - "arangoschedulerbatchjobs.scheduler.arangodb.com" + - "arangoschedulercronjobs.scheduler.arangodb.com" --- # Source: kube-arangodb/templates/deployment-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +56,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -56,6 +68,38 @@ rules: resources: ["namespaces", "nodes", "persistentvolumes"] verbs: ["get", "list"] --- +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get", "list", "watch"] +--- # Source: kube-arangodb/templates/crd/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -63,7 +107,7 @@ metadata: name: arango-deployment-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -83,7 +127,7 @@ metadata: name: arango-deployment-operator-rbac-deployment labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -96,6 +140,46 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/deployment-operator/default-role.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -104,7 +188,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -121,7 +205,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -129,6 +213,9 @@ rules: - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments", "arangodeployments/status", "arangomembers", "arangomembers/status"] verbs: ["*"] + - apiGroups: ["networking.arangodb.com"] + resources: ["arangoroutes", "arangoroutes/status"] + verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangoclustersynchronizations", "arangoclustersynchronizations/status"] verbs: ["*"] @@ -154,6 +241,131 @@ rules: resources: ["servicemonitors"] verbs: ["get", "create", "delete", "update", "list", "watch", "patch"] --- +# Source: kube-arangodb/templates/networking-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "ml.arangodb.com" + resources: + - "arangomlextensions" + - "arangomlextensions/status" + - "arangomlbatchjobs" + - "arangomlbatchjobs/status" + - "arangomlcronjobs" + - "arangomlcronjobs/status" + - "arangomlstorages" + - "arangomlstorages/status" + verbs: + - "*" + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" + - apiGroups: + - "rbac.authorization.k8s.io" + resources: + - "roles" + - "rolebindings" + verbs: ["*"] + - apiGroups: + - "batch" + resources: + - "cronjobs" + - "jobs" + verbs: ["*"] + - apiGroups: ["apps"] + resources: + - "statefulsets" + verbs: ["*"] + - apiGroups: [""] + resources: + - "pods" + - "secrets" + - "services" + - "serviceaccounts" + verbs: ["*"] +--- +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +rules: + - apiGroups: + - "scheduler.arangodb.com" + resources: + - "arangoprofiles" + - "arangoprofiles/status" + - "arangoschedulerpods" + - "arangoschedulerpods/status" + - "arangoschedulerdeployments" + - "arangoschedulerdeployments/status" + - "arangoschedulerbatchjobs" + - "arangoschedulerbatchjobs/status" + - "arangoschedulercronjobs" + - "arangoschedulercronjobs/status" + verbs: + - "*" + - apiGroups: + - "" + resources: + - "pods" + - "pods/status" + verbs: + - "*" + - apiGroups: + - "apps" + resources: + - "deployments" + - "deployments/status" + verbs: + - "*" + - apiGroups: + - "batch" + resources: + - "jobs" + - "jobs/status" + - "cronjobs" + - "cronjobs/status" + verbs: + - "*" + - apiGroups: + - "database.arangodb.com" + resources: + - "arangodeployments" + verbs: + - "get" + - "list" + - "watch" +--- # Source: kube-arangodb/templates/deployment-operator/default-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -162,7 +374,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -183,7 +395,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -196,6 +408,48 @@ subjects: name: arango-deployment-operator namespace: default --- +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-networking + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-networking +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: arango-deployment-operator-rbac-scheduler + namespace: default + labels: + app.kubernetes.io/name: kube-arangodb + helm.sh/chart: kube-arangodb-1.2.43 + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/instance: deployment + release: deployment +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: arango-deployment-operator-rbac-scheduler +subjects: + - kind: ServiceAccount + name: arango-deployment-operator + namespace: default +--- # Source: kube-arangodb/templates/service.yaml apiVersion: v1 kind: Service @@ -204,7 +458,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -239,7 +493,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -257,7 +511,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: deployment release: deployment @@ -296,11 +550,13 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.deployment - --mode.single + - --operator.networking + - --operator.scheduler - --chaos.allowed=false env: - name: MY_POD_NAMESPACE diff --git a/manifests/kustomize/k2kclustersync/arango-k2kclustersync.yaml b/manifests/kustomize/k2kclustersync/arango-k2kclustersync.yaml index 7eee9aec9..110d0d168 100644 --- a/manifests/kustomize/k2kclustersync/arango-k2kclustersync.yaml +++ b/manifests/kustomize/k2kclustersync/arango-k2kclustersync.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -18,24 +18,11 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/k2k-cluster-sync-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -44,7 +31,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -60,7 +47,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -80,7 +67,7 @@ metadata: name: arango-k2kclustersync-operator-rbac-k2kclustersync labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -101,7 +88,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -130,7 +117,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -151,7 +138,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -186,7 +173,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -204,7 +191,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: k2kclustersync release: k2kclustersync @@ -243,7 +230,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --mode.single @@ -406,6 +393,38 @@ spec: --- +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + + # Source: kube-arangodb/templates/storage-operator/cluster-role-binding.yaml --- diff --git a/manifests/kustomize/storage/arango-storage.yaml b/manifests/kustomize/storage/arango-storage.yaml index 7831badb9..50872274b 100644 --- a/manifests/kustomize/storage/arango-storage.yaml +++ b/manifests/kustomize/storage/arango-storage.yaml @@ -6,7 +6,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -18,7 +18,7 @@ metadata: name: arangolocalstorages.storage.arangodb.com labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -48,24 +48,11 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage rules: - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch", "update", "delete"] - resourceNames: - - "arangodeployments.database.arangodb.com" - - "arangoclustersynchronizations.database.arangodb.com" - - "arangomembers.database.arangodb.com" - - "arangotasks.database.arangodb.com" - - "arangodeploymentreplications.replication.database.arangodb.com" - - "arangobackups.backup.arangodb.com" - - "arangobackuppolicies.backup.arangodb.com" - - "arangojobs.apps.arangodb.com" - - "arangolocalstorages.storage.arangodb.com" --- # Source: kube-arangodb/templates/storage-operator/cluster-role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -74,7 +61,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -102,7 +89,7 @@ metadata: name: arango-storage-operator-rbac-crd labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -122,7 +109,7 @@ metadata: name: arango-storage-operator-rbac-storage labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -143,7 +130,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -169,7 +156,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -190,7 +177,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -225,7 +212,7 @@ metadata: namespace: default labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -243,7 +230,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-arangodb - helm.sh/chart: kube-arangodb-1.2.42 + helm.sh/chart: kube-arangodb-1.2.43 app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: storage release: storage @@ -282,7 +269,7 @@ spec: containers: - name: operator imagePullPolicy: Always - image: arangodb/kube-arangodb:1.2.42 + image: arangodb/kube-arangodb:1.2.43 args: - --scope=legacy - --operator.storage @@ -460,3 +447,35 @@ spec: # Source: kube-arangodb/templates/ml-operator/role.yaml --- + +# Source: kube-arangodb/templates/networking-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/networking-operator/role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/cluster-role.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role-binding.yaml +--- + + +# Source: kube-arangodb/templates/scheduler-operator/role.yaml +--- + diff --git a/pkg/operatorV2/handler_p0.generated.go b/pkg/operatorV2/handler_p0.generated.go index f29852614..492a0e785 100644 --- a/pkg/operatorV2/handler_p0.generated.go +++ b/pkg/operatorV2/handler_p0.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p1.generated.go b/pkg/operatorV2/handler_p1.generated.go index 381d562d2..9e455e237 100644 --- a/pkg/operatorV2/handler_p1.generated.go +++ b/pkg/operatorV2/handler_p1.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p2.generated.go b/pkg/operatorV2/handler_p2.generated.go index 5176b8cab..7db3e05e4 100644 --- a/pkg/operatorV2/handler_p2.generated.go +++ b/pkg/operatorV2/handler_p2.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p3.generated.go b/pkg/operatorV2/handler_p3.generated.go index 31b05f6b2..5bccf5f32 100644 --- a/pkg/operatorV2/handler_p3.generated.go +++ b/pkg/operatorV2/handler_p3.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p4.generated.go b/pkg/operatorV2/handler_p4.generated.go index b1249dcec..765207e7c 100644 --- a/pkg/operatorV2/handler_p4.generated.go +++ b/pkg/operatorV2/handler_p4.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p5.generated.go b/pkg/operatorV2/handler_p5.generated.go index b8803f296..3fe2255e3 100644 --- a/pkg/operatorV2/handler_p5.generated.go +++ b/pkg/operatorV2/handler_p5.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p6.generated.go b/pkg/operatorV2/handler_p6.generated.go index 5811317f2..6b156beef 100644 --- a/pkg/operatorV2/handler_p6.generated.go +++ b/pkg/operatorV2/handler_p6.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p7.generated.go b/pkg/operatorV2/handler_p7.generated.go index edd4fe844..8e8242bde 100644 --- a/pkg/operatorV2/handler_p7.generated.go +++ b/pkg/operatorV2/handler_p7.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p8.generated.go b/pkg/operatorV2/handler_p8.generated.go index 72c210d3e..da316e688 100644 --- a/pkg/operatorV2/handler_p8.generated.go +++ b/pkg/operatorV2/handler_p8.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import ( diff --git a/pkg/operatorV2/handler_p9.generated.go b/pkg/operatorV2/handler_p9.generated.go index d21ed0f0e..a2d30073e 100644 --- a/pkg/operatorV2/handler_p9.generated.go +++ b/pkg/operatorV2/handler_p9.generated.go @@ -1,23 +1,3 @@ -// -// DISCLAIMER -// -// Copyright 2024 ArangoDB GmbH, Cologne, Germany -// -// 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 holder is ArangoDB GmbH, Cologne, Germany -// - package operator import (