Installation

Installing JobSet to a Kubernetes Cluster

Before you begin

Make sure the following conditions are met:

  • A Kubernetes cluster running one of the last 3 Kubernetes minor versions. Learn how to install the Kubernetes tools.
  • Your cluster has at least 1 node with 2+ CPUs and 512+ MB of memory available for the JobSet controller manager Deployment to run on. NOTE: On some cloud providers, the default node machine type will not have sufficient resources to run the JobSet controller manager and all the required kube-system pods, so you’ll need to use a larger machine type for your nodes.
  • The kubectl command-line tool has communication with your cluster.

Install a released version

To install a released version of JobSet in your cluster, run the following command:

VERSION=v0.13.0
kubectl apply --server-side -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/manifests.yaml

To install a released version of JobSet in your cluster using Helm, run the following command:

VERSION=v0.13.0
helm install jobset oci://registry.k8s.io/jobset/charts/jobset \
  --version "${VERSION#v}" \
  --namespace jobset-system --create-namespace

For more HELM configurations options, follow the instructions.

Optional: Add metrics scraping for prometheus-operator

If you are using prometheus-operator to scrape metrics from jobset components, run the following command:

VERSION=v0.13.0
kubectl apply -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/prometheus.yaml

If you are using kube-prometheus, metrics can be scraped without performing this step.

Customize Your Installation

Use Kustomize to customize the controller Deployment in a released JobSet manifest. This example sets CPU and memory requests and limits for the manager container.

Create a directory and download the manifest for the release you want to install.

VERSION=v0.13.0
mkdir -p kustomize-jobset
cd kustomize-jobset
curl --fail --location --output manifests.yaml \
  "https://github.com/kubernetes-sigs/jobset/releases/download/${VERSION}/manifests.yaml"

Reference the release manifest and the resource patch in kustomization.yaml.

cat > kustomization.yaml <<'EOF'
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - manifests.yaml
patches:
  - path: resource_patch.yaml
EOF

Create resource_patch.yaml with the resource settings for the manager container.

cat > resource_patch.yaml <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jobset-controller-manager
  namespace: jobset-system
spec:
  template:
    spec:
      containers:
        - name: manager
          resources:
            requests:
              cpu: "1"
              memory: "256Mi"
            limits:
              cpu: "4"
              memory: "1Gi"
EOF

Apply the customized manifests from the same directory. Server-side apply avoids storing the JobSet CRD in the last-applied configuration annotation, which has a size limit.

kubectl apply --server-side -k .
kubectl rollout status deployment/jobset-controller-manager --namespace jobset-system --timeout=2m

Uninstall

To uninstall a released version of JobSet from your cluster, run the following command:

VERSION=v0.13.0
kubectl delete -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/manifests.yaml

To uninstall a released version of JobSet from your cluster by Helm, run the following command:

helm uninstall jobset --namespace jobset-system

Install the latest development version

To install the latest development version of JobSet in your cluster, run the following command:

kubectl apply --server-side -k github.com/kubernetes-sigs/jobset/config/default?ref=main

The controller runs in the jobset-system namespace.

Optional: Add metrics scraping for prometheus-operator

If you are using prometheus-operator to scrape metrics from jobset components, you need to run the following command so it can access the metrics:

kubectl apply --server-side -k github.com/kubernetes-sigs/jobset/config/prometheus?ref=main

If you are using kube-prometheus, metrics can be scraped without performing this step.

Uninstall

To uninstall JobSet, run the following command:

kubectl delete -k github.com/kubernetes-sigs/jobset/config/default

Build and install from source

To build JobSet from source and install JobSet in your cluster, run the following commands:

git clone https://github.com/kubernetes-sigs/jobset.git
cd jobset
IMAGE_REGISTRY=<registry>/<project> make image-push deploy

Optional: Add metrics scraping for prometheus-operator

If you are using prometheus-operator to scrape metrics from jobset components, you need to run the following command so it has access to the metrics:

make prometheus

If you are using kube-prometheus, metrics can be scraped without performing this step.

Uninstall

To uninstall JobSet, run the following command:

make undeploy

Optional: Use cert manager instead of internal cert

JobSet webhooks use an internal certificate by default. However, if you wish to use cert-manager (which supports cert rotation), instead of internal cert, you can by performing the following steps.

First, install cert-manager on your cluster by running the following command:

VERSION=v1.11.0
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/$VERSION/cert-manager.yaml

Next, in the file jobset/config/default/kustomization.yaml replace ../components/internalcert with ../components/certmanager then uncomment all the lines beginning with [CERTMANAGER].

Finally, apply these configurations to your cluster with kubectl apply --server-side -k config/default.