Skip to content

Commit

Permalink
refactor: Update Kubernetes introduction and add Secret Management se…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
Pradumnasaraf committed Sep 20, 2024
1 parent 8c32f27 commit 7e2f6a3
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 9 deletions.
7 changes: 7 additions & 0 deletions docs/kubernetes/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,13 @@ kubectl config use-context <context-name>
To make cluster switching easier we can use a tool called `kubectx` and `kubens`.


## Secret Management



## Troubleshoting

A great [blog](https://learnk8s.io/troubleshooting-deployments) on troubleshooting deployments.



Expand Down
9 changes: 0 additions & 9 deletions docs/kubernetes/tools/introduction.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/kubernetes/tools/kustomize/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Kustomize",
"position": 5
}
8 changes: 8 additions & 0 deletions docs/kubernetes/tools/kustomize/app/base/ConfigMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-configmap
namespace: nginx-demo
data:
index.html: |
<h1> Hello World from ConfigMap </h1>
41 changes: 41 additions & 0 deletions docs/kubernetes/tools/kustomize/app/base/Deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx-demo
spec:
selector:
matchLabels:
app: nginx-app
template:
metadata:
labels:
app: nginx-app
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 80
volumeMounts:
- name: html-file
mountPath: /usr/share/nginx/html

volumes:
- name: html-file
configMap:
name: nginx-configmap


7 changes: 7 additions & 0 deletions docs/kubernetes/tools/kustomize/app/base/Kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: nginx-demo
resources:
- Deployment.yaml
- Service.yaml
- ConfigMap.yaml
11 changes: 11 additions & 0 deletions docs/kubernetes/tools/kustomize/app/base/Service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-service-clusterip
namespace: nginx-demo
spec:
selector:
app: nginx-app
ports:
- port: 80
targetPort: 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: nginx-demo
resources:
- ../base
patches:
- path: ./patches/Deployment.yaml
- path: ./patches/ConfigMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-configmap
namespace: nginx-demo
data:
index.html: |
<h1> Hello World from Development </h1>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx-demo
spec:
replicas: 2
template:
spec:
containers:
- name: nginx
image: nginx:1.26.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: nginx-demo
resources:
- ../base
patches:
- path: ./patches/Deployment.yaml
- path: ./patches/ConfigMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-configmap
namespace: nginx-demo
data:
index.html: |
<h1> Hello World from Production </h1>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx-demo
spec:
replicas: 3
template:
spec:
containers:
- name: nginx
image: nginx:1.27.0
14 changes: 14 additions & 0 deletions docs/kubernetes/tools/kustomize/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Kustomize
sidebar_position: 1
---

## Kustomize

Kustomize is a tool that lets you customize raw, template-free YAML files for multiple purposes, leaving the original YAML untouched and usable as is.



Kustomize uses the `apiVersion`, `kind`, `name` and `namespace` to identify resources. It appends a suffix to the name and namespace fields to differentiate between different versions of the same resource.


0 comments on commit 7e2f6a3

Please sign in to comment.