{"id":23567289,"url":"https://github.com/paraskuk/Fibonacci-Rust-Kubernetes-Deployment-Command-Line-POC-App","last_synced_at":"2025-08-29T16:32:20.659Z","repository":{"id":269338837,"uuid":"907094527","full_name":"paraskuk/Fibonacci-Implementations-Rust","owner":"paraskuk","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-22T21:53:25.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-22T22:25:39.321Z","etag":null,"topics":["rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paraskuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-22T19:45:04.000Z","updated_at":"2024-12-22T21:53:27.000Z","dependencies_parsed_at":"2024-12-22T22:25:43.118Z","dependency_job_id":"359afc00-468c-4eab-bb2c-4927921ce997","html_url":"https://github.com/paraskuk/Fibonacci-Implementations-Rust","commit_stats":null,"previous_names":["paraskuk/slow-fibonacci-rust","paraskuk/fibonacci-implementations-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraskuk%2FFibonacci-Implementations-Rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraskuk%2FFibonacci-Implementations-Rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraskuk%2FFibonacci-Implementations-Rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraskuk%2FFibonacci-Implementations-Rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paraskuk","download_url":"https://codeload.github.com/paraskuk/Fibonacci-Implementations-Rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231395785,"owners_count":18370468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust"],"created_at":"2024-12-26T18:31:17.755Z","updated_at":"2025-08-29T16:32:20.648Z","avatar_url":"https://github.com/paraskuk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Rust](https://github.com/paraskuk/Fibonacci-Rust-Kubernetes-Deployment-Command-Line-POC-App/actions/workflows/rust.yml/badge.svg)](https://github.com/paraskuk/Fibonacci-Rust-Kubernetes-Deployment-Command-Line-POC-App/actions/workflows/rust.yml)\n![Rust_programming_language_black_logo svg](https://github.com/user-attachments/assets/ab07a1c3-fdf7-4a45-be0e-977184cb8914)\n\n# Rust App that calculates the Fibonacci sequence and deploys it to Kubernetes\n\n\nThis project provides various implementations of the Fibonacci sequence in Rust, including recursive, memoized, iterative, and dynamic programming approaches. \nIt also includes a Kubernetes deployment using Helm charts using minikube.\n\n\u003e [!TIP] \n\u003e The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1.\n\n\u003e [!TIP]\n\u003e The sequence starts: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...\n\n\u003e [!TIP]\n\u003e The Fibonacci sequence is defined by the recurrence relation: F(n) = F(n-1) + F(n-2) with base cases F(0) = 0 and F(1) = 1.\n\n\u003e [!TIP]\n\u003e The Fibonacci sequence grows exponentially, so the recursive implementation is not efficient for large values of n.\n\n\u003e [!TIP]\n\u003e The iterative and dynamic programming implementations are more efficient for large values of n.\n\n\u003e [!TIP]\n\u003e The memoized recursive implementation is more efficient than the simple recursive implementation because it avoids redundant calculations.\n\n\u003e [!TIP]\n\u003e The pattern matching implementation is similar to the simple recursive implementation but uses pattern matching instead of if-else statements.\n\n\u003e [!TIP]\n\u003e The dynamic programming implementation uses an array to store the Fibonacci numbers and avoids redundant calculations.\n\n\u003e [!TIP]\n\u003e The following implementations are provided:\n\n- `fibonacci`: A simple recursive implementation.\n- `fibonacci_match`: A recursive implementation using pattern matching.\n- `fibonacci_dp`: An implementation using dynamic programming.\n- `fibonacci_memo`: A memoized recursive implementation.\n- `fibonacci_iterative`: An iterative implementation.\n\n\n## Prerequisites\n\u003e [!IMPORTANT]\n\u003e Before you begin, ensure you have the following tools installed:\n\u003e 1. **Rust \u0026 Cargo** (for local builds/verification, optional if you only build in Docker).\n\u003e 2. **Docker** (to build and push container images).\n\u003e 3. **Helm** (to manage Kubernetes deployments).\n\u003e 4. **Minikube or a Kubernetes Cluster** (for testing).\n\u003e 5. **Docker Hub Account** (to push container images).\n\n---\n\n## 1. Building the Rust Application Locally (Optional)\n\nYou can verify that the application compiles and runs locally:\n\u003e [!TIP]\n\u003e You can build the Rust application using Cargo:\n```sh\ncargo run --package fibonacci --bin fibonacci -- 10\n\n# Output:\nTime taken by fibonacci_match: ...\nTime taken by fibonacci_memo: ...\nTime taken by fibonacci_iterative: ...\n```\n\n## 2. Building the Docker Image\n\u003e [!TIP]\n\u003e You can build the Docker image using the provided Dockerfile\n\u003e Tag the image after its building\n\u003e Using your username login to Docker Hub and push the image to Docker Hub.\n```sh\ndocker build -t fibonacci_rust:latest .\ndocker tag fibonacci_rust:latest ${DOCKER_USERNAME}/fibonacci_rust:latest\ndocker login --username ${DOCKER_USERNAME}\ndocker push ${DOCKER_USERNAME}/fibonacci_rust:latest\ndocker tag fibonacci_rust:latest ${DOCKER_USERNAME}/fibonacci_rust:v2\ndocker push ${DOCKER_USERNAME}/fibonacci_rust:v2\n```\n\n## 3. Deploying the Application to Kubernetes\n### 3.0 Deploy using Manifests\n\u003e [!TIP]\n\u003e You can deploy the application to Kubernetes using the provided deployment.yaml file:\n```sh\nkubectl apply -f deployment.yaml\n```\n\n### 3.1 Or Deploy via Helm Charts - Helm Chart Overview\n\u003e [!TIP]\n\u003e This repository includes a simple Helm chart (in the fibonacci/ directory, for example) that deploys the fibonacci container into Kubernetes. The key files are:\n\n* Chart.yaml – Chart metadata.\n* values.yaml – Default values (e.g., image, replicas, etc.).\n* templates/ – Contains Kubernetes manifests (Deployment, Service, etc.).\n\n### 3.2 Creating Secret\n\u003e [!TIP]\n\u003e Create a secret to pull the image from Docker Hub:\n```sh\nkubectl create secret docker-registry regcred \\\n--docker-server=docker.io \\\n--docker-username=myusername \\\n--docker-password=MY_PERSONAL_ACCESS_TOKEN \\\n--docker-email=myemail@example.com\n```\n\nThen reference it in your values.yaml or deployment.yaml:\n\u003e [!TIP]\n\u003e Add the following to your deployment.yaml file:\n```yaml\nimagePullSecrets:\n- name: regcred\n```\n\n### 3.3 Install Helm Chart\n\u003e [!TIP]\n\u003e Navigate to the fibonacci/ directory and install the Helm chart for the first time:\n```sh\nhelm install fibonacci .\n```\n\u003e [!TIP]\n\u003e If you already have the chart installed and want to upgrade it:\n\n```sh\nhelm upgrade --install fibonacci .\n```\n\u003e [!TIP]\n\u003e Check the deployment status:\n\n```sh\nhelm status fibonacci\nkubectl get pods\n```\n### 3.4 Accessing the Application\nThis program just prints to the STDOUT\n\u003e [!TIP]\n\u003e You can access the logs of the fibonacci-deployment pod to see the output.\n\n```sh\nkubectl logs deployment/fibonacci-deployment\n```\n\n### 4 .Cleaning Up\n\u003e [!WARNING]\n\u003e This will uninstall helm release.\n\n```sh\nhelm uninstall fibonacci\n```\n\n\u003e [!CAUTION]\n\u003e This will delete the deployment and service and the minikube cluster.\n\n```sh\nkubectl delete secret regcred\nminkube delete\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaskuk%2FFibonacci-Rust-Kubernetes-Deployment-Command-Line-POC-App","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparaskuk%2FFibonacci-Rust-Kubernetes-Deployment-Command-Line-POC-App","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaskuk%2FFibonacci-Rust-Kubernetes-Deployment-Command-Line-POC-App/lists"}