Today is K8S combat - build Django project, the final say. 5 in front of us step by step to build a django project by k8s, by taking into account the actual production environment, we added the initialization function, building automation functions, shared storage, data encryption, monitoring program, log program. From scratch, we go together again. The last to speak, I will bring everyone to use existing resources to achieve the simplest continuous build.
Continuous build
design
gitlab+jenkins+node+dockerfile+k8s
gitlab as a warehouse, provided the trigger Jenkins, node as execution node, dockerfile mirror production, k8s build resources.
Automated build environment
You need to refer to my previous tutorial to build gitlab + jenkins create an automated build environment. Make sure your automated build environment is normal!
Creating gitlab project
Create a project, where the project name is the name of the next task jenkins, by setting a good gitlab address, you can get the code to change gitlab, triggering jenkins task.
Write Jenkins triggered task
A new job, then select a node can be constructed.
I've built before the relevant image, this time without having to rebuild the mirror.
Verification node node
Here there is only a need to ensure that node node java environment, docker environment, k8s environment.
Verify Continuous Integration
By updating gitlab related project code, jenkins detected gitlab code changes, started shell task on selected machine execution, execution of the construction project django.
As can be seen from the console output resources have been created, and then go visit the project address and found items can be a normal visit.
If you want to reproduce these, I recommend "" "" "" "Before you must read." There I learned to code on gitlab is django_deploy.yaml and django_nfs.yaml 3.0 version of django projects. If you need to test django project version 4.0, you need to upload their own resources. Finally, attach the relevant code django_polls engineering structures and the directory gitlab.
K8S combat - build Django project has been successfully completed. Thank you for your support all the way, as an IT person, every day, waiting to learn endless knowledge, I believe Him, and strive to learn there is always a chance to showcase their talents.