Skip to content

Commit

Permalink
Wait for port to be available
Browse files Browse the repository at this point in the history
New changes
  • Loading branch information
ravisantoshgudimetla committed Apr 16, 2019
1 parent 8fb6d93 commit 491758e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
29 changes: 29 additions & 0 deletions bindata/v3.11.0/kube-scheduler/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ metadata:
scheduler: "true"
revision: "REVISION"
spec:
initContainers:
- name: wait-for-host-port
image: ${IMAGE}
imagePullPolicy: IfNotPresent
terminationMessagePolicy: FallbackToLogsOnError
command: ['/usr/bin/timeout', '30', '/bin/bash', '-c']
args:
- |
echo -n "Waiting for port :10259 and :10251 to be released."
while [ -n "$(lsof -ni :10251)" -o -n "$(lsof -i :10251)" ]; do
echo -n "."
sleep 1
done
containers:
- name: scheduler
image: ${IMAGE}
Expand All @@ -23,9 +36,25 @@ spec:
resources:
requests:
memory: 50Mi
ports:
- containerPort: 10259
volumeMounts:
- mountPath: /etc/kubernetes/static-pod-resources
name: resource-dir
livenessProbe:
httpGet:
scheme: HTTP
port: 10251
path: healthz
initialDelaySeconds: 45
timeOutSeconds: 10
readinessProbe:
httpGet:
scheme: HTTP
port: 10251
path: healthz
initialDelaySeconds: 45
timeOutSeconds: 10
hostNetwork: true
priorityClassName: system-node-critical
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ spec:
port: https
scheme: https
tlsConfig:
# TODO where do you mount the service-ca.crt?
insecureSkipVerify: true
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
serverName: metrics.openshift-kube-scheduler-operator.svc
jobLabel: component
namespaceSelector:
Expand Down
3 changes: 3 additions & 0 deletions pkg/operator/target_config_reconciler_v311_00.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ func managePod_v311_00_to_latest(client coreclientv1.ConfigMapsGetter, recorder
required := resourceread.ReadPodV1OrDie(v311_00_assets.MustAsset("v3.11.0/kube-scheduler/pod.yaml"))
if len(imagePullSpec) > 0 {
required.Spec.Containers[0].Image = imagePullSpec
if len(required.Spec.InitContainers) > 0 {
required.Spec.InitContainers[0].Image = imagePullSpec
}
}
// check for feature gates from feature lister.
featureGates := checkForFeatureGates(featureGateLister)
Expand Down
29 changes: 29 additions & 0 deletions pkg/operator/v311_00_assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 491758e

Please sign in to comment.