Gitlab-CI, Review Apps, GKE, the good way?

12/31/2018

I'm starting with Kubernetes (through GKE) and I want to setup Gitlab Review Apps. My use case is quite simple. I've read tons of articles but I could not find clear explanations and best practices on the way to do it. This is the reason why I'm asking here.

Here is what I want to achieve :

  • I have a PHP application, based on Symfony4, versioned on my Gitlab CE instance (self-hosted)
  • I setup my Kubernetes using GKE into Gitlab
  • I want, on each merge request, deploy a new environment on my cluster where I am able to test the application and the new feature (this is the principle of Review Apps).

As far as I read, I've only found simple implementations of it. What I want to do, is deploy to a new LAMP (or LEMP) environment to test my new feature.

The thing that I don't understand is how to proceed to deploy my application. I'm able to write Docker files, store them on mi Gitlab registry, etc ... In my use case, what is the best way to proceed?

  • In my application repository, do I have to store a Docker file which includes all my LAMP configuration (a complete image with all my LAMP setup)? I don't like this approach, it seems strange to me.

  • Do I have to store different custom images (for Apache, MySQL, PHP-FPM, Redis) on my registry and call them and deploy them on GKE during review Stage in my gitlab-cy.yml file?

I'm a little bit stuck on that and I can't share code because it's more about the way to handle everything.

If you have any explanations to help me, it would be great! I can, of course, explain a little bit more if needed!

Thanks a lot for your help.

Happy new year!

-- Ghislain
docker
gitlab
gitlab-ci
kubernetes

0 Answers