forked from yoav-orca/kube-ns-suspender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devspace.yaml
executable file
·65 lines (59 loc) · 2.47 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
version: v1beta11
# `vars` specifies variables which may be used as ${VAR_NAME} in devspace.yaml
vars:
- name: REGISTRY_PASSWORD
password: true
- name: IMAGE
value: ghcr.io/govirtuo/kube-ns-suspender
pullSecrets:
- registry: ghcr.io
username: ${REGISTRY_USERNAME}
password: ${REGISTRY_PASSWORD}
# `deployments` tells DevSpace how to deploy this project
deployments:
- name: kube-ns-suspender
# This deployment uses `kubectl` but you can also define `helm` deployments
kubectl:
manifests:
- manifests/dev/*
# `dev` only applies when you run `devspace dev`
dev:
# `dev.sync` configures a file sync between our Pods in k8s and your local project files
sync:
- imageSelector: ${IMAGE} # Select the Pod that runs our `${IMAGE}`
excludePaths:
- .devcontainer/
- .git/
- .github/
- docs/
- tmp/
- tools/
# `dev.terminal` tells DevSpace to open a terminal as a last step during `devspace dev`
terminal:
imageSelector: ${IMAGE} # Select the Pod that runs our `${IMAGE}`
# With this optional `command` we can tell DevSpace to run a script when opening the terminal
# This is often useful to display help info for new users or perform initial tasks (e.g. installing dependencies)
# DevSpace has generated an example ./devspace_start.sh file in your local project - Feel free to customize it!
command:
- ./devspace_start.sh
# Since our Helm charts and manifests deployments are often optimized for production,
# DevSpace let's you swap out Pods dynamically to get a better dev environment
replacePods:
- imageSelector: ${IMAGE} # Select the Pod that runs our `${IMAGE}`
# Since the `${IMAGE}` used to start our main application pod may be distroless or not have any dev tooling, let's replace it with a dev-optimized image
# DevSpace provides a sample image here but you can use any image for your specific needs
replaceImage: loftsh/go:latest
# Besides replacing the container image, let's also apply some patches to the `spec` of our Pod
# We are overwriting `command` + `args` for the first container in our selected Pod, so it starts with `sleep 9999999`
# Using `sleep 9999999` as PID 1 (instead of the regular ENTRYPOINT), allows you to start the application manually
patches:
- op: replace
path: spec.containers[0].command
value:
- sleep
- op: replace
path: spec.containers[0].args
value:
- "9999999"
- op: remove
path: spec.containers[0].securityContext