-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevspace.yaml
More file actions
executable file
·200 lines (191 loc) · 6.69 KB
/
Copy pathdevspace.yaml
File metadata and controls
executable file
·200 lines (191 loc) · 6.69 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
version: v2beta1
name: devspace-bedrock
localRegistry:
enabled: true
# 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)
code --folder-uri vscode-remote://ssh-remote+${DEVSPACE_NAME}.devspace/app
# 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 describe --always) # 3. Build, tag (git commit hash) and push all images (see "images")
create_deployments --all # 4. Deploy Helm charts and manifests specfied as "deployments"
# 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: ocho/devspace-bedrock
dockerfile: ./Dockerfile
target: runtime
dev:
image: ocho/devspace-bedrock-dev
dockerfile: ./Dockerfile
target: dev
# This is a list of `deployments` that DevSpace can create for this project
deployments:
my-op:
helm:
chart:
name: pxc-operator
repo: https://percona.github.io/percona-helm-charts/
mysql:
helm:
chart:
name: pxc-db
repo: https://percona.github.io/percona-helm-charts
version: 1.12.0
values:
enabled: true
secrets:
passwords:
root: insecure_root_password
allowUnsafeConfigurations: true
finalizers:
- delete-pxc-pods-in-order
- delete-proxysql-pvc
- delete-pxc-pvc
fullnameOverride: $(echo ${DB_HOST:0:21})
pxc:
size: 1
expose:
enabled: false
persistence:
enabled: true
size: 10Gi
disableTLS: true
resources:
limits:
memory: 2G
requests:
memory: 2G
backup:
enabled: false
haproxy:
enabled: true
size: 1
app:
# 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: component-chart
repo: https://charts.devspace.sh
# 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:
containers:
- image: ocho/devspace-bedrock
env:
- name: DB_HOST
value: $(echo ${DB_HOST:0:21}-haproxy)
- name: DB_USER
value : root
- name: DB_PASSWORD
value: ${DB_PASSWORD}
- name: DB_NAME
value: ${DEVSPACE_NAME}
- name: WP_ENV
value: ${WP_ENV}
- name: WP_HOME
value: ${WP_PROTOCOL}://${WP_HOSTNAME}
- name: WP_SITEURL
value: ${WP_PROTOCOL}://${WP_HOSTNAME}/wp
service:
ports:
- port: 8080
containerPort: 8080
ingress:
tls: $([ "$WP_PROTOCOL" = "https" ] && echo "true" || echo "false")
ingressClass: nginx
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
rules:
- host: ${WP_HOSTNAME}
# 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: ocho/devspace-bedrock
command: [ "/bin/bash", "-c", "/usr/local/docker/bin/docker-entrypoint && supervisord -c /usr/local/docker/etc/supervisor.conf"]
# Replace the container image with this dev-optimized image (allows to skip image building during development)
devImage: ocho/devspace-bedrock-dev
patches:
- op: replace
path: spec.containers[0].env
value:
- name: DB_HOST
value: $(echo ${DB_HOST:0:21}-haproxy)
- name: DB_USER
value : root
- name: DB_PASSWORD
value: ${DB_PASSWORD}
- name: DB_NAME
value: ${DEVSPACE_NAME}
- name: WP_ENV
value: development
- name: WP_HOME
value: ${WP_PROTOCOL}://${WP_HOSTNAME}
- name: WP_SITEURL
value: ${WP_PROTOCOL}://${WP_HOSTNAME}/wp
# Sync files between the local filesystem and the development container
sync:
- path: ./:/app
# Open a terminal and use the following command to start it
terminal:
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
localHostname: ${DEVSPACE_NAME}.devspace
# Make the following commands from my local machine available inside the dev container
proxyCommands:
- command: devspace
- command: kubectl
- command: helm
- gitCredentials: true
# ports:
# - port: "8080:8080"
# Use the `commands` section to define repeatable dev workflows for this project
commands:
migrate-db:
command: |-
echo 'This is a cross-platform, shared command that can be used to codify any kind of dev task.'
echo 'Anyone using this project can invoke it via "devspace run migrate-db"'
# Define dependencies to other projects with a devspace.yaml
# dependencies:
# api:
# git: https://... # Git-based dependencies
# tag: v1.0.0
# ui:
# path: ./ui # Path-based dependencies (for monorepos)
vars:
DB_HOST: "${DEVSPACE_NAME}-mysql"
DB_PASSWORD:
question: "Set a database password:"
default: "insecure_root_password"
WP_ENV:
question: "Set WordPress environment mode (WP_ENV):"
default: "development"
options:
- "development"
- "staging"
- "production"
WP_HOSTNAME:
question: "Set your WordPress hostname"
default: "${DEVSPACE_NAME}.test"
WP_PROTOCOL:
question: "Select protocol"
default: "http"
options:
- "http"
- "https"