forked from LandmakTechnology/kubernetes-manifests
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 34e64a5
Showing
43 changed files
with
1,401 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Complete Manifest Where in single yml we defined Deployment & Service for SpringApp & PVC(with default StorageClass),ReplicaSet & Service For Mongo. | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: springappdeployment | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: springapp | ||
template: | ||
metadata: | ||
name: springapppod | ||
labels: | ||
app: springapp | ||
spec: | ||
containers: | ||
- name: springappcontainer | ||
image: dockerhandson/spring-boot-mongo | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: MONGO_DB_USERNAME | ||
value: devdb | ||
- name: MONGO_DB_PASSWORD | ||
value: devdb@123 | ||
- name: MONGO_DB_HOSTNAME | ||
value: mongo | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: springapp | ||
spec: | ||
selector: | ||
app: springapp | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
type: LoadBalancer | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: mongodbpvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
--- | ||
apiVersion: apps/v1 | ||
kind: ReplicaSet | ||
metadata: | ||
name: mongodbrs | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mongodb | ||
template: | ||
metadata: | ||
name: mongodbpod | ||
labels: | ||
app: mongodb | ||
spec: | ||
volumes: | ||
- name: pvc | ||
persistentVolumeClaim: | ||
claimName: mongodbpvc | ||
containers: | ||
- name: mongodbcontainer | ||
image: mongo | ||
ports: | ||
- containerPort: 27017 | ||
env: | ||
- name: MONGO_INITDB_ROOT_USERNAME | ||
value: devdb | ||
- name: MONGO_INITDB_ROOT_PASSWORD | ||
value: devdb@123 | ||
volumeMounts: | ||
- name: pvc | ||
mountPath: /data/db | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mongo | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: mongodb | ||
ports: | ||
- port: 27017 | ||
targetPort: 27017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Service Account & Cluster Role Binding | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: k8s-admin | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: eks-admin | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: k8s-admin | ||
namespace: kube-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Deployments Recreate | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
name: nginx-pod | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx-container | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Deployments Rolling Update | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
minReadySeconds: 30 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
name: nginx-pod | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx-container | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Deployments Recreate | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
name: nginx-pod | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx-container | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Deployments Rolling Update | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
minReadySeconds: 30 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
name: nginx-pod | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx-container | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Deployments Rolling Update | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
minReadySeconds: 30 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
name: nginx-pod | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx-container | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: springapp | ||
name: spring-deployment | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spring-app | ||
template: | ||
metadata: | ||
labels: | ||
app: spring-app | ||
spec: | ||
containers: | ||
- image: 172.31.36.229:8083/maven-web-app | ||
name: maven-web-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Daemon Set | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: nginx-ds | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
name: nginx-pod | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginxcontainer | ||
image: nginx | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: hpadeployment | ||
labels: | ||
name: hpadeployment | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
name: hpapod | ||
template: | ||
metadata: | ||
labels: | ||
name: hpapod | ||
spec: | ||
containers: | ||
- name: hpacontainer | ||
image: k8s.gcr.io/hpa-example | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
resources: | ||
requests: | ||
cpu: "100m" | ||
memory: "64Mi" | ||
limits: | ||
cpu: "100m" | ||
memory: "256Mi" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: hpaclusterservice | ||
labels: | ||
name: hpaservice | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
selector: | ||
name: hpapod | ||
type: ClusterIP | ||
--- | ||
apiVersion: autoscaling/v2beta1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: hpadeploymentautoscaler | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: hpadeployment | ||
minReplicas: 2 | ||
maxReplicas: 5 | ||
metrics: | ||
- resource: | ||
name: cpu | ||
targetAverageUtilization: 50 | ||
type: Resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
frontend http_front | ||
bind *:80 | ||
stats uri /haproxy?stats | ||
default_backend http_back | ||
|
||
backend http_back | ||
balance roundrobin | ||
server kube <worker-node1-ip>:80 | ||
server kube <worker-node2-ip>:80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
nginx.ingress.kubernetes.io/rewrite-target: / | ||
name: ingress-resource-2 | ||
spec: | ||
rules: | ||
- host: nginx.example.com | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: nginx-deploy-main | ||
servicePort: 80 | ||
- path: /blue | ||
backend: | ||
serviceName: nginx-deploy-blue | ||
servicePort: 80 | ||
- path: /green | ||
backend: | ||
serviceName: nginx-deploy-green | ||
servicePort: 80 |
Oops, something went wrong.