Skip to content

Useful CLI Commands

Tosin edited this page Apr 28, 2020 · 6 revisions

Azure

List of all az aks commands

Access different clusters using

az aks get-credentials --resource-group RESOURCE_GROUP --name NAME --subscription SUBSCRIPTION --overwrite

Replace the values with the one you can connect to, can be found in Portal Azure Kubernetes Service

Kubernetes

List of all kubectl commands

Reduce typing:

alias k=kubectl

Setting the namespace of the current context

k config set-context --current --namespace=family-public-law

Switching between contexts (clusters)

k config use-context CONTEXT

Inspecting pods

k get pods
k get pods -n admin # can see flux pods
k logs POD_NAME # might require to add -n admin if you want different namespace
k describe pod # pod name
k delete pod
k get hr -n family-public-law # check the status of the helm release

Helm

List of all helm commands

Adding hmctspublic charts repo

helm repo add hmctspublic https://hmctspublic.azurecr.io/helm/v1/repo/

Update dependencies

helm dependency update charts/fpl-case-service

Inspecting Releases

helm {install|upgrade}
helm {uninstall|delete}
helm list
helm install --dry-run --debug fpl-case-service --generate-name -f fpl-case-service/values.yaml > output.yaml

Useful tools

A handy utility to make switching between namespaces and contexts easier

Kubernetes can be set up to be integrated with IntelliJ following this guide