-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevspace.yaml
139 lines (128 loc) · 5.23 KB
/
devspace.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: v2beta1
name: s3mediastreamer
vars:
GIT_TAG_OR_HASH: $(git describe --always)
# This is a list of `pipelines` that DevSpace can execute (you can define your own)
pipelines:
# This is the pipeline for the main command: `devspace dev` (or `devspace run-pipeline dev`)
dev:
run: |-
run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
ensure_pull_secrets --all # 2. Ensure pull secrets
create_deployments --all # 3. Deploy Helm charts and manifests specfied as "deployments"
start_dev app # 4. Start dev mode "app" (see "dev" section)
# You can run this pipeline via `devspace deploy` (or `devspace run-pipeline deploy`)
deploy:
run: |-
run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
ensure_pull_secrets --all # 2. Ensure pull secrets
build_images --all -t $GIT_TAG_OR_HASH # 3. Build, tag (git commit hash) and push all images (see "images")
create_deployments --all # 4. Deploy Helm charts and manifests specfied as "deployments"
#build_images --all -t $(git describe --always) # 3. Build, tag (git commit hash) and push all images (see "images")
# This is a list of `images` that DevSpace can build for this project
# We recommend to skip image building during development (devspace dev) as much as possible
images:
app:
image: ghcr.io/arturmon/s3stream
dockerfile: ./Dockerfile.dev
tags:
- latest
#image: ghcr.io/arturmon/s3stream
#dockerfile: ./Dockerfile.dev
#tags:
# - ${GIT_TAG_OR_HASH}
# This is a list of `deployments` that DevSpace can create for this project
deployments:
app:
updateImageTags: false
# This deployment uses `helm` but you can also define `kubectl` deployments or kustomizations
helm:
# We are deploying this project with the Helm chart you provided
chart:
name: s3media
version: "0.0.1"
repo: "https://arturmon.github.io/s3MediaStreamer-env"
# Under `values` we can define the values for this Helm chart used during `helm install/upgrade`
# You may also use `valuesFiles` to load values from files, e.g. valuesFiles: ["values.yaml"]
values:
ingress:
annotations:
external-dns.alpha.kubernetes.io/hostname: s3streammedia.lab.me
host: s3streammedia.lab.me
className: nginx
useTls: false
image:
registry: ghcr.io/arturmon/s3stream
tag: latest
pullPolicy: Always
resources:
requests:
cpu: 100m
memory: 50Mi
limits:
cpu: 500m
memory: 512Mi
# This is a list of `dev` containers that are based on the containers created by your deployments
dev:
app:
# Search for the container that runs this image
#imageSelector: ghcr.io/arturmon/s3stream:latest
#imageSelector: localhost:32017/s3stream:${GIT_TAG_OR_HASH}
labelSelector:
app.kubernetes.io/name: s3media
app.kubernetes.io/service: backend
app.kubernetes.io/instance: app
containers:
s3media:
devImage: ghcr.io/loft-sh/devspace-containers/go:1.22-alpine
resources:
requests:
cpu: 0.4
memory: 512Mi
limits:
cpu: 3
memory: 2Gi
# Replace the container image with this dev-optimized image (allows to skip image building during development)
#devImage: ghcr.io/loft-sh/devspace-containers/go:1.21-alpine
# Sync files between the local filesystem and the development container
sync:
- path: ./:/app
excludeFile: .gitignore
downloadExcludePaths:
- "*"
# Open a terminal and use the following command to start it
terminal:
enabled: true
command: ./devspace_start.sh
# Inject a lightweight SSH server into the container (so your IDE can connect to the remote dev env)
ssh:
enabled: true
# Make the following commands from my local machine available inside the dev container
proxyCommands:
- command: devspace
- command: kubectl
- command: helm
- gitCredentials: true
# Forward the following ports to be able access your application via localhost
ports:
- port: "2345"
- port: "10000"
# Use the `commands` section to define repeatable dev workflows for this project
commands:
db-list-table:
command: |-
# Ensure yq is installed: https://github.com/mikefarah/yq
# Extract database details from application.yml
export PGHOST=$(yq e '.storage.host' ./conf/application.yml)
export PGPORT=$(yq e '.storage.port' ./conf/application.yml)
export PGUSER=$(yq e '.storage.username' ./conf/application.yml)
export PGPASSWORD=$(yq e '.storage.password' ./conf/application.yml)
export PGDATABASE=$(yq e '.storage.database' ./conf/application.yml)
# Check if psql is installed
if ! command -v psql &> /dev/null
then
echo "psql could not be found, please install it first."
exit
fi
# List all tables in the database
psql -c "\dt"