Last active
January 13, 2025 04:10
-
-
Save si3mshady/43a239d6e175f425813fb6785ad8ecf1 to your computer and use it in GitHub Desktop.
Deploys four Node.js applications (meal-app, drink-app, workout-app, nutrition-app), along with Prometheus and Grafana, on OpenShift. Each app is exposed via internet-accessible routes for monitoring and AI-enhanced functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: List | |
items: | |
# Deployment for meal-app | |
- apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: meal-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: meal-app | |
template: | |
metadata: | |
labels: | |
app: meal-app | |
spec: | |
containers: | |
- name: meal-app | |
image: si3mshady/meal-app:latest | |
ports: | |
- containerPort: 5001 | |
env: | |
- name: API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: openai-api-key | |
key: api_key | |
# Service for meal-app | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: meal-app | |
spec: | |
selector: | |
app: meal-app | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 5001 | |
type: ClusterIP | |
# Route for meal-app | |
- apiVersion: route.openshift.io/v1 | |
kind: Route | |
metadata: | |
name: meal-app | |
spec: | |
to: | |
kind: Service | |
name: meal-app | |
port: | |
targetPort: 80 | |
# Deployment for drink-app | |
- apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: drink-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: drink-app | |
template: | |
metadata: | |
labels: | |
app: drink-app | |
spec: | |
containers: | |
- name: drink-app | |
image: si3mshady/drink-app:latest | |
ports: | |
- containerPort: 5002 | |
env: | |
- name: API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: openai-api-key | |
key: api_key | |
# Service for drink-app | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: drink-app | |
spec: | |
selector: | |
app: drink-app | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 5002 | |
type: ClusterIP | |
# Route for drink-app | |
- apiVersion: route.openshift.io/v1 | |
kind: Route | |
metadata: | |
name: drink-app | |
spec: | |
to: | |
kind: Service | |
name: drink-app | |
port: | |
targetPort: 80 | |
# Deployment for workout-app | |
- apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: workout-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: workout-app | |
template: | |
metadata: | |
labels: | |
app: workout-app | |
spec: | |
containers: | |
- name: workout-app | |
image: si3mshady/workout-app:latest | |
ports: | |
- containerPort: 5003 | |
env: | |
- name: API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: openai-api-key | |
key: api_key | |
# Service for workout-app | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: workout-app | |
spec: | |
selector: | |
app: workout-app | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 5003 | |
type: ClusterIP | |
# Route for workout-app | |
- apiVersion: route.openshift.io/v1 | |
kind: Route | |
metadata: | |
name: workout-app | |
spec: | |
to: | |
kind: Service | |
name: workout-app | |
port: | |
targetPort: 80 | |
# Deployment for nutrition-app | |
- apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nutrition-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: nutrition-app | |
template: | |
metadata: | |
labels: | |
app: nutrition-app | |
spec: | |
containers: | |
- name: nutrition-app | |
image: si3mshady/nutrition-app:latest | |
ports: | |
- containerPort: 5004 | |
env: | |
- name: API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: openai-api-key | |
key: api_key | |
# Service for nutrition-app | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nutrition-app | |
spec: | |
selector: | |
app: nutrition-app | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 5004 | |
type: ClusterIP | |
# Route for nutrition-app | |
- apiVersion: route.openshift.io/v1 | |
kind: Route | |
metadata: | |
name: nutrition-app | |
spec: | |
to: | |
kind: Service | |
name: nutrition-app | |
port: | |
targetPort: 80 | |
# Prometheus Deployment | |
- apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: prometheus | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: prometheus | |
template: | |
metadata: | |
labels: | |
app: prometheus | |
spec: | |
containers: | |
- name: prometheus | |
image: prom/prometheus | |
ports: | |
- containerPort: 9090 | |
volumeMounts: | |
- name: prometheus-config | |
mountPath: /etc/prometheus | |
volumes: | |
- name: prometheus-config | |
configMap: | |
name: prometheus-config | |
# Prometheus Service | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: prometheus | |
spec: | |
selector: | |
app: prometheus | |
ports: | |
- protocol: TCP | |
port: 9090 | |
targetPort: 9090 | |
type: ClusterIP | |
# Grafana Deployment | |
- apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: grafana | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: grafana | |
template: | |
metadata: | |
labels: | |
app: grafana | |
spec: | |
containers: | |
- name: grafana | |
image: grafana/grafana | |
ports: | |
- containerPort: 3000 | |
# Grafana Service | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: grafana | |
spec: | |
selector: | |
app: grafana | |
ports: | |
- protocol: TCP | |
port: 3000 | |
targetPort: 3000 | |
type: ClusterIP | |
# Grafana Route | |
- apiVersion: route.openshift.io/v1 | |
kind: Route | |
metadata: | |
name: grafana | |
spec: | |
to: | |
kind: Service | |
name: grafana | |
port: | |
targetPort: 3000 | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment