John Davidson

php - Skaffold update files but the app still use the start Dcoker image

0 comments
Message:


I'm having a local cluster using K3d, inside it, there is an API developed in Lumen (Laravel).


I'm also having Skaffold to work and test my application inside my local cluster. I'm running Skaffold in dev mode, that will allow me to hot load my files in case of changes.


In my case the files did change inside the container but the app still act as the first pod creation. So I can change file any time the app still have the same state always.


Here is my Skaffold deploy config


apiVersion: skaffold/v2beta29
kind: Config
metadata:
name: api
build:
tagPolicy:
sha256: {}
artifacts:
- image: api
docker:
dockerfile: Dockerfile
sync:
manual:
- src: '**/*'
dest: '/var/www/html'
deploy:
kustomize:
paths:
- k8s\dev
profiles:
- name: base
deploy:
kustomize:
paths:
- k8s\base


My Answer:
It seems like the issue might be related to how Skaffold is syncing the files to the container. In your Skaffold deploy config, you have specified the sync manual option, which means that Skaffold will only sync the files when you manually trigger it.

To ensure that Skaffold syncs the files automatically whenever there are changes, you can use the auto option instead of manual. Here is an updated version of your Skaffold deploy config with the auto sync option:

yaml
apiVersion: skaffold/v2beta29
kind: Config
metadata:
name: api
build:
tagPolicy:
sha256: {}
artifacts:
- image: api
docker:
dockerfile: Dockerfile
sync:
auto:
- src: '**/*'
dest: '/var/www/html'
deploy:
kustomize:
paths:
- k8s/dev_profiles
- name: base
deploy:
kustomize:
paths:
- k8s/base


With this configuration, Skaffold will automatically sync the files to the container whenever there are changes, allowing you to see the updated changes in your application.

Rate this post

5 of 5 based on 7125 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us