Skip to content

Commit 78e447f

Browse files
authored
Merge pull request #1 from codezeron/test-dev
feat: add kustom argocd type
2 parents 97df1cf + 9ea72fa commit 78e447f

File tree

10 files changed

+124
-0
lines changed

10 files changed

+124
-0
lines changed

kustom-webapp/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Installation
2+
```
3+
kubectl version
4+
```
5+
*If you have 1.21 or above of kubectl you will have access to kubectl kustomize which is the recommended method. If you aren't on version 1.21 or above, upgrade kubectl.
6+
*You could also download/use the 'kutomize' binary seperatly but the cmds are different.
7+
8+
9+
# Viewing Kustomize Configs - (Using kubectl kustomize integration)
10+
```
11+
kubectl kustomize .
12+
kubectl kustomize overlays/dev/
13+
kubectl kustomize overlays/prod/
14+
```
15+
16+
# Applying Kustomize Configs - (Using kubectl kustomize integration)
17+
```
18+
kubectl apply -k .
19+
kubectl apply -k overlays/dev/
20+
kubectl apply -k overlays/prod/
21+
```
22+
Note: if you get field is immutable error, check your configuration and try deleting the resources.
23+
24+
25+
# Creating Namespaces if you dont have them already
26+
```
27+
kubectl create namespace dev; kubectl create namespace prod;
28+
```
29+
30+
31+
# Accessing the application
32+
```
33+
minikube service kustom-mywebapp-v1
34+
minikube service kustom-mywebapp-v1 -n dev
35+
minikube service kustom-mywebapp-v1 -n prod
36+
```
37+
38+
# References:
39+
https://github.com/kubernetes-sigs/kustomize/blob/master/README.md
40+
https://kubectl.docs.kubernetes.io/guides/config_management/offtheshelf/

kustom-webapp/base/deployment.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: mywebapp
5+
spec:
6+
replicas: 1
7+
template:
8+
spec: # Pod spec
9+
containers:
10+
- name: mycontainer
11+
image: "enzoyh/teste-repo:latest"
12+
ports:
13+
- containerPort: 80
14+
envFrom:
15+
- configMapRef:
16+
name: mykustom-map
17+
resources:
18+
requests:
19+
memory: "16Mi"
20+
cpu: "50m" # 500milliCPUs (1/2 CPU)
21+
limits:
22+
memory: "128Mi"
23+
cpu: "100m"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
resources:
2+
- deployment.yaml
3+
- service.yaml
4+
5+
commonLabels:
6+
app: kustomwebapp
7+
8+
commonAnnotations:
9+
app: mykustom-annontations
10+
11+
namePrefix:
12+
kustom-
13+
14+
nameSuffix:
15+
-v1

kustom-webapp/base/service.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: mywebapp
5+
spec:
6+
ports:
7+
- port: 80
8+
protocol: TCP
9+
name: node
10+
type: NodePort
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BG_COLOR=#000000
2+
FONT_COLOR=#FFFFFF
3+
CUSTOM_HEADER=Welcome to the DEV environment!!
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
bases:
2+
- ../../base
3+
4+
patches:
5+
- replicas.yaml
6+
7+
configMapGenerator:
8+
- name: mykustom-map
9+
env: config.properties
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: mywebapp
5+
spec:
6+
replicas: 3
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BG_COLOR=#12181b
2+
FONT_COLOR=#FFFFFF
3+
CUSTOM_HEADER=Welcome to the Prod environment!!
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
bases:
2+
- ../../base
3+
4+
patches:
5+
- replicas.yaml
6+
7+
configMapGenerator:
8+
- name: mykustom-map
9+
env: config.properties
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: mywebapp
5+
spec:
6+
replicas: 4

0 commit comments

Comments
 (0)