Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
devops-intern-training
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Văn Vũ
devops-intern-training
Commits
23bb49cb
Commit
23bb49cb
authored
Feb 29, 2024
by
Nguyễn Văn Vũ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Week9 - Install ingress-nginx and config load-balancing
parent
c0d76144
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
0 deletions
+79
-0
install-ingress-nginx-and-cre-self-cert.sh
week9/install-ingress-nginx-and-cre-self-cert.sh
+22
-0
my-nginx-deploy.yaml
week9/load-balancing/my-nginx-deploy.yaml
+19
-0
my-nginx-ingress.yaml
week9/load-balancing/my-nginx-ingress.yaml
+19
-0
my-nginx-svc.yaml
week9/load-balancing/my-nginx-svc.yaml
+12
-0
patch-configmap.yaml
week9/load-balancing/patch-configmap.yaml
+7
-0
No files found.
week9/install-ingress-nginx-and-cre-self-cert.sh
0 → 100644
View file @
23bb49cb
# Run the kubectl command to create a namespace:
kubectl create namespace ingress-nginx
# Run the command to add the helm repository for the nginx Controller:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
# Run the command to update the helm repository data:
helm repo update
# Run the command to install the Controller:
helm
install
ingress-nginx ingress-nginx/ingress-nginx
\
--namespace
ingress
\
--set
controller.ingressClassResource.name
=
nginx
# Use this command to get the IP address:
watch kubectl
-n
ingress get svc
# Create self-signed certificate
openssl req
-x509
-nodes
-days
365
-newkey
rsa:2048
-keyout
tls.key
-out
tls.crt
-subj
"/CN=172.16.0.16.nip.io"
# Create Kubernetes Secret from certificate
kubectl create secret tls 172.16.0.16.nip.io
--cert
=
tls.crt
--key
=
tls.key
week9/load-balancing/my-nginx-deploy.yaml
0 → 100644
View file @
23bb49cb
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
my-nginx
spec
:
selector
:
matchLabels
:
run
:
my-nginx
replicas
:
2
template
:
metadata
:
labels
:
run
:
my-nginx
spec
:
containers
:
-
name
:
my-nginx
image
:
nginx
ports
:
-
containerPort
:
80
week9/load-balancing/my-nginx-ingress.yaml
0 → 100644
View file @
23bb49cb
apiVersion
:
networking.k8s.io/v1
kind
:
Ingress
metadata
:
name
:
my-nginx
annotations
:
nginx.ingress.kubernetes.io/rewrite-target
:
/
spec
:
ingressClassName
:
nginx
rules
:
-
host
:
172.16.0.16.nip.io
http
:
paths
:
-
path
:
/
pathType
:
Prefix
backend
:
service
:
name
:
my-nginx
port
:
number
:
80
week9/load-balancing/my-nginx-svc.yaml
0 → 100644
View file @
23bb49cb
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
my-nginx
labels
:
run
:
my-nginx
spec
:
ports
:
-
port
:
80
protocol
:
TCP
selector
:
run
:
my-nginx
week9/load-balancing/patch-configmap.yaml
0 → 100644
View file @
23bb49cb
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
name
:
ingress-nginx-controller
namespace
:
ingress-nginx
data
:
use-proxy-protocol
:
"
true"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment