Skip to content

Commit

Permalink
✨ Add the liveness and readiness probe in the manager deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
prafull01 authored and Camila Macedo committed Nov 10, 2020
1 parent 0cebbd6 commit 133e059
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ spec:
name: manager
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /readyz
port: 9443
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 9443
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
Expand Down
1 change: 1 addition & 0 deletions pkg/plugin/v3/scaffolds/internal/templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func main() {
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
HealthProbeBindAddress: ":9443",
LeaderElection: enableLeaderElection,
LeaderElectionID: "{{ hash .Repo }}.{{ .Domain }}",
})
Expand Down
12 changes: 12 additions & 0 deletions testdata/project-v3-addon/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ spec:
name: manager
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /readyz
port: 9443
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 9443
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
Expand Down
11 changes: 6 additions & 5 deletions testdata/project-v3-addon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
LeaderElection: enableLeaderElection,
LeaderElectionID: "52ea9610.testproject.org",
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
HealthProbeBindAddress: ":9443",
LeaderElection: enableLeaderElection,
LeaderElectionID: "52ea9610.testproject.org",
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down
12 changes: 12 additions & 0 deletions testdata/project-v3-multigroup/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ spec:
name: manager
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /readyz
port: 9443
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 9443
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
Expand Down
11 changes: 6 additions & 5 deletions testdata/project-v3-multigroup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
LeaderElection: enableLeaderElection,
LeaderElectionID: "14be1926.testproject.org",
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
HealthProbeBindAddress: ":9443",
LeaderElection: enableLeaderElection,
LeaderElectionID: "14be1926.testproject.org",
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down
12 changes: 12 additions & 0 deletions testdata/project-v3/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ spec:
name: manager
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /readyz
port: 9443
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 9443
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
Expand Down
11 changes: 6 additions & 5 deletions testdata/project-v3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
LeaderElection: enableLeaderElection,
LeaderElectionID: "dd1da13f.testproject.org",
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
HealthProbeBindAddress: ":9443",
LeaderElection: enableLeaderElection,
LeaderElectionID: "dd1da13f.testproject.org",
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit 133e059

Please sign in to comment.