Skip to content

Instantly share code, notes, and snippets.

@yifan-gu
Last active February 21, 2017 21:19
Show Gist options
  • Save yifan-gu/0ae4d5654ffd6e6e801cc2d5362a7ff9 to your computer and use it in GitHub Desktop.
Save yifan-gu/0ae4d5654ffd6e6e801cc2d5362a7ff9 to your computer and use it in GitHub Desktop.
AppVersion examples with taskStatuses and failureReason

Delete the kvo / tco deployment so they don't mess with the TPRs created below.

kubectl delete deployment tectonic-channel-operator -n tectonic-system
kubectl delete deployment kube-version-operator -n tectonic-system

Replace/create the TPR for kvo and tco

cat app-version-kubernetes.json
{
  "apiVersion": "coreos.com/v1",
  "kind": "AppVersion",
  "metadata": {
    "name": "kubernetes",
    "namespace": "tectonic-system",
    "labels": {
      "managed-by-channel-operator": "true"
    }
  },
  "spec": {
    "desiredVersion": "1.5.2+coreos.0",
    "paused": false
  },
  "status": {
    "currentVersion": "1.4.7+coreos.0",
    "paused": false,
    "failureStatus": {
      "type": "Update cannot procceed",
      "reason": "Operator failed to upgrade Kubelet"
    },
    "taskStatuses": [
      {
        "name": "Update api-server",
        "state": "Completed",
        "reason": ""
      },
      { 
        "name": "Update kube-dns",
        "state": "Running",
        "reason": ""
      },
      {
        "name": "Update kube-proxy",
        "state": "BackOff",
        "reason": "Failed to update daemonsets, retrying"
      },
      {
        "name": "Update kubelet",
        "state": "Failed",
        "reason": "Failed to pull kubelet image"
      }
    ]
  }
}

kubectl replace -f app-version-kubernetes.json

cat app-version-tectonic-cluster.json 
{
  "apiVersion": "coreos.com/v1",
  "kind": "AppVersion",
  "metadata": {
    "name": "tectonic-cluster",
    "namespace": "tectonic-system",
    "labels": {
      "managed-by-channel-operator": "true"
    }
  },
  "spec": {
    "desiredVersion": "1.5.2-tectonic.1",
    "paused": false
  },
  "status": {
    "currentVersion": "1.5.1-tectonic.1",
    "paused": false,
    "failureStatus": {
      "type": "Update cannot procceed",
      "reason": "Operator failed to upgrade Kubelet"
    },
    "taskStatuses": [
      {
        "name": "Update deployment kube-version-operator",
        "state": "Completed",
        "reason": ""
      },
      { 
        "name": "Update AppVersion kubernetes",
        "state": "Failed",
        "reason": "Operator failed to upgrade Kubelet"
      }
    ]
  }
}

kubectl replace -f app-version-tectonic-cluster.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment