-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restart (matching stage/production) fleetshard-operator every 30 min
Signed-off-by: Michael Edgar <medgar@redhat.com>
- Loading branch information
Showing
1 changed file
with
111 additions
and
0 deletions.
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
operators/kas-fleetshard/resources/kas-fleetshard-operator-restarter.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: kas-fleetshard-operator | ||
app.kubernetes.io/name: kas-fleetshard-operator | ||
name: fleetshard-operator-restarter | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app: kas-fleetshard-operator | ||
app.kubernetes.io/name: kas-fleetshard-operator | ||
name: fleetshard-operator-restarter | ||
rules: | ||
- apiGroups: | ||
- apps | ||
- extensions | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- apps | ||
- extensions | ||
resources: | ||
- deployments/scale | ||
verbs: | ||
- patch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
labels: | ||
app: kas-fleetshard-operator | ||
app.kubernetes.io/name: kas-fleetshard-operator | ||
name: fleetshard-operator-restarter | ||
roleRef: | ||
kind: ClusterRole | ||
apiGroup: rbac.authorization.k8s.io | ||
name: fleetshard-operator-restarter | ||
subjects: | ||
- kind: ServiceAccount | ||
name: fleetshard-operator-restarter | ||
--- | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: fleetshard-operator-restarter | ||
labels: | ||
app: kas-fleetshard-operator | ||
app.kubernetes.io/name: kas-fleetshard-operator | ||
data: | ||
restart.sh: | | ||
echo "Scaling down deployments" | ||
oc scale deployment kas-fleetshard-operator --replicas=0 | ||
echo "Scaling up deployments" | ||
oc scale deployment kas-fleetshard-operator --replicas=1 | ||
--- | ||
kind: CronJob | ||
apiVersion: batch/v1beta1 | ||
metadata: | ||
name: fleetshard-operator-restarter | ||
labels: | ||
app: kas-fleetshard-operator | ||
app.kubernetes.io/name: kas-fleetshard-operator | ||
spec: | ||
schedule: '*/30 * * * *' | ||
concurrencyPolicy: Forbid | ||
suspend: false | ||
jobTemplate: | ||
metadata: | ||
creationTimestamp: null | ||
spec: | ||
activeDeadlineSeconds: 600 | ||
backoffLimit: 2 | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
spec: | ||
restartPolicy: Never | ||
serviceAccountName: fleetshard-operator-restarter | ||
serviceAccount: fleetshard-operator-restarter | ||
schedulerName: default-scheduler | ||
terminationGracePeriodSeconds: 30 | ||
securityContext: {} | ||
containers: | ||
- resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
name: oc | ||
command: | ||
- /bin/sh | ||
imagePullPolicy: Always | ||
volumeMounts: | ||
- name: fleetshard-operator-restarter | ||
mountPath: /fleetshard-operator-restarter | ||
terminationMessagePolicy: File | ||
image: quay.io/openshift/origin-cli | ||
args: | ||
- '-c' | ||
- /fleetshard-operator-restarter/restart.sh | ||
volumes: | ||
- name: fleetshard-operator-restarter | ||
configMap: | ||
name: fleetshard-operator-restarter | ||
defaultMode: 511 | ||
dnsPolicy: ClusterFirst | ||
successfulJobsHistoryLimit: 1 | ||
failedJobsHistoryLimit: 1 |