Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
RHCSA, RHCE, AWS, Docker, Kubernetes Training
Sanjeewani95
Updated:
Tuesday at 10:28 AM
🛡️ Kaspersky Antivirus – 1 Year / 1 Device | Rs. 2,300 | Only 9 Left
KSPathirana
Updated:
Monday at 2:42 PM
Ad icon
Professional CCTV Installation Service
Techguy231
Updated:
Sep 6, 2026
Ad icon
I'll research & write an article - Rs. 2000 onwards
Blogerwiki
Updated:
Sep 3, 2026
House Plan
lenura
Updated:
Sep 2, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Software Development
Microservice Issue
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="devops" data-source="post: 30359769" data-attributes="member: 583503"><p>machanla, frontend eka through anith Microservice walata route wenne nahane? meka fix karaganne kohomada?</p><p></p><p></p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p> name: frontend</p><p>spec:</p><p> replicas: 2</p><p> selector:</p><p> matchLabels:</p><p> app: frontend</p><p> template:</p><p> metadata:</p><p> labels:</p><p> app: frontend</p><p> spec:</p><p> containers:</p><p> - name: frontend</p><p> image: devopsuses/frontend:latest</p><p> ports:</p><p> - containerPort: 5000</p><p> env:</p><p> - name: TRENDING_SERVICE_URL</p><p> value: "<a href="http://trending-service:5001/trending" target="_blank">http://trending-service:5001/trending</a>" </p><p>---</p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p> name: frontend</p><p>spec:</p><p> selector:</p><p> app: frontend</p><p> ports:</p><p> - protocol: TCP</p><p> port: 80</p><p> targetPort: 5000</p><p> type: LoadBalancer</p><p>---</p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p> name: trending-service</p><p>spec:</p><p> replicas: 2</p><p> selector:</p><p> matchLabels:</p><p> app: trending-service</p><p> template:</p><p> metadata:</p><p> labels:</p><p> app: trending-service</p><p> spec:</p><p> containers:</p><p> - name: trending-service</p><p> image: devopsuses/trending-service:latest</p><p> ports:</p><p> - containerPort: 5001</p><p>---</p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p> name: trending-service</p><p>spec:</p><p> selector:</p><p> app: trending-service</p><p> ports:</p><p> - protocol: TCP</p><p> port: 5001</p><p> targetPort: 5001</p><p>..................................................</p><p>import os</p><p>from flask import Flask, render_template, redirect</p><p>app = Flask(__name__)</p><p># Access service URLs from environment variables</p><p>TRENDING_SERVICE_URL = os.getenv('TRENDING_SERVICE_URL', '<a href="http://localhost:5001/trending" target="_blank">http://localhost:5001/trending</a>')</p><p>NEW_SERVICE_URL = os.getenv('NEW_SERVICE_URL', '<a href="http://localhost:5002/new" target="_blank">http://localhost:5002/new</a>')</p><p>CATEGORIES_SERVICE_URL = os.getenv('CATEGORIES_SERVICE_URL', '<a href="http://localhost:5003/categories" target="_blank">http://localhost:5003/categories</a>')</p><p>FREEADS_SERVICE_URL = os.getenv('FREEADS_SERVICE_URL', '<a href="http://localhost:5004/freeads" target="_blank">http://localhost:5004/freeads</a>')</p><p>@app.route("/")</p><p>def index():</p><p> return render_template("index.html")</p><p>@app.route("/trending")</p><p>def trending():</p><p> return redirect(TRENDING_SERVICE_URL)</p><p>@app.route("/new")</p><p>def new():</p><p> return redirect(NEW_SERVICE_URL)</p><p>@app.route("/categories")</p><p>def categories():</p><p> return redirect(CATEGORIES_SERVICE_URL)</p><p>@app.route("/freeads")</p><p>def freeads():</p><p> return redirect(FREEADS_SERVICE_URL)</p><p>if __name__ == "__main__":</p><p> app.run(debug=True, host="0.0.0.0", port=5000)</p></blockquote><p></p>
[QUOTE="devops, post: 30359769, member: 583503"] machanla, frontend eka through anith Microservice walata route wenne nahane? meka fix karaganne kohomada? apiVersion: apps/v1 kind: Deployment metadata: name: frontend spec: replicas: 2 selector: matchLabels: app: frontend template: metadata: labels: app: frontend spec: containers: - name: frontend image: devopsuses/frontend:latest ports: - containerPort: 5000 env: - name: TRENDING_SERVICE_URL value: "[URL]http://trending-service:5001/trending[/URL]" --- apiVersion: v1 kind: Service metadata: name: frontend spec: selector: app: frontend ports: - protocol: TCP port: 80 targetPort: 5000 type: LoadBalancer --- apiVersion: apps/v1 kind: Deployment metadata: name: trending-service spec: replicas: 2 selector: matchLabels: app: trending-service template: metadata: labels: app: trending-service spec: containers: - name: trending-service image: devopsuses/trending-service:latest ports: - containerPort: 5001 --- apiVersion: v1 kind: Service metadata: name: trending-service spec: selector: app: trending-service ports: - protocol: TCP port: 5001 targetPort: 5001 .................................................. import os from flask import Flask, render_template, redirect app = Flask(__name__) # Access service URLs from environment variables TRENDING_SERVICE_URL = os.getenv('TRENDING_SERVICE_URL', '[URL]http://localhost:5001/trending[/URL]') NEW_SERVICE_URL = os.getenv('NEW_SERVICE_URL', '[URL]http://localhost:5002/new[/URL]') CATEGORIES_SERVICE_URL = os.getenv('CATEGORIES_SERVICE_URL', '[URL]http://localhost:5003/categories[/URL]') FREEADS_SERVICE_URL = os.getenv('FREEADS_SERVICE_URL', '[URL]http://localhost:5004/freeads[/URL]') @app.route("/") def index(): return render_template("index.html") @app.route("/trending") def trending(): return redirect(TRENDING_SERVICE_URL) @app.route("/new") def new(): return redirect(NEW_SERVICE_URL) @app.route("/categories") def categories(): return redirect(CATEGORIES_SERVICE_URL) @app.route("/freeads") def freeads(): return redirect(FREEADS_SERVICE_URL) if __name__ == "__main__": app.run(debug=True, host="0.0.0.0", port=5000) [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom