Skip to content

Commit

Permalink
update README.md and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-chenzz committed Apr 24, 2023
1 parent a5e5771 commit 55105b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN go mod download
COPY main.go main.go
COPY api/ api/
COPY pkg/controllers/ pkg/controllers/
COPY pkg/util/cert/ pkg/util/cert/

# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ JobSet: An API for managing a group of Jobs as a unit.
# Installation

### Prerequisites
[cert-manager](https://cert-manager.io/) is required to create certificates for the webhook. To install
it on your cluster, run the following command:
```
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml
```
See more details about [cert-manager installation](https://cert-manager.io/docs/installation/).

To install the JobSet CRD and deploy the controller on the cluster selected on your `~/.kubeconfig`, run the following commands:
```
git clone https://github.com/kubernetes-sigs/jobset.git
Expand Down
15 changes: 6 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package main
import (
"flag"
"os"
"sigs.k8s.io/jobset/pkg/util/cert"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
Expand All @@ -34,6 +33,7 @@ import (

jobset "sigs.k8s.io/jobset/api/v1alpha1"
"sigs.k8s.io/jobset/pkg/controllers"
"sigs.k8s.io/jobset/pkg/util/cert"
//+kubebuilder:scaffold:imports
)

Expand Down Expand Up @@ -96,7 +96,9 @@ func main() {
os.Exit(1)
}

setupIndexes(mgr)
if err := controllers.SetupIndexes(mgr.GetFieldIndexer()); err != nil {
setupLog.Error(err, "unable to setup indexes")
}

go setupControllers(mgr, certsReady)

Expand All @@ -110,7 +112,8 @@ func main() {
}

func setupControllers(mgr ctrl.Manager, certsReady chan struct{}) {
// wait until the cert ready, until then we set up controllers
// The controllers won't work until the webhooks are operating,
// and the webhook won't work until the certs are all in places.
setupLog.Info("waiting for the cert generation to complete")
<-certsReady
setupLog.Info("certs ready")
Expand Down Expand Up @@ -139,9 +142,3 @@ func setupHealthzAndReadyzCheck(mgr ctrl.Manager) {
os.Exit(1)
}
}

func setupIndexes(mgr ctrl.Manager) {
if err := controllers.SetupIndexes(mgr.GetFieldIndexer()); err != nil {
setupLog.Error(err, "unable to setup indexes")
}
}
1 change: 1 addition & 0 deletions test/integration/webhook/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

jobset "sigs.k8s.io/jobset/api/v1alpha1"
"sigs.k8s.io/jobset/pkg/controllers"
)
Expand Down

0 comments on commit 55105b4

Please sign in to comment.