I
I
Ivan Vekov2021-04-16 00:41:15
Continuous Integration
Ivan Vekov, 2021-04-16 00:41:15

How to properly set up CI/CD for a kubernetes/swarm project under PHP?

Good day!

I worked with monoliths for a long time, and suddenly decided to make the first project on microservices. The topic caught on, I made a project for the delivery of products, everything is broken into parts, while it is spinning on minikube (as the circumstances were).

And here I ran into a problem. How is this whole thing in a normal "pipeline"?

Now this trash looks like:
- There are 9 microservices. Each has its own git repository.
- I upload improvements from the development server to github, where I do pull requests, code reviews, etc.
- I pull changes on other server. There I run the assembly of the image for the docker. Push to dockerhub.
- There is a helm on the prod, it knocks on the dockerhub, collects images, launches the application in a minicube.

I feel with all my being that this is some kind of nonsense, and you can’t work like that. But somehow I didn’t find anything useful on the net, at least something that would be clear to me. Hence the question - what are the best practices in distributed application delivery?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2021-04-16
@vekov

I don't see anything "terribly wrong" in your method.

I pull changes on other server. There I run the assembly of the image for the docker. Push to dockerhub.

automatically for relevant branches if tests pass, right?
There is a helm on the prod, it knocks on the dockerhub, collects images, launches the application in a minicube

As far as I understand, this is close to the "GitOps" principle that is fashionable today. Look at ArgoCD or Flux, two popular tools for implementing GitOps.
I worked with ArgoCD according to the following scheme:
1) CI on Jenkins - when committing to the release branch, we automatically run tests, build images and drive them to the repository
2) CD - Jenkins as an orchestrator: deploy job, which updates the name of the image in the repo that it looks at ArgoCD, which does the deployment.
https://www.reddit.com/r/kubernetes/comments/jfces...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question