Skip to content

Commit

Permalink
A beginning of long and great journey
Browse files Browse the repository at this point in the history
  • Loading branch information
seifrajhi committed Jan 20, 2024
1 parent a06cb52 commit 924e92d
Show file tree
Hide file tree
Showing 833 changed files with 143,192 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vault-agent-sidecar/.DS_Store
87 changes: 87 additions & 0 deletions 0-nginx-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
protocol: TCP
#changed https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#example-1
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"

---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
sessionAffinity: None
type: LoadBalancer
---
# Ingress resource example changed

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx-example
rules:
- http:
paths:
- path: /testpath
pathType: Prefix
backend:
service:
name: test
port:
number: 80

#older example

# apiVersion: extensions/v1beta1
# kind: Ingress
# metadata:
# name: nginx
# annotations:
# ingress.kubernetes.io/ssl-redirect: "false"
# spec:
# rules:
# - http:
# paths:
# - path: /
# backend:
# serviceName: nginx
# servicePort: 80

# https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122
# Ingress resource example is replaced with this: https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource
20 changes: 20 additions & 0 deletions 0-nginx-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.12-alpine
command: [ "/bin/sh", "-c", "env" ] #changed so we can run **k logs nginx** to see configmap data.
ports:
- containerPort: 80
envFrom:
- configMapRef:
name: kubernauts
restartPolicy: Never


23 changes: 23 additions & 0 deletions 0-nginx-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
protocol: TCP
35 changes: 35 additions & 0 deletions 0-nginx-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# old code commented out #changed
# apiVersion: extensions/v1beta1
# kind: Ingress
# metadata:
# name: nginx
# annotations:
# ingress.kubernetes.io/ssl-redirect: "false"
# spec:
# rules:
# - http:
# paths:
# - path: /
# backend:
# serviceName: nginx
# servicePort: 80

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
ingressClassName: nginx-example
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80
50 changes: 50 additions & 0 deletions 0-nginx-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
sessionAffinity: None
type: ClusterIP
---
# changed
# apiVersion: extensions/v1beta1
# kind: Ingress
# metadata:
# name: nginx
# annotations:
# ingress.kubernetes.io/ssl-redirect: "false"
# spec:
# rules:
# - http:
# paths:
# - path: /
# backend:
# serviceName: nginx
# servicePort: 80


apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
ingressClassName: nginx-example
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80
17 changes: 17 additions & 0 deletions 1-whoami-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami-deployment
spec:
replicas: 2
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami-container
image: containous/whoami
38 changes: 38 additions & 0 deletions 1-whoami-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# changed
# apiVersion: extensions/v1beta1
# kind: Ingress
# metadata:
# name: whoami-ingress
# annotations:
# kubernetes.io/ingress.class: nginx
# # traefik.ingress.kubernetes.io/rule-type: "PathPrefixStrip"
# spec:
# rules:
# - host: csky08
# http:
# paths:
# - path: /
# backend:
# serviceName: whoami-service
# servicePort: 80


apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whoami-ingress
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
spec:
ingressClassName: nginx
rules:
- host: csky08
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: whoami-service
port:
number: 80
12 changes: 12 additions & 0 deletions 1-whoami-service-ClusterIP.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: whoami-service
spec:
ports:
- name: http
targetPort: 80
port: 80
selector:
app: whoami
type: ClusterIP
13 changes: 13 additions & 0 deletions 1-whoami-service-loadbalancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
#name: whoami-service-loadbalancer #changed
name: whoami-service
spec:
ports:
- name: http
targetPort: 80
port: 80
selector:
app: whoami
type: LoadBalancer
13 changes: 13 additions & 0 deletions 1-whoami-service-nodeport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
#name: whoami-service-nodeport #changed
name: whoami-service
spec:
ports:
- name: http
targetPort: 80
port: 80
selector:
app: whoami
type: NodePort
71 changes: 71 additions & 0 deletions 2-whoareyou-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoareyou-deployment
spec:
replicas: 3
selector:
matchLabels:
app: whoareyou
template:
metadata:
labels:
app: whoareyou
spec:
containers:
- name: whoareyou-container
image: containous/whoami
---
apiVersion: v1
kind: Service
metadata:
name: whoareyou-service
spec:
ports:
- name: http
targetPort: 80
port: 80
selector:
app: whoareyou
---
# changed
# apiVersion: extensions/v1beta1
# kind: Ingress
# metadata:
# name: whoareyou-ingress
# annotations:
# kubernetes.io/ingress.class: "traefik"
# spec:
# rules:
# - host: node2
# http:
# paths:
# - path: /
# backend:
# serviceName: whoareyou-service
# servicePort: http


apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whoareyou-ingress
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
spec:
ingressClassName: traefik
rules:
- host: node2
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: whoareyou-service
port:
number: 80

# Do we need to add IngreessClass https://kubernetes.github.io/ingress-nginx/#i-have-only-one-instance-of-the-ingresss-nginx-controller-in-my-cluster-what-should-i-do


Loading

0 comments on commit 924e92d

Please sign in to comment.