Skip to content

Commit

Permalink
🔨
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Luisi committed Apr 4, 2024
1 parent 941086e commit 653607b
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 159 deletions.
41 changes: 0 additions & 41 deletions chart/values-dev.yaml

This file was deleted.

76 changes: 33 additions & 43 deletions devspace.yaml
Original file line number Diff line number Diff line change
@@ -1,73 +1,59 @@
version: v2beta1
name: teste-loki

# This is a list of `pipelines` that DevSpace can execute (you can define your own)
vars:
IMAGE: ghcr.io/devxp-tech/teste-loki #:devspace

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 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"
create_deployments --all
start_dev app
# 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/devxp-tech/teste-loki
image: ${IMAGE}
dockerfile: ./Dockerfile

# This is a list of `deployments` that DevSpace can create for this project
deployments:
app:
# This deployment uses `helm` but you can also define `kubectl` deployments or kustomizations
helm:
releaseName: devxp-app
# We are deploying this project with the Helm chart you provided
chart:
name: devxp-app
version: 0.1.72
repo: https://devxp-tech.github.io/helm-charts
# 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"]
valuesFiles:
- chart/values-dev.yaml
disableDependencyUpdate: null
# This deployment uses `kubectl` but you can also define `helm` deployments
kubectl:
manifests:
- kustomize/overlays/dev/
kustomize: true

# 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/devxp-tech/teste-loki
imageSelector: ${IMAGE}
# 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.18-alpine
logs: {}
command:
- go
- run
- main.go
# Sync files between the local filesystem and the development container
sync:
- path: ./
# 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
# Make the following commands from my local machine available inside the dev container
proxyCommands:
- command: devspace
- command: kubectl
- command: helm
- gitCredentials: true
- path: ./:/app
uploadExcludeFile: .dockerignore
excludePaths:
- "**"
- "!**/*.go"
- "!go.mod"
- "!go.sum"
onUpload:
restartContainer: true
# Forward the following ports to be able access your application via localhost
ports:
- port: "2345"
- port: "8080"
- port: 23450:2345
- port: 8080:8080
# Open the following URLs once they return an HTTP status code other than 502 or 503
open:
- url: http://localhost:8080
Expand All @@ -80,7 +66,7 @@ commands:
echo 'Anyone using this project can invoke it via "devspace run migrate-db"'
test:
command: |-
go test ./...
go test -v ./...
# Define dependencies to other projects with a devspace.yaml
# dependencies:
Expand All @@ -89,3 +75,7 @@ commands:
# tag: v1.0.0
# ui:
# path: ./ui # Path-based dependencies (for monorepos)

dependencies:
homepage:
path: ../homepage
37 changes: 0 additions & 37 deletions devspace_start.sh

This file was deleted.

38 changes: 0 additions & 38 deletions docker-compose-old.yml

This file was deleted.

33 changes: 33 additions & 0 deletions kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: teste-loki
labels:
app: teste-loki
component: web
spec:
selector:
matchLabels:
app: teste-loki
component: web
template:
metadata:
labels:
app: teste-loki
component: web
spec:
# imagePullSecrets:
# - name: ghcr-secret
containers:
- name: teste-loki
image: ghcr.io/devxp-tech/teste-loki #:devspace
# image: diegoluisi/teste-loki
ports:
- containerPort: 8080
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "200m"
memory: "512Mi"
5 changes: 5 additions & 0 deletions kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
15 changes: 15 additions & 0 deletions kustomize/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: teste-loki
labels:
app: teste-loki
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
selector:
app: teste-loki
4 changes: 4 additions & 0 deletions kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base

0 comments on commit 653607b

Please sign in to comment.