-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from ingvagabund/add-support-for-kubemark
Add support for kubemark
- Loading branch information
Showing
42 changed files
with
1,188 additions
and
126 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
42 changes: 42 additions & 0 deletions
42
config/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml
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,42 @@ | ||
kind: CustomResourceDefinition | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
metadata: | ||
name: clusteroperators.config.openshift.io | ||
spec: | ||
additionalPrinterColumns: | ||
- JSONPath: .status.version | ||
description: The version the operator is at. | ||
name: Version | ||
type: string | ||
- JSONPath: .status.conditions[?(@.type=="Available")].status | ||
description: Whether the operator is running and stable. | ||
name: Available | ||
type: string | ||
- JSONPath: .status.conditions[?(@.type=="Progressing")].status | ||
description: Whether the operator is processing changes. | ||
name: Progressing | ||
type: string | ||
- JSONPath: .status.conditions[?(@.type=="Failing")].status | ||
description: Whether the operator is failing changes. | ||
name: Failing | ||
type: string | ||
- JSONPath: .status.conditions[?(@.type=="Available")].lastTransitionTime | ||
description: The time the operator's Available status last changed. | ||
name: Since | ||
type: date | ||
group: config.openshift.io | ||
names: | ||
kind: ClusterOperator | ||
listKind: ClusterOperatorList | ||
plural: clusteroperators | ||
singular: clusteroperator | ||
shortNames: | ||
- co | ||
scope: Cluster | ||
subresources: | ||
status: {} | ||
version: v1 | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true |
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,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cluster-config-v1 | ||
namespace: kube-system | ||
data: | ||
install-config: |- | ||
platform: | ||
kubemark: {} |
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,80 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: deleteunreadynodes | ||
namespace: kube-system | ||
data: | ||
entrypoint.sh: |- | ||
#!/bin/bash | ||
while true; do | ||
echo "Checking NotReady nodes" | ||
for node in $(kubectl get nodes -o json | jq '.items[].metadata.name' --raw-output); do | ||
echo "Checking node $node" | ||
taint=$(kubectl get nodes $node -o json | jq '.spec | select(.taints!=null) | .taints[] | select(.key=="kubemark") | select (.!=null) | select(.value=="true")' | wc -l) | ||
if [ $taint -eq 0 ]; then | ||
echo "Skipping $node, no 'kubemark' taint found" | ||
continue | ||
fi | ||
status=$(kubectl get node $node -o json | jq '.status.conditions[] | select(.type=="Ready") | .status' --raw-output) | ||
if [ $status != "Unknown" ]; then | ||
continue | ||
fi | ||
# Delete node | ||
echo "Deleting node $node" | ||
kubectl delete node $node | ||
done | ||
sleep 10s | ||
done | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: machineapi-kubemark-controllers | ||
namespace: kube-system | ||
labels: | ||
api: machineapi | ||
k8s-app: kubemark | ||
spec: | ||
selector: | ||
matchLabels: | ||
api: machineapi | ||
k8s-app: kubemark | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
api: machineapi | ||
k8s-app: kubemark | ||
spec: | ||
nodeSelector: | ||
node-role.kubernetes.io/master: "" | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- effect: NoExecute | ||
key: node.alpha.kubernetes.io/notReady | ||
operator: Exists | ||
- effect: NoExecute | ||
key: node.alpha.kubernetes.io/unreachable | ||
operator: Exists | ||
containers: | ||
- name: unready-nodes-gb | ||
image: gofed/kubemark-machine-controllers:v1.0 | ||
command: | ||
- /bin/entrypoint.sh | ||
volumeMounts: | ||
- name: deleteunreadynodes | ||
mountPath: /bin/entrypoint.sh | ||
readOnly: true | ||
subPath: entrypoint.sh | ||
volumes: | ||
- name: deleteunreadynodes | ||
configMap: | ||
defaultMode: 0700 | ||
name: deleteunreadynodes |
Oops, something went wrong.