├── .dockerignore ├── .github └── workflows │ └── publish.yaml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── README.md ├── app.yaml ├── example ├── step-1 │ ├── Cargo.toml │ ├── Dockerfile │ └── src │ │ └── main.rs ├── step-2 │ ├── Cargo.toml │ ├── Dockerfile │ └── src │ │ ├── main.rs │ │ ├── resources.rs │ │ └── resources │ │ └── llama.rs └── step-3 │ ├── Cargo.toml │ ├── Dockerfile │ └── src │ ├── main.rs │ ├── resources.rs │ └── resources │ ├── farmpod.rs │ └── llama.rs ├── platform.sh ├── rust-toolchain.toml ├── rustfmt.toml └── src └── main.rs /.dockerignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [main] 7 | paths: 8 | - '**.rs' 9 | - '**.toml' 10 | - '**.lock' 11 | - '**/Dockerfile' 12 | - '**/.docker*' 13 | 14 | jobs: 15 | build-and-publish: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - 19 | name: Checkout 20 | uses: actions/checkout@v3 21 | - 22 | name: Set up QEMU 23 | uses: docker/setup-qemu-action@v2 24 | - 25 | name: Set up Docker Buildx 26 | uses: docker/setup-buildx-action@v2 27 | - 28 | name: Login to GHCR 29 | uses: docker/login-action@v2 30 | with: 31 | registry: ghcr.io 32 | username: ${{ github.repository_owner }} 33 | password: ${{ secrets.GITHUB_TOKEN }} 34 | - 35 | name: Build and push 36 | uses: docker/build-push-action@v3 37 | with: 38 | context: . 39 | push: true 40 | platforms: linux/amd64,linux/arm64,linux/arm/v7 41 | cache-from: type=gha 42 | cache-to: type=gha,mode=max 43 | build-args: | 44 | GITHUB_SHA=${{ github.sha }} 45 | tags: ghcr.io/metalbear-co/farm-operator:latest 46 | 47 | build-and-publish-examples: 48 | strategy: 49 | matrix: 50 | step: ['step-1', 'step-2', 'step-3'] 51 | runs-on: ubuntu-latest 52 | steps: 53 | - 54 | name: Checkout 55 | uses: actions/checkout@v3 56 | - 57 | name: Set up QEMU 58 | uses: docker/setup-qemu-action@v2 59 | - 60 | name: Set up Docker Buildx 61 | uses: docker/setup-buildx-action@v2 62 | - 63 | name: Login to GHCR 64 | uses: docker/login-action@v2 65 | with: 66 | registry: ghcr.io 67 | username: ${{ github.repository_owner }} 68 | password: ${{ secrets.GITHUB_TOKEN }} 69 | - 70 | name: Build and push 71 | uses: docker/build-push-action@v3 72 | with: 73 | context: . 74 | file: ./example/${{ matrix.step }}/Dockerfile 75 | push: true 76 | platforms: linux/amd64,linux/arm64,linux/arm/v7 77 | cache-from: type=gha 78 | cache-to: type=gha,mode=max 79 | build-args: | 80 | GITHUB_SHA=${{ github.sha }} 81 | tags: ghcr.io/metalbear-co/farm-operator:${{ matrix.step }} 82 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "android_system_properties" 7 | version = "0.1.5" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 10 | dependencies = [ 11 | "libc", 12 | ] 13 | 14 | [[package]] 15 | name = "anyhow" 16 | version = "1.0.69" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" 19 | 20 | [[package]] 21 | name = "arc-swap" 22 | version = "1.6.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" 25 | 26 | [[package]] 27 | name = "async-trait" 28 | version = "0.1.66" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" 31 | dependencies = [ 32 | "proc-macro2", 33 | "quote", 34 | "syn", 35 | ] 36 | 37 | [[package]] 38 | name = "autocfg" 39 | version = "1.1.0" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 42 | 43 | [[package]] 44 | name = "axum" 45 | version = "0.6.7" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "2fb79c228270dcf2426e74864cabc94babb5dbab01a4314e702d2f16540e1591" 48 | dependencies = [ 49 | "async-trait", 50 | "axum-core", 51 | "bitflags", 52 | "bytes", 53 | "futures-util", 54 | "http", 55 | "http-body", 56 | "hyper", 57 | "itoa", 58 | "matchit", 59 | "memchr", 60 | "mime", 61 | "percent-encoding", 62 | "pin-project-lite", 63 | "rustversion", 64 | "serde", 65 | "serde_json", 66 | "serde_path_to_error", 67 | "serde_urlencoded", 68 | "sync_wrapper", 69 | "tokio", 70 | "tower", 71 | "tower-http", 72 | "tower-layer", 73 | "tower-service", 74 | ] 75 | 76 | [[package]] 77 | name = "axum-core" 78 | version = "0.3.3" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e" 81 | dependencies = [ 82 | "async-trait", 83 | "bytes", 84 | "futures-util", 85 | "http", 86 | "http-body", 87 | "mime", 88 | "rustversion", 89 | "tower-layer", 90 | "tower-service", 91 | ] 92 | 93 | [[package]] 94 | name = "axum-server" 95 | version = "0.4.6" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "25e4a990e1593e286b1b96e6df76da9dbcb84945a810287ca8101f1a4f000f61" 98 | dependencies = [ 99 | "arc-swap", 100 | "bytes", 101 | "futures-util", 102 | "http", 103 | "http-body", 104 | "hyper", 105 | "pin-project-lite", 106 | "rustls", 107 | "rustls-pemfile", 108 | "tokio", 109 | "tokio-rustls", 110 | "tower-service", 111 | ] 112 | 113 | [[package]] 114 | name = "base64" 115 | version = "0.13.1" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 118 | 119 | [[package]] 120 | name = "base64" 121 | version = "0.20.0" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" 124 | 125 | [[package]] 126 | name = "base64" 127 | version = "0.21.0" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" 130 | 131 | [[package]] 132 | name = "bitflags" 133 | version = "1.3.2" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 136 | 137 | [[package]] 138 | name = "bumpalo" 139 | version = "3.12.0" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" 142 | 143 | [[package]] 144 | name = "bytes" 145 | version = "1.4.0" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 148 | 149 | [[package]] 150 | name = "cc" 151 | version = "1.0.79" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 154 | 155 | [[package]] 156 | name = "cfg-if" 157 | version = "1.0.0" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 160 | 161 | [[package]] 162 | name = "chrono" 163 | version = "0.4.23" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" 166 | dependencies = [ 167 | "iana-time-zone", 168 | "js-sys", 169 | "num-integer", 170 | "num-traits", 171 | "serde", 172 | "time 0.1.45", 173 | "wasm-bindgen", 174 | "winapi", 175 | ] 176 | 177 | [[package]] 178 | name = "codespan-reporting" 179 | version = "0.11.1" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 182 | dependencies = [ 183 | "termcolor", 184 | "unicode-width", 185 | ] 186 | 187 | [[package]] 188 | name = "core-foundation" 189 | version = "0.9.3" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 192 | dependencies = [ 193 | "core-foundation-sys", 194 | "libc", 195 | ] 196 | 197 | [[package]] 198 | name = "core-foundation-sys" 199 | version = "0.8.3" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 202 | 203 | [[package]] 204 | name = "cxx" 205 | version = "1.0.92" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" 208 | dependencies = [ 209 | "cc", 210 | "cxxbridge-flags", 211 | "cxxbridge-macro", 212 | "link-cplusplus", 213 | ] 214 | 215 | [[package]] 216 | name = "cxx-build" 217 | version = "1.0.92" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" 220 | dependencies = [ 221 | "cc", 222 | "codespan-reporting", 223 | "once_cell", 224 | "proc-macro2", 225 | "quote", 226 | "scratch", 227 | "syn", 228 | ] 229 | 230 | [[package]] 231 | name = "cxxbridge-flags" 232 | version = "1.0.92" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" 235 | 236 | [[package]] 237 | name = "cxxbridge-macro" 238 | version = "1.0.92" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" 241 | dependencies = [ 242 | "proc-macro2", 243 | "quote", 244 | "syn", 245 | ] 246 | 247 | [[package]] 248 | name = "darling" 249 | version = "0.14.3" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" 252 | dependencies = [ 253 | "darling_core", 254 | "darling_macro", 255 | ] 256 | 257 | [[package]] 258 | name = "darling_core" 259 | version = "0.14.3" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" 262 | dependencies = [ 263 | "fnv", 264 | "ident_case", 265 | "proc-macro2", 266 | "quote", 267 | "strsim", 268 | "syn", 269 | ] 270 | 271 | [[package]] 272 | name = "darling_macro" 273 | version = "0.14.3" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" 276 | dependencies = [ 277 | "darling_core", 278 | "quote", 279 | "syn", 280 | ] 281 | 282 | [[package]] 283 | name = "dirs-next" 284 | version = "2.0.0" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" 287 | dependencies = [ 288 | "cfg-if", 289 | "dirs-sys-next", 290 | ] 291 | 292 | [[package]] 293 | name = "dirs-sys-next" 294 | version = "0.1.2" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" 297 | dependencies = [ 298 | "libc", 299 | "redox_users", 300 | "winapi", 301 | ] 302 | 303 | [[package]] 304 | name = "dyn-clone" 305 | version = "1.0.11" 306 | source = "registry+https://github.com/rust-lang/crates.io-index" 307 | checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" 308 | 309 | [[package]] 310 | name = "either" 311 | version = "1.8.1" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 314 | 315 | [[package]] 316 | name = "farm-operator" 317 | version = "0.1.0" 318 | dependencies = [ 319 | "anyhow", 320 | "axum", 321 | "axum-server", 322 | "k8s-openapi", 323 | "rcgen", 324 | "tokio", 325 | ] 326 | 327 | [[package]] 328 | name = "farm-operator-1" 329 | version = "0.1.0" 330 | dependencies = [ 331 | "anyhow", 332 | "axum", 333 | "axum-server", 334 | "k8s-openapi", 335 | "rcgen", 336 | "tokio", 337 | ] 338 | 339 | [[package]] 340 | name = "farm-operator-2" 341 | version = "0.1.0" 342 | dependencies = [ 343 | "anyhow", 344 | "axum", 345 | "axum-server", 346 | "chrono", 347 | "k8s-openapi", 348 | "kube", 349 | "rcgen", 350 | "schemars", 351 | "serde", 352 | "serde_json", 353 | "tokio", 354 | ] 355 | 356 | [[package]] 357 | name = "farm-operator-3" 358 | version = "0.1.0" 359 | dependencies = [ 360 | "anyhow", 361 | "axum", 362 | "axum-server", 363 | "chrono", 364 | "k8s-openapi", 365 | "kube", 366 | "rcgen", 367 | "schemars", 368 | "serde", 369 | "serde_json", 370 | "tokio", 371 | ] 372 | 373 | [[package]] 374 | name = "fnv" 375 | version = "1.0.7" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 378 | 379 | [[package]] 380 | name = "form_urlencoded" 381 | version = "1.1.0" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 384 | dependencies = [ 385 | "percent-encoding", 386 | ] 387 | 388 | [[package]] 389 | name = "futures" 390 | version = "0.3.26" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" 393 | dependencies = [ 394 | "futures-channel", 395 | "futures-core", 396 | "futures-executor", 397 | "futures-io", 398 | "futures-sink", 399 | "futures-task", 400 | "futures-util", 401 | ] 402 | 403 | [[package]] 404 | name = "futures-channel" 405 | version = "0.3.26" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" 408 | dependencies = [ 409 | "futures-core", 410 | "futures-sink", 411 | ] 412 | 413 | [[package]] 414 | name = "futures-core" 415 | version = "0.3.26" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" 418 | 419 | [[package]] 420 | name = "futures-executor" 421 | version = "0.3.26" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" 424 | dependencies = [ 425 | "futures-core", 426 | "futures-task", 427 | "futures-util", 428 | ] 429 | 430 | [[package]] 431 | name = "futures-io" 432 | version = "0.3.26" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" 435 | 436 | [[package]] 437 | name = "futures-macro" 438 | version = "0.3.26" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" 441 | dependencies = [ 442 | "proc-macro2", 443 | "quote", 444 | "syn", 445 | ] 446 | 447 | [[package]] 448 | name = "futures-sink" 449 | version = "0.3.26" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" 452 | 453 | [[package]] 454 | name = "futures-task" 455 | version = "0.3.26" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" 458 | 459 | [[package]] 460 | name = "futures-util" 461 | version = "0.3.26" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" 464 | dependencies = [ 465 | "futures-channel", 466 | "futures-core", 467 | "futures-io", 468 | "futures-macro", 469 | "futures-sink", 470 | "futures-task", 471 | "memchr", 472 | "pin-project-lite", 473 | "pin-utils", 474 | "slab", 475 | ] 476 | 477 | [[package]] 478 | name = "getrandom" 479 | version = "0.2.8" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 482 | dependencies = [ 483 | "cfg-if", 484 | "libc", 485 | "wasi 0.11.0+wasi-snapshot-preview1", 486 | ] 487 | 488 | [[package]] 489 | name = "h2" 490 | version = "0.3.16" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" 493 | dependencies = [ 494 | "bytes", 495 | "fnv", 496 | "futures-core", 497 | "futures-sink", 498 | "futures-util", 499 | "http", 500 | "indexmap", 501 | "slab", 502 | "tokio", 503 | "tokio-util", 504 | "tracing", 505 | ] 506 | 507 | [[package]] 508 | name = "hashbrown" 509 | version = "0.12.3" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 512 | 513 | [[package]] 514 | name = "hermit-abi" 515 | version = "0.2.6" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 518 | dependencies = [ 519 | "libc", 520 | ] 521 | 522 | [[package]] 523 | name = "http" 524 | version = "0.2.9" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 527 | dependencies = [ 528 | "bytes", 529 | "fnv", 530 | "itoa", 531 | ] 532 | 533 | [[package]] 534 | name = "http-body" 535 | version = "0.4.5" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 538 | dependencies = [ 539 | "bytes", 540 | "http", 541 | "pin-project-lite", 542 | ] 543 | 544 | [[package]] 545 | name = "http-range-header" 546 | version = "0.3.0" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" 549 | 550 | [[package]] 551 | name = "httparse" 552 | version = "1.8.0" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 555 | 556 | [[package]] 557 | name = "httpdate" 558 | version = "1.0.2" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 561 | 562 | [[package]] 563 | name = "hyper" 564 | version = "0.14.24" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" 567 | dependencies = [ 568 | "bytes", 569 | "futures-channel", 570 | "futures-core", 571 | "futures-util", 572 | "h2", 573 | "http", 574 | "http-body", 575 | "httparse", 576 | "httpdate", 577 | "itoa", 578 | "pin-project-lite", 579 | "socket2", 580 | "tokio", 581 | "tower-service", 582 | "tracing", 583 | "want", 584 | ] 585 | 586 | [[package]] 587 | name = "hyper-rustls" 588 | version = "0.23.2" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" 591 | dependencies = [ 592 | "http", 593 | "hyper", 594 | "log", 595 | "rustls", 596 | "rustls-native-certs", 597 | "tokio", 598 | "tokio-rustls", 599 | ] 600 | 601 | [[package]] 602 | name = "hyper-timeout" 603 | version = "0.4.1" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" 606 | dependencies = [ 607 | "hyper", 608 | "pin-project-lite", 609 | "tokio", 610 | "tokio-io-timeout", 611 | ] 612 | 613 | [[package]] 614 | name = "iana-time-zone" 615 | version = "0.1.53" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" 618 | dependencies = [ 619 | "android_system_properties", 620 | "core-foundation-sys", 621 | "iana-time-zone-haiku", 622 | "js-sys", 623 | "wasm-bindgen", 624 | "winapi", 625 | ] 626 | 627 | [[package]] 628 | name = "iana-time-zone-haiku" 629 | version = "0.1.1" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" 632 | dependencies = [ 633 | "cxx", 634 | "cxx-build", 635 | ] 636 | 637 | [[package]] 638 | name = "ident_case" 639 | version = "1.0.1" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 642 | 643 | [[package]] 644 | name = "idna" 645 | version = "0.3.0" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 648 | dependencies = [ 649 | "unicode-bidi", 650 | "unicode-normalization", 651 | ] 652 | 653 | [[package]] 654 | name = "indexmap" 655 | version = "1.9.2" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" 658 | dependencies = [ 659 | "autocfg", 660 | "hashbrown", 661 | ] 662 | 663 | [[package]] 664 | name = "itoa" 665 | version = "1.0.6" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 668 | 669 | [[package]] 670 | name = "js-sys" 671 | version = "0.3.61" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" 674 | dependencies = [ 675 | "wasm-bindgen", 676 | ] 677 | 678 | [[package]] 679 | name = "jsonpath_lib" 680 | version = "0.3.0" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "eaa63191d68230cccb81c5aa23abd53ed64d83337cacbb25a7b8c7979523774f" 683 | dependencies = [ 684 | "log", 685 | "serde", 686 | "serde_json", 687 | ] 688 | 689 | [[package]] 690 | name = "k8s-openapi" 691 | version = "0.17.0" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | checksum = "3d1985030683a2bac402cbda61222195de80d3f66b4c87ab56e5fea379bd98c3" 694 | dependencies = [ 695 | "base64 0.20.0", 696 | "bytes", 697 | "chrono", 698 | "http", 699 | "percent-encoding", 700 | "serde", 701 | "serde-value", 702 | "serde_json", 703 | "url", 704 | ] 705 | 706 | [[package]] 707 | name = "kube" 708 | version = "0.78.0" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "53ee2ba94546e32a5aef943e5831c6ac25592ff8dcfa8b2a06e0aaea90c69188" 711 | dependencies = [ 712 | "k8s-openapi", 713 | "kube-client", 714 | "kube-core", 715 | "kube-derive", 716 | ] 717 | 718 | [[package]] 719 | name = "kube-client" 720 | version = "0.78.0" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "7c9ca1f597bd48ed26f45f601bf2fa3aaa0933b8d1652d883b8444519b72af4a" 723 | dependencies = [ 724 | "base64 0.20.0", 725 | "bytes", 726 | "chrono", 727 | "dirs-next", 728 | "either", 729 | "futures", 730 | "http", 731 | "http-body", 732 | "hyper", 733 | "hyper-rustls", 734 | "hyper-timeout", 735 | "jsonpath_lib", 736 | "k8s-openapi", 737 | "kube-core", 738 | "pem", 739 | "pin-project", 740 | "rustls", 741 | "rustls-pemfile", 742 | "secrecy", 743 | "serde", 744 | "serde_json", 745 | "serde_yaml", 746 | "thiserror", 747 | "tokio", 748 | "tokio-util", 749 | "tower", 750 | "tower-http", 751 | "tracing", 752 | ] 753 | 754 | [[package]] 755 | name = "kube-core" 756 | version = "0.78.0" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "61f2c6d1a2d1584859499eb05a41c5a44713818041621fa7515cfdbdf4769ea7" 759 | dependencies = [ 760 | "chrono", 761 | "form_urlencoded", 762 | "http", 763 | "k8s-openapi", 764 | "once_cell", 765 | "schemars", 766 | "serde", 767 | "serde_json", 768 | "thiserror", 769 | ] 770 | 771 | [[package]] 772 | name = "kube-derive" 773 | version = "0.78.0" 774 | source = "registry+https://github.com/rust-lang/crates.io-index" 775 | checksum = "3e1dfe288fd87029f87c5713ddf585a4221e1b5be8f8c7c02ba28f5211f2a6d7" 776 | dependencies = [ 777 | "darling", 778 | "proc-macro2", 779 | "quote", 780 | "serde_json", 781 | "syn", 782 | ] 783 | 784 | [[package]] 785 | name = "libc" 786 | version = "0.2.139" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" 789 | 790 | [[package]] 791 | name = "link-cplusplus" 792 | version = "1.0.8" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" 795 | dependencies = [ 796 | "cc", 797 | ] 798 | 799 | [[package]] 800 | name = "linked-hash-map" 801 | version = "0.5.6" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" 804 | 805 | [[package]] 806 | name = "lock_api" 807 | version = "0.4.9" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 810 | dependencies = [ 811 | "autocfg", 812 | "scopeguard", 813 | ] 814 | 815 | [[package]] 816 | name = "log" 817 | version = "0.4.17" 818 | source = "registry+https://github.com/rust-lang/crates.io-index" 819 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 820 | dependencies = [ 821 | "cfg-if", 822 | ] 823 | 824 | [[package]] 825 | name = "matchit" 826 | version = "0.7.0" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" 829 | 830 | [[package]] 831 | name = "memchr" 832 | version = "2.5.0" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 835 | 836 | [[package]] 837 | name = "mime" 838 | version = "0.3.16" 839 | source = "registry+https://github.com/rust-lang/crates.io-index" 840 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 841 | 842 | [[package]] 843 | name = "mio" 844 | version = "0.8.6" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 847 | dependencies = [ 848 | "libc", 849 | "log", 850 | "wasi 0.11.0+wasi-snapshot-preview1", 851 | "windows-sys 0.45.0", 852 | ] 853 | 854 | [[package]] 855 | name = "num-integer" 856 | version = "0.1.45" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 859 | dependencies = [ 860 | "autocfg", 861 | "num-traits", 862 | ] 863 | 864 | [[package]] 865 | name = "num-traits" 866 | version = "0.2.15" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 869 | dependencies = [ 870 | "autocfg", 871 | ] 872 | 873 | [[package]] 874 | name = "num_cpus" 875 | version = "1.15.0" 876 | source = "registry+https://github.com/rust-lang/crates.io-index" 877 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 878 | dependencies = [ 879 | "hermit-abi", 880 | "libc", 881 | ] 882 | 883 | [[package]] 884 | name = "once_cell" 885 | version = "1.17.1" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 888 | 889 | [[package]] 890 | name = "openssl-probe" 891 | version = "0.1.5" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 894 | 895 | [[package]] 896 | name = "ordered-float" 897 | version = "2.10.0" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" 900 | dependencies = [ 901 | "num-traits", 902 | ] 903 | 904 | [[package]] 905 | name = "parking_lot" 906 | version = "0.12.1" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 909 | dependencies = [ 910 | "lock_api", 911 | "parking_lot_core", 912 | ] 913 | 914 | [[package]] 915 | name = "parking_lot_core" 916 | version = "0.9.7" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 919 | dependencies = [ 920 | "cfg-if", 921 | "libc", 922 | "redox_syscall", 923 | "smallvec", 924 | "windows-sys 0.45.0", 925 | ] 926 | 927 | [[package]] 928 | name = "pem" 929 | version = "1.1.1" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" 932 | dependencies = [ 933 | "base64 0.13.1", 934 | ] 935 | 936 | [[package]] 937 | name = "percent-encoding" 938 | version = "2.2.0" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 941 | 942 | [[package]] 943 | name = "pin-project" 944 | version = "1.0.12" 945 | source = "registry+https://github.com/rust-lang/crates.io-index" 946 | checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" 947 | dependencies = [ 948 | "pin-project-internal", 949 | ] 950 | 951 | [[package]] 952 | name = "pin-project-internal" 953 | version = "1.0.12" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" 956 | dependencies = [ 957 | "proc-macro2", 958 | "quote", 959 | "syn", 960 | ] 961 | 962 | [[package]] 963 | name = "pin-project-lite" 964 | version = "0.2.9" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 967 | 968 | [[package]] 969 | name = "pin-utils" 970 | version = "0.1.0" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 973 | 974 | [[package]] 975 | name = "proc-macro2" 976 | version = "1.0.51" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" 979 | dependencies = [ 980 | "unicode-ident", 981 | ] 982 | 983 | [[package]] 984 | name = "quote" 985 | version = "1.0.23" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" 988 | dependencies = [ 989 | "proc-macro2", 990 | ] 991 | 992 | [[package]] 993 | name = "rcgen" 994 | version = "0.10.0" 995 | source = "registry+https://github.com/rust-lang/crates.io-index" 996 | checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" 997 | dependencies = [ 998 | "pem", 999 | "ring", 1000 | "time 0.3.20", 1001 | "yasna", 1002 | ] 1003 | 1004 | [[package]] 1005 | name = "redox_syscall" 1006 | version = "0.2.16" 1007 | source = "registry+https://github.com/rust-lang/crates.io-index" 1008 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1009 | dependencies = [ 1010 | "bitflags", 1011 | ] 1012 | 1013 | [[package]] 1014 | name = "redox_users" 1015 | version = "0.4.3" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1018 | dependencies = [ 1019 | "getrandom", 1020 | "redox_syscall", 1021 | "thiserror", 1022 | ] 1023 | 1024 | [[package]] 1025 | name = "ring" 1026 | version = "0.16.20" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 1029 | dependencies = [ 1030 | "cc", 1031 | "libc", 1032 | "once_cell", 1033 | "spin", 1034 | "untrusted", 1035 | "web-sys", 1036 | "winapi", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "rustls" 1041 | version = "0.20.6" 1042 | source = "git+https://github.com/metalbear-co/rustls?branch=feat-ip-address#c706a865b99b7f1743342060178b28aed0257682" 1043 | dependencies = [ 1044 | "log", 1045 | "ring", 1046 | "sct", 1047 | "webpki 0.21.4", 1048 | ] 1049 | 1050 | [[package]] 1051 | name = "rustls-native-certs" 1052 | version = "0.6.2" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" 1055 | dependencies = [ 1056 | "openssl-probe", 1057 | "rustls-pemfile", 1058 | "schannel", 1059 | "security-framework", 1060 | ] 1061 | 1062 | [[package]] 1063 | name = "rustls-pemfile" 1064 | version = "1.0.2" 1065 | source = "registry+https://github.com/rust-lang/crates.io-index" 1066 | checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" 1067 | dependencies = [ 1068 | "base64 0.21.0", 1069 | ] 1070 | 1071 | [[package]] 1072 | name = "rustversion" 1073 | version = "1.0.12" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" 1076 | 1077 | [[package]] 1078 | name = "ryu" 1079 | version = "1.0.13" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 1082 | 1083 | [[package]] 1084 | name = "schannel" 1085 | version = "0.1.21" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" 1088 | dependencies = [ 1089 | "windows-sys 0.42.0", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "schemars" 1094 | version = "0.8.12" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" 1097 | dependencies = [ 1098 | "dyn-clone", 1099 | "schemars_derive", 1100 | "serde", 1101 | "serde_json", 1102 | ] 1103 | 1104 | [[package]] 1105 | name = "schemars_derive" 1106 | version = "0.8.12" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" 1109 | dependencies = [ 1110 | "proc-macro2", 1111 | "quote", 1112 | "serde_derive_internals", 1113 | "syn", 1114 | ] 1115 | 1116 | [[package]] 1117 | name = "scopeguard" 1118 | version = "1.1.0" 1119 | source = "registry+https://github.com/rust-lang/crates.io-index" 1120 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1121 | 1122 | [[package]] 1123 | name = "scratch" 1124 | version = "1.0.5" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" 1127 | 1128 | [[package]] 1129 | name = "sct" 1130 | version = "0.7.0" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" 1133 | dependencies = [ 1134 | "ring", 1135 | "untrusted", 1136 | ] 1137 | 1138 | [[package]] 1139 | name = "secrecy" 1140 | version = "0.8.0" 1141 | source = "registry+https://github.com/rust-lang/crates.io-index" 1142 | checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" 1143 | dependencies = [ 1144 | "serde", 1145 | "zeroize", 1146 | ] 1147 | 1148 | [[package]] 1149 | name = "security-framework" 1150 | version = "2.8.2" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" 1153 | dependencies = [ 1154 | "bitflags", 1155 | "core-foundation", 1156 | "core-foundation-sys", 1157 | "libc", 1158 | "security-framework-sys", 1159 | ] 1160 | 1161 | [[package]] 1162 | name = "security-framework-sys" 1163 | version = "2.8.0" 1164 | source = "registry+https://github.com/rust-lang/crates.io-index" 1165 | checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" 1166 | dependencies = [ 1167 | "core-foundation-sys", 1168 | "libc", 1169 | ] 1170 | 1171 | [[package]] 1172 | name = "serde" 1173 | version = "1.0.154" 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" 1175 | checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" 1176 | dependencies = [ 1177 | "serde_derive", 1178 | ] 1179 | 1180 | [[package]] 1181 | name = "serde-value" 1182 | version = "0.7.0" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" 1185 | dependencies = [ 1186 | "ordered-float", 1187 | "serde", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "serde_derive" 1192 | version = "1.0.154" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" 1195 | dependencies = [ 1196 | "proc-macro2", 1197 | "quote", 1198 | "syn", 1199 | ] 1200 | 1201 | [[package]] 1202 | name = "serde_derive_internals" 1203 | version = "0.26.0" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" 1206 | dependencies = [ 1207 | "proc-macro2", 1208 | "quote", 1209 | "syn", 1210 | ] 1211 | 1212 | [[package]] 1213 | name = "serde_json" 1214 | version = "1.0.94" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" 1217 | dependencies = [ 1218 | "indexmap", 1219 | "itoa", 1220 | "ryu", 1221 | "serde", 1222 | ] 1223 | 1224 | [[package]] 1225 | name = "serde_path_to_error" 1226 | version = "0.1.10" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "db0969fff533976baadd92e08b1d102c5a3d8a8049eadfd69d4d1e3c5b2ed189" 1229 | dependencies = [ 1230 | "serde", 1231 | ] 1232 | 1233 | [[package]] 1234 | name = "serde_urlencoded" 1235 | version = "0.7.1" 1236 | source = "registry+https://github.com/rust-lang/crates.io-index" 1237 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1238 | dependencies = [ 1239 | "form_urlencoded", 1240 | "itoa", 1241 | "ryu", 1242 | "serde", 1243 | ] 1244 | 1245 | [[package]] 1246 | name = "serde_yaml" 1247 | version = "0.8.26" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" 1250 | dependencies = [ 1251 | "indexmap", 1252 | "ryu", 1253 | "serde", 1254 | "yaml-rust", 1255 | ] 1256 | 1257 | [[package]] 1258 | name = "signal-hook-registry" 1259 | version = "1.4.1" 1260 | source = "registry+https://github.com/rust-lang/crates.io-index" 1261 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1262 | dependencies = [ 1263 | "libc", 1264 | ] 1265 | 1266 | [[package]] 1267 | name = "slab" 1268 | version = "0.4.8" 1269 | source = "registry+https://github.com/rust-lang/crates.io-index" 1270 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 1271 | dependencies = [ 1272 | "autocfg", 1273 | ] 1274 | 1275 | [[package]] 1276 | name = "smallvec" 1277 | version = "1.10.0" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 1280 | 1281 | [[package]] 1282 | name = "socket2" 1283 | version = "0.4.9" 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" 1285 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 1286 | dependencies = [ 1287 | "libc", 1288 | "winapi", 1289 | ] 1290 | 1291 | [[package]] 1292 | name = "spin" 1293 | version = "0.5.2" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 1296 | 1297 | [[package]] 1298 | name = "strsim" 1299 | version = "0.10.0" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1302 | 1303 | [[package]] 1304 | name = "syn" 1305 | version = "1.0.109" 1306 | source = "registry+https://github.com/rust-lang/crates.io-index" 1307 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1308 | dependencies = [ 1309 | "proc-macro2", 1310 | "quote", 1311 | "unicode-ident", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "sync_wrapper" 1316 | version = "0.1.2" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1319 | 1320 | [[package]] 1321 | name = "termcolor" 1322 | version = "1.2.0" 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" 1324 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 1325 | dependencies = [ 1326 | "winapi-util", 1327 | ] 1328 | 1329 | [[package]] 1330 | name = "thiserror" 1331 | version = "1.0.39" 1332 | source = "registry+https://github.com/rust-lang/crates.io-index" 1333 | checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" 1334 | dependencies = [ 1335 | "thiserror-impl", 1336 | ] 1337 | 1338 | [[package]] 1339 | name = "thiserror-impl" 1340 | version = "1.0.39" 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" 1342 | checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" 1343 | dependencies = [ 1344 | "proc-macro2", 1345 | "quote", 1346 | "syn", 1347 | ] 1348 | 1349 | [[package]] 1350 | name = "time" 1351 | version = "0.1.45" 1352 | source = "registry+https://github.com/rust-lang/crates.io-index" 1353 | checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" 1354 | dependencies = [ 1355 | "libc", 1356 | "wasi 0.10.0+wasi-snapshot-preview1", 1357 | "winapi", 1358 | ] 1359 | 1360 | [[package]] 1361 | name = "time" 1362 | version = "0.3.20" 1363 | source = "registry+https://github.com/rust-lang/crates.io-index" 1364 | checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" 1365 | dependencies = [ 1366 | "serde", 1367 | "time-core", 1368 | ] 1369 | 1370 | [[package]] 1371 | name = "time-core" 1372 | version = "0.1.0" 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" 1374 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 1375 | 1376 | [[package]] 1377 | name = "tinyvec" 1378 | version = "1.6.0" 1379 | source = "registry+https://github.com/rust-lang/crates.io-index" 1380 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1381 | dependencies = [ 1382 | "tinyvec_macros", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "tinyvec_macros" 1387 | version = "0.1.1" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1390 | 1391 | [[package]] 1392 | name = "tokio" 1393 | version = "1.26.0" 1394 | source = "registry+https://github.com/rust-lang/crates.io-index" 1395 | checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" 1396 | dependencies = [ 1397 | "autocfg", 1398 | "bytes", 1399 | "libc", 1400 | "memchr", 1401 | "mio", 1402 | "num_cpus", 1403 | "parking_lot", 1404 | "pin-project-lite", 1405 | "signal-hook-registry", 1406 | "socket2", 1407 | "tokio-macros", 1408 | "windows-sys 0.45.0", 1409 | ] 1410 | 1411 | [[package]] 1412 | name = "tokio-io-timeout" 1413 | version = "1.2.0" 1414 | source = "registry+https://github.com/rust-lang/crates.io-index" 1415 | checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" 1416 | dependencies = [ 1417 | "pin-project-lite", 1418 | "tokio", 1419 | ] 1420 | 1421 | [[package]] 1422 | name = "tokio-macros" 1423 | version = "1.8.2" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" 1426 | dependencies = [ 1427 | "proc-macro2", 1428 | "quote", 1429 | "syn", 1430 | ] 1431 | 1432 | [[package]] 1433 | name = "tokio-rustls" 1434 | version = "0.23.4" 1435 | source = "registry+https://github.com/rust-lang/crates.io-index" 1436 | checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" 1437 | dependencies = [ 1438 | "rustls", 1439 | "tokio", 1440 | "webpki 0.22.0", 1441 | ] 1442 | 1443 | [[package]] 1444 | name = "tokio-util" 1445 | version = "0.7.7" 1446 | source = "registry+https://github.com/rust-lang/crates.io-index" 1447 | checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" 1448 | dependencies = [ 1449 | "bytes", 1450 | "futures-core", 1451 | "futures-sink", 1452 | "pin-project-lite", 1453 | "tokio", 1454 | "tracing", 1455 | ] 1456 | 1457 | [[package]] 1458 | name = "tower" 1459 | version = "0.4.13" 1460 | source = "registry+https://github.com/rust-lang/crates.io-index" 1461 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1462 | dependencies = [ 1463 | "futures-core", 1464 | "futures-util", 1465 | "pin-project", 1466 | "pin-project-lite", 1467 | "tokio", 1468 | "tokio-util", 1469 | "tower-layer", 1470 | "tower-service", 1471 | "tracing", 1472 | ] 1473 | 1474 | [[package]] 1475 | name = "tower-http" 1476 | version = "0.3.5" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" 1479 | dependencies = [ 1480 | "base64 0.13.1", 1481 | "bitflags", 1482 | "bytes", 1483 | "futures-core", 1484 | "futures-util", 1485 | "http", 1486 | "http-body", 1487 | "http-range-header", 1488 | "pin-project-lite", 1489 | "tower", 1490 | "tower-layer", 1491 | "tower-service", 1492 | "tracing", 1493 | ] 1494 | 1495 | [[package]] 1496 | name = "tower-layer" 1497 | version = "0.3.2" 1498 | source = "registry+https://github.com/rust-lang/crates.io-index" 1499 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1500 | 1501 | [[package]] 1502 | name = "tower-service" 1503 | version = "0.3.2" 1504 | source = "registry+https://github.com/rust-lang/crates.io-index" 1505 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1506 | 1507 | [[package]] 1508 | name = "tracing" 1509 | version = "0.1.37" 1510 | source = "registry+https://github.com/rust-lang/crates.io-index" 1511 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1512 | dependencies = [ 1513 | "cfg-if", 1514 | "log", 1515 | "pin-project-lite", 1516 | "tracing-attributes", 1517 | "tracing-core", 1518 | ] 1519 | 1520 | [[package]] 1521 | name = "tracing-attributes" 1522 | version = "0.1.23" 1523 | source = "registry+https://github.com/rust-lang/crates.io-index" 1524 | checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" 1525 | dependencies = [ 1526 | "proc-macro2", 1527 | "quote", 1528 | "syn", 1529 | ] 1530 | 1531 | [[package]] 1532 | name = "tracing-core" 1533 | version = "0.1.30" 1534 | source = "registry+https://github.com/rust-lang/crates.io-index" 1535 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 1536 | dependencies = [ 1537 | "once_cell", 1538 | ] 1539 | 1540 | [[package]] 1541 | name = "try-lock" 1542 | version = "0.2.4" 1543 | source = "registry+https://github.com/rust-lang/crates.io-index" 1544 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 1545 | 1546 | [[package]] 1547 | name = "unicode-bidi" 1548 | version = "0.3.11" 1549 | source = "registry+https://github.com/rust-lang/crates.io-index" 1550 | checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" 1551 | 1552 | [[package]] 1553 | name = "unicode-ident" 1554 | version = "1.0.8" 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" 1556 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 1557 | 1558 | [[package]] 1559 | name = "unicode-normalization" 1560 | version = "0.1.22" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1563 | dependencies = [ 1564 | "tinyvec", 1565 | ] 1566 | 1567 | [[package]] 1568 | name = "unicode-width" 1569 | version = "0.1.10" 1570 | source = "registry+https://github.com/rust-lang/crates.io-index" 1571 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 1572 | 1573 | [[package]] 1574 | name = "untrusted" 1575 | version = "0.7.1" 1576 | source = "registry+https://github.com/rust-lang/crates.io-index" 1577 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 1578 | 1579 | [[package]] 1580 | name = "url" 1581 | version = "2.3.1" 1582 | source = "registry+https://github.com/rust-lang/crates.io-index" 1583 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 1584 | dependencies = [ 1585 | "form_urlencoded", 1586 | "idna", 1587 | "percent-encoding", 1588 | ] 1589 | 1590 | [[package]] 1591 | name = "want" 1592 | version = "0.3.0" 1593 | source = "registry+https://github.com/rust-lang/crates.io-index" 1594 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1595 | dependencies = [ 1596 | "log", 1597 | "try-lock", 1598 | ] 1599 | 1600 | [[package]] 1601 | name = "wasi" 1602 | version = "0.10.0+wasi-snapshot-preview1" 1603 | source = "registry+https://github.com/rust-lang/crates.io-index" 1604 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 1605 | 1606 | [[package]] 1607 | name = "wasi" 1608 | version = "0.11.0+wasi-snapshot-preview1" 1609 | source = "registry+https://github.com/rust-lang/crates.io-index" 1610 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1611 | 1612 | [[package]] 1613 | name = "wasm-bindgen" 1614 | version = "0.2.84" 1615 | source = "registry+https://github.com/rust-lang/crates.io-index" 1616 | checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" 1617 | dependencies = [ 1618 | "cfg-if", 1619 | "wasm-bindgen-macro", 1620 | ] 1621 | 1622 | [[package]] 1623 | name = "wasm-bindgen-backend" 1624 | version = "0.2.84" 1625 | source = "registry+https://github.com/rust-lang/crates.io-index" 1626 | checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" 1627 | dependencies = [ 1628 | "bumpalo", 1629 | "log", 1630 | "once_cell", 1631 | "proc-macro2", 1632 | "quote", 1633 | "syn", 1634 | "wasm-bindgen-shared", 1635 | ] 1636 | 1637 | [[package]] 1638 | name = "wasm-bindgen-macro" 1639 | version = "0.2.84" 1640 | source = "registry+https://github.com/rust-lang/crates.io-index" 1641 | checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" 1642 | dependencies = [ 1643 | "quote", 1644 | "wasm-bindgen-macro-support", 1645 | ] 1646 | 1647 | [[package]] 1648 | name = "wasm-bindgen-macro-support" 1649 | version = "0.2.84" 1650 | source = "registry+https://github.com/rust-lang/crates.io-index" 1651 | checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" 1652 | dependencies = [ 1653 | "proc-macro2", 1654 | "quote", 1655 | "syn", 1656 | "wasm-bindgen-backend", 1657 | "wasm-bindgen-shared", 1658 | ] 1659 | 1660 | [[package]] 1661 | name = "wasm-bindgen-shared" 1662 | version = "0.2.84" 1663 | source = "registry+https://github.com/rust-lang/crates.io-index" 1664 | checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" 1665 | 1666 | [[package]] 1667 | name = "web-sys" 1668 | version = "0.3.61" 1669 | source = "registry+https://github.com/rust-lang/crates.io-index" 1670 | checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" 1671 | dependencies = [ 1672 | "js-sys", 1673 | "wasm-bindgen", 1674 | ] 1675 | 1676 | [[package]] 1677 | name = "webpki" 1678 | version = "0.21.4" 1679 | source = "git+https://github.com/ctz/webpki?branch=feat-ip-address#53a0215d998ec4bef37e55a5b7eed7d41f20e8ac" 1680 | dependencies = [ 1681 | "ring", 1682 | "untrusted", 1683 | ] 1684 | 1685 | [[package]] 1686 | name = "webpki" 1687 | version = "0.22.0" 1688 | source = "registry+https://github.com/rust-lang/crates.io-index" 1689 | checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" 1690 | dependencies = [ 1691 | "ring", 1692 | "untrusted", 1693 | ] 1694 | 1695 | [[package]] 1696 | name = "winapi" 1697 | version = "0.3.9" 1698 | source = "registry+https://github.com/rust-lang/crates.io-index" 1699 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1700 | dependencies = [ 1701 | "winapi-i686-pc-windows-gnu", 1702 | "winapi-x86_64-pc-windows-gnu", 1703 | ] 1704 | 1705 | [[package]] 1706 | name = "winapi-i686-pc-windows-gnu" 1707 | version = "0.4.0" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1710 | 1711 | [[package]] 1712 | name = "winapi-util" 1713 | version = "0.1.5" 1714 | source = "registry+https://github.com/rust-lang/crates.io-index" 1715 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1716 | dependencies = [ 1717 | "winapi", 1718 | ] 1719 | 1720 | [[package]] 1721 | name = "winapi-x86_64-pc-windows-gnu" 1722 | version = "0.4.0" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1725 | 1726 | [[package]] 1727 | name = "windows-sys" 1728 | version = "0.42.0" 1729 | source = "registry+https://github.com/rust-lang/crates.io-index" 1730 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 1731 | dependencies = [ 1732 | "windows_aarch64_gnullvm", 1733 | "windows_aarch64_msvc", 1734 | "windows_i686_gnu", 1735 | "windows_i686_msvc", 1736 | "windows_x86_64_gnu", 1737 | "windows_x86_64_gnullvm", 1738 | "windows_x86_64_msvc", 1739 | ] 1740 | 1741 | [[package]] 1742 | name = "windows-sys" 1743 | version = "0.45.0" 1744 | source = "registry+https://github.com/rust-lang/crates.io-index" 1745 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1746 | dependencies = [ 1747 | "windows-targets", 1748 | ] 1749 | 1750 | [[package]] 1751 | name = "windows-targets" 1752 | version = "0.42.1" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" 1755 | dependencies = [ 1756 | "windows_aarch64_gnullvm", 1757 | "windows_aarch64_msvc", 1758 | "windows_i686_gnu", 1759 | "windows_i686_msvc", 1760 | "windows_x86_64_gnu", 1761 | "windows_x86_64_gnullvm", 1762 | "windows_x86_64_msvc", 1763 | ] 1764 | 1765 | [[package]] 1766 | name = "windows_aarch64_gnullvm" 1767 | version = "0.42.1" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" 1770 | 1771 | [[package]] 1772 | name = "windows_aarch64_msvc" 1773 | version = "0.42.1" 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" 1775 | checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" 1776 | 1777 | [[package]] 1778 | name = "windows_i686_gnu" 1779 | version = "0.42.1" 1780 | source = "registry+https://github.com/rust-lang/crates.io-index" 1781 | checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" 1782 | 1783 | [[package]] 1784 | name = "windows_i686_msvc" 1785 | version = "0.42.1" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" 1788 | 1789 | [[package]] 1790 | name = "windows_x86_64_gnu" 1791 | version = "0.42.1" 1792 | source = "registry+https://github.com/rust-lang/crates.io-index" 1793 | checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" 1794 | 1795 | [[package]] 1796 | name = "windows_x86_64_gnullvm" 1797 | version = "0.42.1" 1798 | source = "registry+https://github.com/rust-lang/crates.io-index" 1799 | checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" 1800 | 1801 | [[package]] 1802 | name = "windows_x86_64_msvc" 1803 | version = "0.42.1" 1804 | source = "registry+https://github.com/rust-lang/crates.io-index" 1805 | checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" 1806 | 1807 | [[package]] 1808 | name = "yaml-rust" 1809 | version = "0.4.5" 1810 | source = "registry+https://github.com/rust-lang/crates.io-index" 1811 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 1812 | dependencies = [ 1813 | "linked-hash-map", 1814 | ] 1815 | 1816 | [[package]] 1817 | name = "yasna" 1818 | version = "0.5.1" 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" 1820 | checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" 1821 | dependencies = [ 1822 | "time 0.3.20", 1823 | ] 1824 | 1825 | [[package]] 1826 | name = "zeroize" 1827 | version = "1.5.7" 1828 | source = "registry+https://github.com/rust-lang/crates.io-index" 1829 | checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" 1830 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "farm-operator" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1" 8 | axum = "0.6" 9 | axum-server = { version = "0.4", features = ["tls-rustls"] } 10 | k8s-openapi = { version = "0.17", features = ["v1_24"] } 11 | rcgen = "0.10" 12 | tokio = { version = "1", features = ["full"] } 13 | 14 | [workspace] 15 | members = [ 16 | "example/*" 17 | ] 18 | 19 | # Rusttls returns UnsupportedNameType error with certificates issued with CN= 20 | # Unfortunately such issued certificates are used in cloud providers like GCP 21 | # 22 | # This replaces all uses of rustls in dependency tree to use the patched version 23 | [patch.crates-io] 24 | rustls = { git = "https://github.com/metalbear-co/rustls", branch = "feat-ip-address" } 25 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM instrumentisto/rust:nightly as builder 2 | ARG TARGETARCH 3 | 4 | WORKDIR /build 5 | 6 | RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py 7 | RUN python3 -m pip install ziglang 8 | RUN cargo install cargo-zigbuild 9 | 10 | COPY ./platform.sh ./rust-toolchain.toml . 11 | 12 | RUN chmod +x ./platform.sh 13 | RUN ./platform.sh 14 | 15 | RUN rustup component add --toolchain nightly rustfmt 16 | RUN rustup target add --toolchain nightly $(cat /.platform) 17 | RUN apt-get update && apt-get install -y $(cat /.compiler) 18 | 19 | COPY . . 20 | 21 | RUN cargo +nightly zigbuild -p farm-operator --target $(cat /.platform) --release --locked 22 | 23 | RUN cp /build/target/$(cat /.platform)/release/farm-operator /farm-operator 24 | 25 | FROM debian:stable 26 | 27 | RUN apt-get update && apt-get install ca-certificates -y 28 | 29 | COPY --from=builder /farm-operator / 30 | 31 | ENTRYPOINT ["/farm-operator"] 32 | 33 | ARG GITHUB_SHA 34 | LABEL org.opencontainers.image.source="https://github.com/metalbear-co/farm-operator/tree/${GITHUB_SHA:-main}/" 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # farm-operator 2 | 3 | Example operator for Kubernetes in Rust. 4 | 5 | [Tutorial.](https://metalbear.co/blog/writing-a-kubernetes-operator/) 6 | 7 | This repo contians 3 examples and a copy of example 1 in `./src`. 8 | 9 | ```bash 10 | cargo run # ./ 11 | 12 | cargo run -p farm-operator-1 # ./example/step-1 13 | 14 | cargo run -p farm-operator-2 # ./example/step-2 15 | 16 | cargo run -p farm-operator-3 # ./example/step-3 17 | ``` 18 | 19 | * **farm-operator-1** - Minimum Kubernetes APIService 20 | * **farm-operator-2** - Serves Llama resource 21 | * **farm-operator-3** - Serves Llama & FarmPod resource 22 | -------------------------------------------------------------------------------- /app.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | labels: 6 | app: farm-operator 7 | name: farm-operator 8 | spec: 9 | selector: 10 | matchLabels: 11 | app: farm-operator 12 | template: 13 | metadata: 14 | labels: 15 | app: farm-operator 16 | spec: 17 | serviceAccountName: farm-operator 18 | containers: 19 | - image: ghcr.io/metalbear-co/farm-operator:step-1 20 | imagePullPolicy: IfNotPresent 21 | name: farm-operator 22 | ports: 23 | - containerPort: 3000 24 | name: https 25 | protocol: TCP 26 | --- 27 | apiVersion: v1 28 | kind: Service 29 | metadata: 30 | labels: 31 | app: farm-operator 32 | name: farm-operator 33 | spec: 34 | ports: 35 | - name: https 36 | port: 3000 37 | protocol: TCP 38 | targetPort: https 39 | selector: 40 | app: farm-operator 41 | type: ClusterIP 42 | --- 43 | apiVersion: apiregistration.k8s.io/v1 44 | kind: APIService 45 | metadata: 46 | name: v1alpha.farm.example.com 47 | spec: 48 | group: farm.example.com 49 | groupPriorityMinimum: 1000 50 | insecureSkipTLSVerify: true 51 | service: 52 | name: farm-operator 53 | namespace: default 54 | port: 3000 55 | version: v1alpha 56 | versionPriority: 15 57 | --- 58 | apiVersion: v1 59 | kind: ServiceAccount 60 | metadata: 61 | name: farm-operator 62 | labels: 63 | app: farm-operator 64 | --- 65 | apiVersion: rbac.authorization.k8s.io/v1 66 | kind: ClusterRole 67 | metadata: 68 | name: farm-operator 69 | rules: 70 | - apiGroups: 71 | - '' 72 | resources: 73 | - pods 74 | verbs: 75 | - get 76 | - list 77 | - watch 78 | --- 79 | apiVersion: rbac.authorization.k8s.io/v1 80 | kind: ClusterRoleBinding 81 | metadata: 82 | name: farm-operator 83 | roleRef: 84 | apiGroup: rbac.authorization.k8s.io 85 | kind: ClusterRole 86 | name: farm-operator 87 | subjects: 88 | - apiGroup: '' 89 | kind: ServiceAccount 90 | name: farm-operator 91 | namespace: default 92 | -------------------------------------------------------------------------------- /example/step-1/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "farm-operator-1" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1" 8 | axum = "0.6" 9 | axum-server = { version = "0.4", features = ["tls-rustls"] } 10 | k8s-openapi = { version = "0.17", features = ["v1_24"] } 11 | rcgen = "0.10" 12 | tokio = { version = "1", features = ["full"] } 13 | -------------------------------------------------------------------------------- /example/step-1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM instrumentisto/rust:nightly as builder 2 | ARG TARGETARCH 3 | 4 | WORKDIR /build 5 | 6 | RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py 7 | RUN python3 -m pip install ziglang 8 | RUN cargo install cargo-zigbuild 9 | 10 | COPY ./platform.sh ./rust-toolchain.toml . 11 | 12 | RUN chmod +x ./platform.sh 13 | RUN ./platform.sh 14 | 15 | RUN rustup component add --toolchain nightly rustfmt 16 | RUN rustup target add --toolchain nightly $(cat /.platform) 17 | RUN apt-get update && apt-get install -y $(cat /.compiler) 18 | 19 | COPY . . 20 | 21 | RUN cargo +nightly zigbuild -p farm-operator-1 --target $(cat /.platform) --release --locked 22 | 23 | RUN cp /build/target/$(cat /.platform)/release/farm-operator-1 /farm-operator-1 24 | 25 | FROM debian:stable 26 | 27 | RUN apt-get update && apt-get install ca-certificates -y 28 | 29 | COPY --from=builder /farm-operator-1 / 30 | 31 | ENTRYPOINT ["/farm-operator-1"] 32 | 33 | ARG GITHUB_SHA 34 | LABEL org.opencontainers.image.source="https://github.com/metalbear-co/farm-operator/tree/${GITHUB_SHA:-main}/" 35 | -------------------------------------------------------------------------------- /example/step-1/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::net::SocketAddr; 2 | 3 | use axum::{response::IntoResponse, routing::get, Json, Router}; 4 | use axum_server::tls_rustls::RustlsConfig; 5 | use k8s_openapi::apimachinery::pkg::apis::meta::v1::APIResourceList; 6 | 7 | async fn get_api_resources() -> impl IntoResponse { 8 | Json(APIResourceList { 9 | group_version: "farm.example.com/v1alpha".to_string(), 10 | resources: vec![], 11 | }) 12 | } 13 | 14 | #[tokio::main] 15 | async fn main() -> anyhow::Result<()> { 16 | let app = Router::new().route("/apis/farm.example.com/v1alpha", get(get_api_resources)); 17 | 18 | // We generate a self-signed certificate for example purposes in a proper service this should be 19 | // loaded from secret and CA for said cert should be defined in APIService uner `caBundle` 20 | let tls_cert = rcgen::generate_simple_self_signed(vec!["localhost".to_string()])?; 21 | let tls_config = RustlsConfig::from_der( 22 | vec![tls_cert.serialize_der()?], 23 | tls_cert.serialize_private_key_der(), 24 | ) 25 | .await?; 26 | 27 | let addr = SocketAddr::from(([0, 0, 0, 0], 3000)); 28 | 29 | println!("listening on {addr}"); 30 | 31 | axum_server::bind_rustls(addr, tls_config) 32 | .serve(app.into_make_service()) 33 | .await 34 | .map_err(anyhow::Error::from) 35 | } 36 | -------------------------------------------------------------------------------- /example/step-2/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "farm-operator-2" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1" 8 | axum = "0.6" 9 | axum-server = { version = "0.4", features = ["tls-rustls"] } 10 | chrono = "0.4" 11 | k8s-openapi = { version = "0.17", features = ["v1_24"] } 12 | kube = { version = "0.78", default-features = false, features = ["derive"] } 13 | rcgen = "0.10" 14 | serde = "1" 15 | serde_json = "1" 16 | schemars = "0.8" 17 | tokio = { version = "1", features = ["full"] } 18 | -------------------------------------------------------------------------------- /example/step-2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM instrumentisto/rust:nightly as builder 2 | ARG TARGETARCH 3 | 4 | WORKDIR /build 5 | 6 | RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py 7 | RUN python3 -m pip install ziglang 8 | RUN cargo install cargo-zigbuild 9 | 10 | COPY ./platform.sh ./rust-toolchain.toml . 11 | 12 | RUN chmod +x ./platform.sh 13 | RUN ./platform.sh 14 | 15 | RUN rustup component add --toolchain nightly rustfmt 16 | RUN rustup target add --toolchain nightly $(cat /.platform) 17 | RUN apt-get update && apt-get install -y $(cat /.compiler) 18 | 19 | COPY . . 20 | 21 | RUN cargo +nightly zigbuild -p farm-operator-2 --target $(cat /.platform) --release --locked 22 | 23 | RUN cp /build/target/$(cat /.platform)/release/farm-operator-2 /farm-operator-2 24 | 25 | FROM debian:stable 26 | 27 | RUN apt-get update && apt-get install ca-certificates -y 28 | 29 | COPY --from=builder /farm-operator-2 / 30 | 31 | ENTRYPOINT ["/farm-operator-2"] 32 | 33 | ARG GITHUB_SHA 34 | LABEL org.opencontainers.image.source="https://github.com/metalbear-co/farm-operator/tree/${GITHUB_SHA:-main}/" 35 | -------------------------------------------------------------------------------- /example/step-2/src/main.rs: -------------------------------------------------------------------------------- 1 | #![feature(once_cell)] 2 | 3 | use std::net::SocketAddr; 4 | 5 | use axum::{response::IntoResponse, routing::get, Json, Router}; 6 | use axum_server::tls_rustls::RustlsConfig; 7 | use k8s_openapi::apimachinery::pkg::apis::meta::v1::{APIResource, APIResourceList}; 8 | use kube::Resource as _; 9 | 10 | use crate::resources::llama; 11 | 12 | mod resources; 13 | 14 | async fn get_api_resources() -> impl IntoResponse { 15 | Json(APIResourceList { 16 | group_version: "farm.example.com/v1alpha".to_string(), 17 | resources: vec![APIResource { 18 | group: Some(llama::Llama::group(&()).into()), 19 | kind: llama::Llama::kind(&()).into(), 20 | name: llama::Llama::plural(&()).into(), 21 | namespaced: true, 22 | verbs: vec!["list".to_string(), "get".to_string()], 23 | ..Default::default() 24 | }], 25 | }) 26 | } 27 | 28 | #[tokio::main] 29 | async fn main() -> anyhow::Result<()> { 30 | let app = Router::new() 31 | .route("/apis/farm.example.com/v1alpha", get(get_api_resources)) 32 | .route( 33 | "/apis/farm.example.com/v1alpha/namespaces/:namespace/llamas", 34 | get(llama::list_llamas), 35 | ) 36 | .route( 37 | "/apis/farm.example.com/v1alpha/namespaces/:namespace/llamas/:name", 38 | get(llama::get_llama), 39 | ); 40 | 41 | // We generate a self-signed certificate for example purposes in a proper service this should be 42 | // loaded from secret and CA for said cert should be defined in APIService uner `caBundle` 43 | let tls_cert = rcgen::generate_simple_self_signed(vec!["localhost".to_string()])?; 44 | let tls_config = RustlsConfig::from_der( 45 | vec![tls_cert.serialize_der()?], 46 | tls_cert.serialize_private_key_der(), 47 | ) 48 | .await?; 49 | 50 | let addr = SocketAddr::from(([0, 0, 0, 0], 3000)); 51 | 52 | println!("listening on {addr}"); 53 | 54 | axum_server::bind_rustls(addr, tls_config) 55 | .serve(app.into_make_service()) 56 | .await 57 | .map_err(anyhow::Error::from) 58 | } 59 | -------------------------------------------------------------------------------- /example/step-2/src/resources.rs: -------------------------------------------------------------------------------- 1 | pub mod llama; 2 | -------------------------------------------------------------------------------- /example/step-2/src/resources/llama.rs: -------------------------------------------------------------------------------- 1 | use std::{collections::HashMap, sync::LazyLock}; 2 | 3 | use axum::{ 4 | extract::Path, 5 | http::StatusCode, 6 | response::{IntoResponse, Response}, 7 | Json, 8 | }; 9 | use chrono::Utc; 10 | use k8s_openapi::apimachinery::pkg::apis::meta::v1::ListMeta; 11 | use kube::CustomResource; 12 | use schemars::JsonSchema; 13 | use serde::{Deserialize, Serialize}; 14 | 15 | /// For example this contains a nested hashmap containing llamas, this could be an external database 16 | /// or any other source of data for the creation of Llama objects 17 | /// 18 | /// Structrue of the nesting is `{ [namespace]: { [name]: Llama } }` 19 | static STATIC_LLAMAS: LazyLock>> = LazyLock::new(|| { 20 | serde_json::from_value(serde_json::json!({ 21 | "default": { 22 | "dolly": { 23 | "metadata": { 24 | "name": "dolly", 25 | "namespace": "default", 26 | "creationTimestamp": Utc::now(), 27 | }, 28 | "spec": { 29 | "height": 0.5, 30 | "weight": 31.4 31 | } 32 | } 33 | } 34 | })) 35 | .expect("Could not create static lamas") 36 | }); 37 | 38 | #[derive(CustomResource, Clone, Debug, Deserialize, Serialize, JsonSchema)] 39 | #[kube( 40 | group = "farm.example.com", 41 | version = "v1alpha", 42 | kind = "Llama", 43 | namespaced 44 | )] 45 | pub struct LlamaSpec { 46 | pub weight: f32, 47 | pub height: f32, 48 | } 49 | 50 | pub async fn list_llamas(Path(namespace): Path) -> impl IntoResponse { 51 | println!("Listing Llamas in {namespace}"); 52 | 53 | Json(serde_json::json!({ 54 | "apiVersion": "farm.example.com/v1alpha", 55 | "kind": "LamaList", 56 | "items": &STATIC_LLAMAS.get(&namespace).map(|lamas| lamas.values().collect::>()).unwrap_or_default(), 57 | "metadata": ListMeta::default() 58 | })) 59 | } 60 | 61 | pub async fn get_llama(Path((namespace, name)): Path<(String, String)>) -> Response { 62 | println!("Getting Llama {name} in {namespace}"); 63 | 64 | if let Some(lama) = STATIC_LLAMAS 65 | .get(&namespace) 66 | .and_then(|lamas| lamas.get(&name)) 67 | { 68 | Json(lama).into_response() 69 | } else { 70 | StatusCode::NOT_FOUND.into_response() 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /example/step-3/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "farm-operator-3" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1" 8 | axum = "0.6" 9 | axum-server = { version = "0.4", features = ["tls-rustls"] } 10 | chrono = "0.4" 11 | k8s-openapi = { version = "0.17", features = ["v1_24"] } 12 | kube = { version = "0.78", default-features = false, features = ["client", "derive", "rustls-tls"] } 13 | rcgen = "0.10" 14 | serde = "1" 15 | serde_json = "1" 16 | schemars = "0.8" 17 | tokio = { version = "1", features = ["full"] } 18 | -------------------------------------------------------------------------------- /example/step-3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM instrumentisto/rust:nightly as builder 2 | ARG TARGETARCH 3 | 4 | WORKDIR /build 5 | 6 | RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py 7 | RUN python3 -m pip install ziglang 8 | RUN cargo install cargo-zigbuild 9 | 10 | COPY ./platform.sh ./rust-toolchain.toml . 11 | 12 | RUN chmod +x ./platform.sh 13 | RUN ./platform.sh 14 | 15 | RUN rustup component add --toolchain nightly rustfmt 16 | RUN rustup target add --toolchain nightly $(cat /.platform) 17 | RUN apt-get update && apt-get install -y $(cat /.compiler) 18 | 19 | COPY . . 20 | 21 | RUN cargo +nightly zigbuild -p farm-operator-3 --target $(cat /.platform) --release --locked 22 | 23 | RUN cp /build/target/$(cat /.platform)/release/farm-operator-3 /farm-operator-3 24 | 25 | FROM debian:stable 26 | 27 | RUN apt-get update && apt-get install ca-certificates -y 28 | 29 | COPY --from=builder /farm-operator-3 / 30 | 31 | ENTRYPOINT ["/farm-operator-3"] 32 | 33 | ARG GITHUB_SHA 34 | LABEL org.opencontainers.image.source="https://github.com/metalbear-co/farm-operator/tree/${GITHUB_SHA:-main}/" 35 | -------------------------------------------------------------------------------- /example/step-3/src/main.rs: -------------------------------------------------------------------------------- 1 | #![feature(once_cell)] 2 | 3 | use std::net::SocketAddr; 4 | 5 | use axum::{response::IntoResponse, routing::get, Json, Router}; 6 | use axum_server::tls_rustls::RustlsConfig; 7 | use k8s_openapi::apimachinery::pkg::apis::meta::v1::{APIResource, APIResourceList}; 8 | use kube::Resource as _; 9 | 10 | use crate::resources::{farmpod, llama}; 11 | 12 | mod resources; 13 | 14 | async fn get_api_resources() -> impl IntoResponse { 15 | Json(APIResourceList { 16 | group_version: "farm.example.com/v1alpha".to_string(), 17 | resources: vec![ 18 | APIResource { 19 | group: Some(llama::Llama::group(&()).into()), 20 | kind: llama::Llama::kind(&()).into(), 21 | name: llama::Llama::plural(&()).into(), 22 | namespaced: true, 23 | verbs: vec!["list".to_string(), "get".to_string()], 24 | ..Default::default() 25 | }, 26 | APIResource { 27 | group: Some(farmpod::FarmPod::group(&()).into()), 28 | kind: farmpod::FarmPod::kind(&()).into(), 29 | name: farmpod::FarmPod::plural(&()).into(), 30 | namespaced: true, 31 | verbs: vec!["list".to_string()], 32 | ..Default::default() 33 | }, 34 | ], 35 | }) 36 | } 37 | 38 | #[tokio::main] 39 | async fn main() -> anyhow::Result<()> { 40 | let app = Router::new() 41 | .route("/apis/farm.example.com/v1alpha", get(get_api_resources)) 42 | .route( 43 | "/apis/farm.example.com/v1alpha/namespaces/:namespace/llamas", 44 | get(llama::list_llamas), 45 | ) 46 | .route( 47 | "/apis/farm.example.com/v1alpha/namespaces/:namespace/llamas/:name", 48 | get(llama::get_llama), 49 | ) 50 | .route( 51 | "/apis/farm.example.com/v1alpha/namespaces/:namespace/farmpods", 52 | get(farmpod::list_farmpods), 53 | ); 54 | 55 | // We generate a self-signed certificate for example purposes in a proper service this should be 56 | // loaded from secret and CA for said cert should be defined in APIService uner `caBundle` 57 | let tls_cert = rcgen::generate_simple_self_signed(vec!["localhost".to_string()])?; 58 | let tls_config = RustlsConfig::from_der( 59 | vec![tls_cert.serialize_der()?], 60 | tls_cert.serialize_private_key_der(), 61 | ) 62 | .await?; 63 | 64 | let addr = SocketAddr::from(([0, 0, 0, 0], 3000)); 65 | 66 | println!("listening on {addr}"); 67 | 68 | axum_server::bind_rustls(addr, tls_config) 69 | .serve(app.into_make_service()) 70 | .await 71 | .map_err(anyhow::Error::from) 72 | } 73 | -------------------------------------------------------------------------------- /example/step-3/src/resources.rs: -------------------------------------------------------------------------------- 1 | pub mod farmpod; 2 | pub mod llama; 3 | -------------------------------------------------------------------------------- /example/step-3/src/resources/farmpod.rs: -------------------------------------------------------------------------------- 1 | use axum::{extract::Path, response::IntoResponse, Json}; 2 | use k8s_openapi::api::core::v1::Pod; 3 | use kube::{Api, Client, CustomResource}; 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(CustomResource, Clone, Debug, Deserialize, Serialize, JsonSchema)] 8 | #[kube( 9 | group = "farm.example.com", 10 | version = "v1alpha", 11 | kind = "FarmPod", 12 | namespaced 13 | )] 14 | pub struct FarmPodSpec { 15 | pub containers: usize, 16 | } 17 | 18 | pub async fn list_farmpods(Path(namespace): Path) -> impl IntoResponse { 19 | let client = Client::try_default().await.expect("Client Creation Error"); 20 | 21 | let pods = Api::::namespaced(client, &namespace) 22 | .list(&Default::default()) 23 | .await 24 | .expect("Failed to fetch pods"); 25 | 26 | let items = pods 27 | .items 28 | .into_iter() 29 | .map(|value| { 30 | let name = value 31 | .metadata 32 | .name 33 | .map(|name| format!("farm-{name}")) 34 | .unwrap_or_default(); 35 | 36 | FarmPod::new( 37 | &name, 38 | FarmPodSpec { 39 | containers: value 40 | .spec 41 | .map(|spec| spec.containers.len()) 42 | .unwrap_or_default(), 43 | }, 44 | ) 45 | }) 46 | .collect::>(); 47 | 48 | Json(serde_json::json!({ 49 | "apiVersion": "farm.example.com/v1alpha", 50 | "kind": "FarmPodList", 51 | "items": items, 52 | "metadata": pods.metadata 53 | })) 54 | } 55 | -------------------------------------------------------------------------------- /example/step-3/src/resources/llama.rs: -------------------------------------------------------------------------------- 1 | use std::{collections::HashMap, sync::LazyLock}; 2 | 3 | use axum::{ 4 | extract::Path, 5 | http::StatusCode, 6 | response::{IntoResponse, Response}, 7 | Json, 8 | }; 9 | use chrono::Utc; 10 | use k8s_openapi::apimachinery::pkg::apis::meta::v1::ListMeta; 11 | use kube::CustomResource; 12 | use schemars::JsonSchema; 13 | use serde::{Deserialize, Serialize}; 14 | 15 | /// For example this contains a nested hashmap containing llamas, this could be an external database 16 | /// or any other source of data for the creation of Llama objects 17 | /// 18 | /// Structrue of the nesting is `{ [namespace]: { [name]: Llama } }` 19 | static STATIC_LLAMAS: LazyLock>> = LazyLock::new(|| { 20 | serde_json::from_value(serde_json::json!({ 21 | "default": { 22 | "dolly": { 23 | "metadata": { 24 | "name": "dolly", 25 | "namespace": "default", 26 | "creationTimestamp": Utc::now(), 27 | }, 28 | "spec": { 29 | "height": 0.5, 30 | "weight": 31.4 31 | } 32 | } 33 | } 34 | })) 35 | .expect("Could not create static lamas") 36 | }); 37 | 38 | #[derive(CustomResource, Clone, Debug, Deserialize, Serialize, JsonSchema)] 39 | #[kube( 40 | group = "farm.example.com", 41 | version = "v1alpha", 42 | kind = "Llama", 43 | namespaced 44 | )] 45 | pub struct LlamaSpec { 46 | pub weight: f32, 47 | pub height: f32, 48 | } 49 | 50 | pub async fn list_llamas(Path(namespace): Path) -> impl IntoResponse { 51 | println!("Listing Llamas in {namespace}"); 52 | 53 | Json(serde_json::json!({ 54 | "apiVersion": "farm.example.com/v1alpha", 55 | "kind": "LamaList", 56 | "items": &STATIC_LLAMAS.get(&namespace).map(|lamas| lamas.values().collect::>()).unwrap_or_default(), 57 | "metadata": ListMeta::default() 58 | })) 59 | } 60 | 61 | pub async fn get_llama(Path((namespace, name)): Path<(String, String)>) -> Response { 62 | println!("Getting Llama {name} in {namespace}"); 63 | 64 | if let Some(lama) = STATIC_LLAMAS 65 | .get(&namespace) 66 | .and_then(|lamas| lamas.get(&name)) 67 | { 68 | Json(lama).into_response() 69 | } else { 70 | StatusCode::NOT_FOUND.into_response() 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /platform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Used in Docker build to set platform dependent variables 4 | 5 | case $TARGETARCH in 6 | 7 | "amd64") 8 | echo "x86_64-unknown-linux-gnu" > /.platform 9 | echo "" > /.compiler 10 | ;; 11 | "arm64") 12 | echo "aarch64-unknown-linux-gnu" > /.platform 13 | echo "gcc-aarch64-linux-gnu" > /.compiler 14 | ;; 15 | "arm") 16 | echo "armv7-unknown-linux-gnueabihf" > /.platform 17 | echo "gcc-arm-linux-gnueabihf" > /.compiler 18 | ;; 19 | esac 20 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = [ "rustfmt", "clippy" ] 4 | profile = "minimal" 5 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | group_imports = "StdExternalCrate" 3 | comment_width = 100 4 | wrap_comments = true 5 | format_code_in_doc_comments = true 6 | imports_granularity = "Crate" 7 | newline_style = "Unix" 8 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::net::SocketAddr; 2 | 3 | use axum::{response::IntoResponse, routing::get, Json, Router}; 4 | use axum_server::tls_rustls::RustlsConfig; 5 | use k8s_openapi::apimachinery::pkg::apis::meta::v1::APIResourceList; 6 | 7 | async fn get_api_resources() -> impl IntoResponse { 8 | Json(APIResourceList { 9 | group_version: "farm.example.com/v1alpha".to_string(), 10 | resources: vec![], 11 | }) 12 | } 13 | 14 | #[tokio::main] 15 | async fn main() -> anyhow::Result<()> { 16 | let app = Router::new().route("/apis/farm.example.com/v1alpha", get(get_api_resources)); 17 | 18 | // We generate a self-signed certificate for example purposes in a proper service this should be 19 | // loaded from secret and CA for said cert should be defined in APIService uner `caBundle` 20 | let tls_cert = rcgen::generate_simple_self_signed(vec!["localhost".to_string()])?; 21 | let tls_config = RustlsConfig::from_der( 22 | vec![tls_cert.serialize_der()?], 23 | tls_cert.serialize_private_key_der(), 24 | ) 25 | .await?; 26 | 27 | let addr = SocketAddr::from(([0, 0, 0, 0], 3000)); 28 | 29 | println!("listening on {addr}"); 30 | 31 | axum_server::bind_rustls(addr, tls_config) 32 | .serve(app.into_make_service()) 33 | .await 34 | .map_err(anyhow::Error::from) 35 | } 36 | --------------------------------------------------------------------------------