Comments (10)
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:
- k8s + LAMP
- from docker-compose to K8s
from learnk8s.io.
Keyword Research for the main title:
Keyword | Monthly Volume | Diificulty | Organic CTR | Priority | Comments |
---|---|---|---|---|---|
How to deploy Laravel to Kubernetes | no data | 30 | 94% | 30 | We're already on top in SERP |
Introduction to Kubernetes: How to Deploy a Laravel 5 application | no data | 40 | 86% | 27 | |
Getting started with Laravel 5 on Kubernetes | no data | 34 | 100% | 30 | We're already top in SERP |
Deploy a Laravel 5 application to Kubernetes | no data | 37 | 88% | 28 |
from learnk8s.io.
@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.
from learnk8s.io.
@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 .env
file which is ignored by git. I don't really know how to use the docker secrets feature. Do you? Also, I'm not sure this is very important for the purpose of this tutorial. Maybe we can simply add a disclaimer: "In a production scenario, the .env file should be ignored by docker ..."?
from learnk8s.io.
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."
That should be injected as an env variable. Example:
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?
from learnk8s.io.
Regarding apache / php-fpm.. we're using Nginx in Ingress? We could eliminate the php artisan serve
if we didn't need a preview at such an early stage.
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?
from learnk8s.io.
pinging @danielepolencic 😄
from learnk8s.io.
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 RUN php artisan key:generate
from your Dockerfile.
from learnk8s.io.
Thanks, @danielepolencic Sorry for the nginx.. Silly comment!
I will fix the Dockerfile
so that includes a web server with PHP support - probably it will also be Nginx (not apache).
Regarding the app key
, we still need to generate one before we can add it as an env var. This needs to be done inside the container. How would you go about it? We need to have a different and hidden key per install.
from learnk8s.io.
Regarding the app key, we still need to generate one before we can add it as an env var.
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
from learnk8s.io.
Related Issues (20)
- Move from Google Analytics to Google Tag Manaer
- Publish article about running a K8s cluster on Pi devices. HOT 1
- Upgrade Jekyll Target Blank to v1.1 HOT 1
- launch failed: with fix HOT 3
- Install Jekyll Redirect From plugin
- Update config file so that all external links are "nofollow". HOT 1
- Investigate RSS feed HOT 2
- Twitter share button not working (sometimes) HOT 1
- One big cluster vs. many small clusters (blog post idea)
- Kubernetes best practices checklist
- Kubernetes best practices v2 HOT 2
- typo on troubleshooting-kubernetes pdf HOT 1
- Pod Readiness confusion in Troubleshooting Deployments guide HOT 3
- Add canonical tags to all pages
- Use srcset for author avatar
- Proposal: add info about non-namespaced resources in "how many clusters"-article HOT 1
- Add JS validation to mailing list subscription form. HOT 1
- Develop & Design a LearnK8s Newsletter and related tasks HOT 10
- Blog list will not show more than 5 posts and a link to an archive is not present. HOT 2
- Develop and Design the User Picks in newsletter layout and the latest contributors in the newsletter landing page. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learnk8s.io.