Checkout Remote Github Branch
git fetch
git branch --track <name-of-branch> <name-of-remote:eg. origin>/<name-of-branch>
git switch <name-of-branch>
git fetch
git branch --track <name-of-branch> <name-of-remote:eg. origin>/<name-of-branch>
git switch <name-of-branch>
sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --addrepo https://cli.github/packages/rpm/gh-cli.repo
sudo dnf install gh --repo gh-cli
First create a PAT token in GH UI then:
gh auth login
helm repo add azure-marketplace https://marketplace.azurecr.io/helm/v1/repo
helm search repo {filter keyword:optional}
helm install --debug --dry-run my-release ./chart-name
helm install {values .yaml file to use:optional} my-release ./char-name
You can use a .tgz or repository-name/chart-name instead of ./char-name
Example output:
NAME: aks-store-demo
LAST DEPLOYED: Thu Jul 11 19:38:35 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
helm list
helm upgrade my-app ./app-chart
This will only update the delta
helm get manifest aks-store-demo
kubectl get pods -o wide -w
helm delete aks-store-demo
helm install --set replicaCount=5 aks-store-demo ./aks-store-demo
helm dependency build ./app-chart
helm dependency update ./app-chart
helm history my-app
helm rollback my-app 2
Note: the "2" is referring to the revision output from "helm history ..."
Examples of using function, like if statements, in helm charts
The simplest version is if you have everything in a dedicated resource group, in that case, delete the resource group then:
kubectl config delete-context aks-contoso-video
replace aks-contoso-video with whatever your app was called.
Example output:
deleted context aks-contoso-video from /home/user/.kube/config
This example is done using Azure Cloud Shell but you can just use azcli.
# deployment.yaml
apiVersion: apps/v1 # api resource where this workload resides
kind: Deployment # kind of workload we are creating
metadata:
name: contoso-website # name of deployment
spec:
selector: # Define the wrapping strategy
matchLabels: # Match all pods with the defined labels
app: contoso-website # Labels follow the `name: value` template
template: # This is the template of the pod inside the deployment
metadata:
labels: # allows deployments to find and group pods
app: contoso-website
spec:
nodeSelector:
kubernetes.io/os: linux
containers: # this is where we define all containers
- image: mcr.microsoft.com/mslearn/samples/contoso-website
name: contoso-website
resources: # specify minimum and max resources app is allowed to use from cluster
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 250m
memory: 256Mi
ports:
- containerPort: 80 # this container exposes port 80
name: http
kubectl apply -f ./deployment.yaml
Example output: deployment.apps/contoso-website created
kubectl get deploy contoso-website
Example output:
NAME READY UP-TO-DATE AVAILABLE AGE
contoso-website 0/1 1 0 16s
kubectl get pods
Example output:
NAME READY STATUS RESTARTS AGE
contoso-website-7c58c5f699-r79mv 1/1 Running 0 63s