Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

# Containerization and Container Orchestration

Project Review Develop a microservices-based weather application. The implementation involves creating two microservices; one for fetching weather data and another for diplaying it. The primary objectives include containerizing these…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Project Review



Develop a microservices-based weather application. The implementation involves creating two microservices; one for fetching weather data and another for diplaying it. The primary objectives include containerizing these microservices using Docker, deploying them to a Kubernetes cluster, and accessing them through Nginx.






Phase 1: Basic Frontend Application with Docker and Kubernetes



Hypothetical Use Case



We are deploying a simple static website (HTML and CSS) for a company's landing page. The goal is to containerize this application using Docker, deploy it to a Kubernetes cluster, and access it through Nginx.






Task




  1. Set up the project




  • Create a new project directory.




'mkdir my-weather-app'






app-dir




  • Inside the directory, create HTML file ('index.html') and a CSS file ('styles.css').




'touch index.html'






index-file




  • Copy and paste the code snippet below.



updated-index-file.JPG)




'touch styles.css'






css-file.JPG




  • Copy and paste the code snippet below.



updated-css-file.JPG




  1. Initialize Git.




  • Initialize a Git repository in the project directory.




'git init'






git-init.JPG




  1. Git Commit.




  • Add and commit the initial code to the Git repository.




'git add .'






add-file.JPG




'git commit -m "my first commit"'






commit-file.JPG




  1. Dockerize the application




  • Create a 'Dockerfile' specfying Nginx as the base image.




'nano Dockerfile'







  • Copy and paste the code snippet below into your Dockerfile.


  • Copy your HTML and CSS files into the Nginx HTML directory.





'# Use official Nginx image
FROM nginx:latest

# Remove default Nginx static files
RUN rm -rf /usr/share/nginx/html/*

# Copy your HTML and CSS files into Nginx directory
COPY index.html /usr/share/nginx/html/
COPY styles.css /usr/share/nginx/html/

# Expose port 80
EXPOSE 80

# Start Nginx (already default, but explicit is fine)
CMD ["nginx", "-g", "daemon off;"]'






dockerfile.JPG




  • Build the Docker Image.




'docker build -t my-weather-app .'






docker-build.JPG




  • Run the container.




'docker run -p 8080:80 my-weather-app'






run-container.JPG




  • Test in browser.




'http://localhost:8080'






test.JPG




  1. Push to Docker Hub




  • Log in to Docker Hub.



docker-hub.JPG




  • Push the Docker image to Docker Hub.


  • Create a repository named "my-weather-app".




create-repo.JPG



repo.JPG




  • Log in to Docker Hub from the terminal.




'docker login'









  • Tag your image correctly.




'docker images'






docker-image.JPG




'docker tag my-weather-app bruyo/my-weather-app:latest'






tag-image.JPG




  • Push the Image.




'docker push bruyo/my-weather-app:latest'






push.JPG




  1. Set up a Kind Kubernetes Cluster




  • Install Kind (Kubernetes in Docker)




'choco install kind'






kind.JPG




  • Verify installation.




'kind version'






version-kind.JPG




  • Ensure that Docker is running, the docker desktop must be running as well.




'docker ps'






docker-run.JPG




  • Create a Kind cluster.


  • Clean old broken cluster





'kind delete cluster'









'docker system prune -f'









'kind create cluster --image kindest/node:v1.29.2'






kind-cluster.JPG




  • Verify Cluster.




'kubectl get nodes'






verify-cluster.JPG




  • Deploy the Application.




'kubectl create deployment nginx --image=nginx'






dp-nginx.JPG




'kubectl get pods'






get-pod.JPG




  • Expose Service.




'kubectl expose deployment nginx --type=NodePort --port=80'






expose-svc.JPG




  • Get Access URL.




'kubectl get svc'






get-service.JPG




'kubectl port-forward service/nginx 8080:80






'



port.JPG




  • Open browser and open application with the link below:




'http://localhost:8080'






test-1.JPG




  1. Deploy to Kubernetes using YAML file




  • Create a Kubernetes Deployment YAML file specifying the image and desired replicas.




'nano nginx-deployment.yaml'







  • Copy and paste the code snippet below into the yaml file.




apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx-deployment
spec:
replicas: 2
selector:
matchLabels:
app: my-weather
template:
metadata:
labels:
app: my-weather
spec:
containers:
- name: nginx-container
image: nginx:latest # Or your Docker Hub image (e.g. bruyo/my-nginx-app:latest)
ports:
- containerPort: 80









  • Apply the deployment to the cluster.




'kubectl apply -f nginx-deployment.yaml'






dp-created.JPG




  • Verify Deployment.




'kubectl get deployments'






apply-clp.JPG




  1. Create a Service (ClusterIP)




  • Create a Kubernetes service YAML file specifying the type as ClusterIP.




'nano nginx-service.yaml'







  • Copy and paste the code snippet below into the yaml file.




apiVersion: v1
kind: Service
metadata:
name: my-nginx-service
spec:
type: ClusterIP
selector:
app: my-weather # MUST match Deployment labels
ports:
- protocol: TCP
port: 80
targetPort: 80







svc-yaml.JPG)




  • Apply the service to the cluster.




'kubectl apply -f nginx-service.yaml'






svc-file.JPG




  • Verify Service.




'kubectl get svc'






verify-svc.JPG




  1. Access the Application




  • Port-forward to the service to access the application locally.



'kubectl port-forward service/my-nginx-service 8080:80'



port-forward.JPG




  • Open your browser and visit the specified port to view the application.




'http://localhost:8080'






test-1.JPG

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten # Containerization and Container Orchestration

Thematisch verwandte Begriffe: Containerization, Container, Orchestration · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-18163 | IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick