changing and deleting files

This commit is contained in:
jacob
2025-09-30 07:25:08 +02:00
parent 5e454931c8
commit 4102d257d5
22 changed files with 0 additions and 309 deletions

View File

@@ -1,23 +0,0 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@@ -1,24 +0,0 @@
apiVersion: v2
name: webapp
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"

View File

@@ -1,2 +0,0 @@
servicename=$(k get service -l "app={{ .Values.appName }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace <namespace> port-forward service/{{ .Values.appName }} 8888:80

View File

@@ -1,8 +0,0 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ .Values.configmap.name }}
data:
BG_COLOR: '#12181b'
FONT_COLOR: '#FFFFFF'
CUSTOM_HEADER: {{ .Values.configmap.data.CUSTOM_HEADER }}

View File

@@ -1,33 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.appName }}
labels:
app: {{ .Values.appName }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: {{ .Values.appName }}
tier: frontend
template:
metadata:
labels:
app: {{ .Values.appName }}
tier: frontend
spec: # Pod spec
containers:
- name: mycontainer
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
ports:
- containerPort: 80
envFrom:
- configMapRef:
name: {{ .Values.configmap.name }}
resources:
requests:
memory: "16Mi"
cpu: "50m" # 500milliCPUs (1/2 CPU)
limits:
memory: "128Mi"
cpu: "100m"

View File

@@ -1,15 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.appName }}
labels:
app: {{ .Values.appName }}
spec:
ports:
- port: 80
protocol: TCP
name: flask
selector:
app: {{ .Values.appName }}
tier: frontend
type: NodePort

View File

@@ -1,6 +0,0 @@
replicas: 5
configmap:
data:
CUSTOM_HEADER: 'This is on the DEV environment!'

View File

@@ -1,6 +0,0 @@
replicas: 4
configmap:
data:
CUSTOM_HEADER: 'This is on the PROD environment!'

View File

@@ -1,12 +0,0 @@
appName: myhelmapp
port: 80
configmap:
name: myhelmapp-configmap-v1
data:
CUSTOM_HEADER: 'This app was deployed with helm!'
image:
name: devopsjourney1/mywebapp
tag: latest

View File

@@ -1,40 +0,0 @@
# Installation
```
kubectl version
```
*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.
*You could also download/use the 'kutomize' binary seperatly but the cmds are different.
# Viewing Kustomize Configs - (Using kubectl kustomize integration)
```
kubectl kustomize .
kubectl kustomize overlays/dev/
kubectl kustomize overlays/prod/
```
# Applying Kustomize Configs - (Using kubectl kustomize integration)
```
kubectl apply -k .
kubectl apply -k overlays/dev/
kubectl apply -k overlays/prod/
```
Note: if you get field is immutable error, check your configuration and try deleting the resources.
# Creating Namespaces if you dont have them already
```
kubectl create namespace dev; kubectl create namespace prod;
```
# Accessing the application
```
minikube service kustom-mywebapp-v1
minikube service kustom-mywebapp-v1 -n dev
minikube service kustom-mywebapp-v1 -n prod
```
# References:
https://github.com/kubernetes-sigs/kustomize/blob/master/README.md
https://kubectl.docs.kubernetes.io/guides/config_management/offtheshelf/

View File

@@ -1,23 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mywebapp
spec:
replicas: 1
template:
spec: # Pod spec
containers:
- name: mycontainer
image: "devopsjourney1/mywebapp:latest"
ports:
- containerPort: 80
envFrom:
- configMapRef:
name: mykustom-map
resources:
requests:
memory: "16Mi"
cpu: "50m" # 500milliCPUs (1/2 CPU)
limits:
memory: "128Mi"
cpu: "100m"

View File

@@ -1,15 +0,0 @@
resources:
- deployment.yaml
- service.yaml
commonLabels:
app: kustomwebapp
commonAnnotations:
app: mykustom-annontations
namePrefix:
kustom-
nameSuffix:
-v1

View File

@@ -1,10 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: mywebapp
spec:
ports:
- port: 80
protocol: TCP
name: flask
type: NodePort

View File

@@ -1,3 +0,0 @@
BG_COLOR=#000000
FONT_COLOR=#FFFFFF
CUSTOM_HEADER=Welcome to the DEV environment!!

View File

@@ -1,9 +0,0 @@
bases:
- ../../base
patches:
- replicas.yaml
configMapGenerator:
- name: mykustom-map
env: config.properties

View File

@@ -1,6 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mywebapp
spec:
replicas: 3

View File

@@ -1,3 +0,0 @@
BG_COLOR=#12181b
FONT_COLOR=#FFFFFF
CUSTOM_HEADER=Welcome to the Prod environment!!

View File

@@ -1,9 +0,0 @@
bases:
- ../../base
patches:
- replicas.yaml
configMapGenerator:
- name: mykustom-map
env: config.properties

View File

@@ -1,6 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mywebapp
spec:
replicas: 4

View File

@@ -1,56 +0,0 @@
# Follow this video to be a ArgoCD Boss
https://youtu.be/JLrR9RV9AFA
# Installing latest/stable version of ArgoCD
```
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
```
### Forward Ports
```
k get services -n argocd
kubectl port-forward service/argocd-server -n argocd 8080:443
```
### Get Credentials
```
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
```
# Install ArgoCD CLI / Login via CLI
```
brew install argocd
kubectl port-forward svc/argocd-server -n argocd 8080:443
argocd login 127.0.0.1:8080
```
# Creating an Application using ArgoCD CLI:
```
argocd app create webapp-kustom-prod \
--repo https://github.com/devopsjourney1/argo-examples.git \
--path kustom-webapp/overlays/prod --dest-server https://kubernetes.default.svc \
--dest-namespace prod
```
# Command Cheat sheet
```
argocd app create #Create a new Argo CD application.
argocd app list #List all applications in Argo CD.
argocd app logs <appname> #Get the applications log output.
argocd app get <appname> #Get information about an Argo CD application.
argocd app diff <appname> #Compare the applications configuration to its source repository.
argocd app sync <appname> #Synchronize the application with its source repository.
argocd app history <appname> #Get information about an Argo CD application.
argocd app rollback <appname> #Rollback to a previous version
argocd app set <appname> #Set the applications configuration.
argocd app delete <appname> #Delete an Argo CD application.
```