Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Docker compose -> k8s manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentluce committed Jul 12, 2024
1 parent b113058 commit 8690967
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Follow these steps to explore the Kardinal Playground.
1. 🔧 Create the dev flow:
```
kardinal flow create voting-app-ui voting-app-ui-dev -d voting-app-demo/compose.yml
kardinal flow create voting-app-ui voting-app-ui-dev -k voting-app-demo/k8s-manifest.yaml
```
This command sets up a development version of the voting app alongside the production version.
Expand Down Expand Up @@ -95,7 +95,7 @@ Follow these steps to explore the Kardinal Playground.
1. 🧹 Clean up the dev flow:
```
kardinal flow delete -d voting-app-demo/compose.yml
kardinal flow delete -k voting-app-demo/k8s-manifest.yaml
```
This command removes the development version of the app.
Expand Down
4 changes: 2 additions & 2 deletions scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ deploy_kardinal_manager() {
log "👩‍💼 Kardinal Manager Deployed"

# Run the kardinal command for voting app deployment with spinner
run_command_with_spinner kardinal deploy -d voting-app-demo/compose.yml
run_command_with_spinner kardinal deploy -k voting-app-demo/k8s-manifest.yaml

log "🗳️ Initial version of voting app deployed"

Expand Down Expand Up @@ -191,4 +191,4 @@ main() {
exec bash
}

main "$@"
main "$@"
124 changes: 124 additions & 0 deletions voting-app-demo/k8s-manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: redis-prod
version: v1
name: redis-prod
namespace: voting-app
spec:
ports:
- name: tcp-redis
port: 6379
protocol: TCP
targetPort: 6379
selector:
app: redis-prod
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: redis-prod
version: v1
name: redis-prod-v1
namespace: voting-app
spec:
replicas: 1
selector:
matchLabels:
app: redis-prod
version: v1
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
sidecar.istio.io/inject: "true"
labels:
app: redis-prod
version: v1
spec:
containers:
- name: redis-prod
image: bitnami/redis:6.0.8
env:
- name: ALLOW_EMPTY_PASSWORD
value: "yes"
- name: REDIS_PORT_NUMBER
value: "6379"
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 250m
memory: 256Mi
ports:
- containerPort: 6379
name: redis

---
apiVersion: v1
kind: Service
metadata:
labels:
app: voting-app-ui
version: v1
name: voting-app-ui
namespace: voting-app
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: voting-app-ui
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: voting-app-ui
version: v1
name: voting-app-ui-v1
namespace: voting-app
spec:
replicas: 1
selector:
matchLabels:
app: voting-app-ui
version: v1
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
sidecar.istio.io/inject: "true"
labels:
app: voting-app-ui
version: v1
spec:
containers:
- name: voting-app-ui
image: kurtosistech/demo-voting-app-ui
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 250m
memory: 256Mi
ports:
- containerPort: 80
env:
- name: REDIS
value: "redis-prod"

0 comments on commit 8690967

Please sign in to comment.