-
Notifications
You must be signed in to change notification settings - Fork 31
Improve article on how to deploy Laravel to Kubernetes #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Interesting: https://www.reddit.com/r/kubernetes/comments/8gmh6m/extremely_new_to_kubernetes_want_to_deploy_a_lamp/ We could repurpose this tutorial and make it LAMP: https://medium.com/containerum/how-to-easily-deploy-a-drupal-8-instance-on-kubernetes-b90acc7786b7 Two interesting suggestions:
|
Keyword Research for the main title:
|
@danielepolencic I don't think we should change the title. My main reason is that if I had to google this I would literally type the title exactly: "How to deploy Laravel to Kubernetes". I would not specific the version number "laravel 5". I might search for "Deploy laravel to Kubernetes" instead. The article ranks #1 in google for both "Deploy laravel to Kubernetes" and the existing title. I think it will be detrimental to the existing search ranking if we change it. It is also specific to what users will type if this is the problem they are trying to solve. SERP analysis is from MOZ https://moz.com/explorer/keyword/overview?locale=en-GB&q=deploy%20laravel%20to%20kubernetes and my previous search history and search profile does not affect it. |
@danielepolencic In regards to the comment by sacundim; he's right in the sense that once the key is generated, it will be included in the image. Outside of a Docker setup, this is not an issue because Laravel uses a |
About laravel using serve in production, I think we should use php apache or php fpm as a base container as explained here: https://bitpress.io/simple-approach-using-docker-with-php/ "php artisan key:generate is a command that sets the APP_KEY value in your .env file." apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: app
spec:
replicas: 1
template:
metadata:
labels:
app: app
spec:
containers:
- name: app
image: laravel
env:
- name: APP_KEY
value: "something"
ports:
- containerPort: 8080 In your case, we're not using a yaml file, so I wonder... what happens if we remove that all together? does it still work without a key? |
Regarding apache / php-fpm.. we're using Nginx in Ingress? We could eliminate the Laravel will not work without an APP_KEY variable. Also, I don't know how we can generate it and then add it to the yaml file? |
pinging @danielepolencic 😄 |
The ingress is to route the traffic into the cluster. It's a proxy that distributes the traffic to the internal service in the network. It's not a replacement for the Nginx in front of php-fpm. As for the env variable, you should tweak your command to be: kubectl run laravel-kubernetes-demo \
--image=yourname/laravel-kubernetes-demo \
--port=8181 \
--image-pull-policy=IfNotPresent \
--env=APP_KEY=something And you can remove |
Thanks, @danielepolencic Sorry for the nginx.. Silly comment! Regarding the |
You can generate a random string and base64. It should work. I just checked the code and that's what they do in Laravel too https://github.com/laravel/framework/blob/56a58e0fa3d845bb992d7c64ac9bb6d0c24b745a/src/Illuminate/Foundation/Console/KeyGenerateCommand.php#L59 |
GH-75 Added a note regarding the proposed use of php serve. Renamed the article and assigned a new URL. Old URL should redirect to the new one. Also added the new CTAs.
Article:
We received the following comments:
I think we should fix the content. I'm not sure what's considered to be best practice in the Laravel world.
Also, we should tweak the title again — I know what you're thinking, we went live already.
I think this article is not one-off. It isn't one of those articles that are forgotten after a while (like How to optimise your Docker images).
More and more people will look for this kind of content in the long run.
In that respect, I suggest we rename the article, but still retain most of the original one.
The titles are variations of articles already published for Heroku — i.e. I google "laravel heroku" and generated variations of the titles.
@keithmifsud let me know what you think.
The text was updated successfully, but these errors were encountered: