This article covers some useful commands for FME Flow (formerly FME Server) and Kubernetes.
These commands will predominantly be for Helm or Kubectl.
Helm is a package manager for Kubernetes which helps you define, install, upgrade and manage Kubernetes applications. You can find download instructions for Helm here.
Kubectl is a command line tool that lets you control Kubernetes clusters. Kubectl needs to be configured to communicate with your cluster.
The kubectl commands reference is a useful resource.
The FME Flow Administrator's Guide has documentation for Deploying FME Flow with Kubernetes .
The commands are grouped into the following sections:
Helm and FME Flow
Namespaces
Services and Pods
Deployments
Troubleshooting
Helm and FME Flow
Return the version of Helm:
helm version
List all of the chart repositories add to your Helm:
helm repo list
Add a repository to your Helm:
helm repo add <repository> helm repo add safesoftware https://safesoftware.github.io/helm-charts/
List all charts in a repository. This is useful to find the chart name for installing FME Flow:
helm search repo "safesoftware"
Install FME Flow. Deployment parameters may be referenced in a values.yaml file or appending to the install command:
helm install <-f values.yaml> fmeflow safesoftware/fmeflow-<version> --namespace <namespace> <parameters>
Uninstall FME Flow:
helm uninstall fmeflow -n <namespace>
Namespaces
Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. FME Flow will likely get installed into an 'fmeflow' namespace.
kubectl get namespaces
When interacting with Kubernetes resources you will need to specify the resource.
kubectl [action] [resource] --all-namespaces kubectl [action] [resource] -n <namespace>
Services and Pods
A Service is an abstract way to expose an application running on a set of pods as a network service. With FME Flow, to install, the details of the NGNIX service are needed for install (external IP/DNS).
List services:
kubectl get services --namespace <namespace>
Find the external IP of the ingress-nginx-controller:
kubectl get services -n ingress-nginx
A pod is a group of one or more containers, with shared storage and network resources.
You can view all of the pods within a namespace:
kubectl get pods -n <namespace>
If you want to watch the status of pods after a change, add the --watch flag:
kubectl get pods -n <namespace> --watch
Storage
With FME and Kubernetes there are a few storage types that you may need to interact with. These are storage classes (sc), persistent volumes (pv) and persistent volume claims (pvc).
You can manage these using kubectl:
kubectl get <resource type> -n <namespace>
Example - list all storage classes within the fmeflow namespace:
kubectl get sc -n fmeflow
Interact with storage resources:
kubectl edit | describe | delete <resource type> <resource-name> -n <namespace>
An example describing the azurefiles-fmeflow storage class:
kubectl describe sc azurefiles-fmeflow
If you need to delete storage resources, you can use kubectl. This deletes the fmeflow-data persistent volume and persistent volume claim:
delete pvc,pv fmeflow-data -n fmeflow
Deployments
In Helm, a release is an instance of a chart running in a Kubernetes cluster. Every time a deployment is installed or upgraded, a new release is created.
Get a list of releases:
helm list -n <namespace>
Get the status of a release, including current status and revision
helm status <release> -n <namespace>
Get the history of a release:
helm history <release-name> -n <namespace>
Rollback a release to a previous revision:
helm rollback <release-name> <revision> <flags>
Troubleshooting
It would be beneficial to review the official Kubernetes documentation for troubleshooting clusters.
Seeing the logs from a pod can be useful to look for errors or warnings. Printing the logs for a pod will include all of the logs for all of the FME Flow processes within that pod/container.
Print the logs for a container in a pod or a specified resource:
kubectl logs <pod> -n <namespace>
Print the logs for a specific container:
kubectl logs <pod> <container> -n <namespace> kubectl logs core-0 dbinit -n fmeflow
Show details of a specific resource or group of resources. This can be useful to show events on a resource, which might explain when a resource is failing to deploy correctly:
kubectl describe <resource> <name> -n <namespace>
You can list all not-normal events for everything within a namespace (this should show any warnings):
kubectl get events --sort-by=.metadata.creationTimestamp -n <namespace> --field-selector type!=Normal
Watch as the state of pods or nodes changes. Add the --watch flag to the end of a command. This is useful when watching the state of pods or nodes change.
kubectl get pods -n fmeflow --watch kubectl get nodes --watch
Change the output format or view more information about a resource with the output flag:
kubectl get pods -n fmeflow -o wide
Get a shell to a running container. This is useful if you need to run commands inside a container:
kubectl -n <namespace> exec -it <pod> -- bash
An example opening a shell to the core container within the core pod.
kubectl -n fmeflow exec -it core-0 -c core -- /bin/bash
Comments
0 comments
Please sign in to leave a comment.