PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, July 13, 2022

[FIXED] How to create Deployment on nginx with custom text in index.html?

 July 13, 2022     configmap, kubernetes, web-deployment     No comments   

Issue

How to create in kubernetes deployment on nginx which will create custom index.html?

is there a way how to create custom index.hmtl with a text: "welcome to the lab"? Or its not possible to do that? Or I should use ConfigmaP? Thank you for your time:


Solution

To create custom index.hmtl with a text "welcome to the lab", you need to build your own docker image and then by using that image you can create the kubernetes deployment.

containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80

here, in the manifest you are giving the specification of the container, where you used nginx image and you can not change the image as you have no access of the dockerfile by which that image were created.

In your deployment manifest you give two specification, in outer specification you give the replicas which means how many replica of your application need to run. Another specification is the container specification, here you give your application image which can be your own image or others image like nginx, now the when the deployment create successfully and also the pods then you will only see the things that was defined in your used application image. So, you if you want different things than you need different image containing your desired outputs.



Answered By - Sahadat Hossain
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing