changing and deleting files
This commit is contained in:
@@ -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/
|
|
||||||
@@ -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"
|
|
||||||
@@ -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
|
|
||||||
@@ -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 }}
|
|
||||||
@@ -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"
|
|
||||||
@@ -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
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
replicas: 5
|
|
||||||
|
|
||||||
configmap:
|
|
||||||
data:
|
|
||||||
CUSTOM_HEADER: 'This is on the DEV environment!'
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
replicas: 4
|
|
||||||
|
|
||||||
configmap:
|
|
||||||
data:
|
|
||||||
CUSTOM_HEADER: 'This is on the PROD environment!'
|
|
||||||
@@ -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
|
|
||||||
@@ -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/
|
|
||||||
@@ -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"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
resources:
|
|
||||||
- deployment.yaml
|
|
||||||
- service.yaml
|
|
||||||
|
|
||||||
commonLabels:
|
|
||||||
app: kustomwebapp
|
|
||||||
|
|
||||||
commonAnnotations:
|
|
||||||
app: mykustom-annontations
|
|
||||||
|
|
||||||
namePrefix:
|
|
||||||
kustom-
|
|
||||||
|
|
||||||
nameSuffix:
|
|
||||||
-v1
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: mywebapp
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 80
|
|
||||||
protocol: TCP
|
|
||||||
name: flask
|
|
||||||
type: NodePort
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
BG_COLOR=#000000
|
|
||||||
FONT_COLOR=#FFFFFF
|
|
||||||
CUSTOM_HEADER=Welcome to the DEV environment!!
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
bases:
|
|
||||||
- ../../base
|
|
||||||
|
|
||||||
patches:
|
|
||||||
- replicas.yaml
|
|
||||||
|
|
||||||
configMapGenerator:
|
|
||||||
- name: mykustom-map
|
|
||||||
env: config.properties
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: mywebapp
|
|
||||||
spec:
|
|
||||||
replicas: 3
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
BG_COLOR=#12181b
|
|
||||||
FONT_COLOR=#FFFFFF
|
|
||||||
CUSTOM_HEADER=Welcome to the Prod environment!!
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
bases:
|
|
||||||
- ../../base
|
|
||||||
|
|
||||||
patches:
|
|
||||||
- replicas.yaml
|
|
||||||
|
|
||||||
configMapGenerator:
|
|
||||||
- name: mykustom-map
|
|
||||||
env: config.properties
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: mywebapp
|
|
||||||
spec:
|
|
||||||
replicas: 4
|
|
||||||
56
readme.md
56
readme.md
@@ -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 application’s log output.
|
|
||||||
argocd app get <appname> #Get information about an Argo CD application.
|
|
||||||
argocd app diff <appname> #Compare the application’s 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 application’s configuration.
|
|
||||||
argocd app delete <appname> #Delete an Argo CD application.
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user