1"use strict";(self.webpackChunktigera_docs=self.webpackChunktigera_docs||[]).push([["3726"],{62855:function(e,n,t){t.r(n),t.d(n,{default:()=>u,frontMatter:()=>r,metadata:()=>i,assets:()=>l,toc:()=>c,contentTitle:()=>s});var i=JSON.parse('{"id":"operations/operator-migration","title":"Migrate Calico to an operator-managed installation","description":"Migrate Calico from manifest-based to operator-managed installation","source":"@site/calico_versioned_docs/version-3.27/operations/operator-migration.mdx","sourceDirName":"operations","slug":"/operations/operator-migration","permalink":"/calico/3.27/operations/operator-migration","draft":false,"unlisted":false,"editUrl":"https://github.com/tigera/docs/edit/main/calico_versioned_docs/version-3.27/operations/operator-migration.mdx","tags":[],"version":"3.27","frontMatter":{"description":"Migrate Calico from manifest-based to operator-managed installation"},"sidebar":"calicoSidebar","previous":{"title":"Migrate Calico data from an etcdv3 datastore to a Kubernetes datastore","permalink":"/calico/3.27/operations/datastore-migration"},"next":{"title":"Enable kubectl to manage Calico APIs","permalink":"/calico/3.27/operations/install-apiserver"}}'),a=t("85893"),o=t("50065");let r={description:"Migrate Calico from manifest-based to operator-managed installation"},s="Migrate Calico to an operator-managed installation",l={},c=[{value:"Big picture",id:"big-picture",level:2},{value:"Value",id:"value",level:2},{value:"Concepts",id:"concepts",level:2},{value:"Operator vs manifest based installations",id:"operator-vs-manifest-based-installations",level:3},{value:"Operator migration",id:"operator-migration",level:3},{value:"Before you begin",id:"before-you-begin",level:2},{value:"How To",id:"how-to",level:2},{value:"Migrate a cluster to the operator",id:"migrate-a-cluster-to-the-operator",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"migrate-calico-to-an-operator-managed-installation",children:"Migrate Calico to an operator-managed installation"})}),"\n",(0,a.jsx)(n.h2,{id:"big-picture",children:"Big picture"}),"\n",(0,a.jsx)(n.p,{children:"Switch your Calico installation from manifest-based resources to an installation managed by the Calico operator."}),"\n",(0,a.jsx)(n.h2,{id:"value",children:"Value"}),"\n",(0,a.jsx)(n.p,{children:"The Calico operator provides a number of advantages over traditional manifest-based installation of Calico resources, including but not limited to:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Automatic platform and configuration detection."}),"\n",(0,a.jsx)(n.li,{children:"A simplified upgrade procedure."}),"\n",(0,a.jsx)(n.li,{children:"Well-defined split between end-user configuration and product code."}),"\n",(0,a.jsx)(n.li,{children:"Resource reconciliation and lifecycle management."}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"concepts",children:"Concepts"}),"\n",(0,a.jsx)(n.h3,{id:"operator-vs-manifest-based-installations",children:"Operator vs manifest based installations"}),"\n",(0,a.jsxs)(n.p,{children:["Most Calico installations in the past have been manifest-based, meaning that Calico is installed directly as a set of Kubernetes resources in a ",(0,a.jsx)(n.code,{children:".yaml"})," file."]}),"\n",(0,a.jsx)(n.p,{children:"The Calico operator is a Kubernetes application that installs and manages the lifecycle of a Calico installation by creating and updating Kubernetes resources\nsuch as Deployments, DaemonSets, Secrets, without the need for direct user intervention."}),"\n",(0,a.jsx)(n.p,{children:"There are a few key differences to be aware of, if you are familiar with manifest-based installs and are looking to use the operator:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Calico resources will be migrated from the ",(0,a.jsx)(n.code,{children:"kube-system"})," namespace used by the Calico manifests to a new ",(0,a.jsx)(n.code,{children:"calico-system"})," namespace."]}),"\n",(0,a.jsx)(n.li,{children:"Calico resources will no longer be hand-editable, as the Calico operator will reconcile undesired changes to maintain an expected state."}),"\n",(0,a.jsxs)(n.li,{children:["Calico resources can instead be configured via the ",(0,a.jsx)(n.code,{children:"operator.tigera.io"})," APIs."]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"operator-migration",children:"Operator migration"}),"\n",(0,a.jsxs)(n.p,{children:["For new clusters, you can simply follow the steps in the ",(0,a.jsx)(n.a,{href:"/calico/3.27/getting-started/kubernetes/quickstart",children:"quickstart guide"})," to get started with the operator."]}
1),"\n",(0,a.jsxs)(n.p,{children:["For existing clusters using the ",(0,a.jsx)(n.code,{children:"calico.yaml"})," manifest to install Calico, upon installing the operator, it will detect the existing Calico resources on the cluster\nand calculate how to take ownership of them. The operator will maintain existing customizations, if supported, and warn about any unsupported configurations that it detects."]}),"\n",(0,a.jsx)(n.h2,{id:"before-you-begin",children:"Before you begin"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Ensure that your Calico installation is configured to use the Kubernetes datastore. If your cluster uses etcdv3 directly, you must follow ",(0,a.jsx)(n.a,{href:"/calico/3.27/operations/datastore-migration",children:"the datastore migration procedure"})," before following this document."]}),"\n",(0,a.jsx)(n.li,{children:"Migration to Calico v3.27 operator-managed installation is supported only from Calico v3.27 manifest-based installation"}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"how-to",children:"How To"}),"\n",(0,a.jsx)(n.h3,{id:"migrate-a-cluster-to-the-operator",children:"Migrate a cluster to the operator"}),"\n",(0,a.jsx)(n.admonition,{type:"note",children:(0,a.jsxs)(n.p,{children:["Do not edit or delete any resources in the ",(0,a.jsx)(n.code,{children:"kube-system"})," Namespace during the following procedure as it may interfere with the upgrade."]})}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"Install the Tigera operator and custom resource definitions."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.5/manifests/tigera-operator.yaml\n"})}),"\n",(0,a.jsx)(n.admonition,{type:"note",children:(0,a.jsxs)(n.p,{children:["Due to the large size of the CRD bundle, ",(0,a.jsx)(n.code,{children:"kubectl apply"})," might exceed request limits. Instead, use ",(0,a.jsx)(n.code,{children:"kubectl create"})," or ",(0,a.jsx)(n.code,{children:"kubectl replace"}),"."]})}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Trigger the operator to start a migration by creating an ",(0,a.jsx)(n.code,{children:"Installation"})," resource. The operator will auto-detect your existing Calico settings and fill out the spec section."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"kubectl create -f - <<EOF\napiVersion: operator.tigera.io/v1\nkind: Installation\nmetadata:\n name: default\nspec: {}\nEOF\n"})}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"Monitor the migration status with the following command:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"kubectl describe tigerastatus calico\n"})}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Now that the migration is complete, you will see Calico resources have moved to the ",(0,a.jsx)(n.code,{children:"calico-system"})," namespace."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"kubectl get pods -n calico-system\n"})}),"\n",(0,a.jsx)(n.p,{children:"You should see output like this:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{children:"NAME READY STATUS RESTARTS AGE\ncalico-kube-controllers-7688765788-9rqht 1/1 Running 0 17m\ncalico-node-4ljs6 1/1 Running 0 14m\ncalico-node-bd8mc 1/1 Running 0 14m\ncalico-node-cpbd8 1/1 Running 0 14m\ncalico-node-jl97q 1/1 Running 0 14m\ncalico-node-xw2nj 1/1 Running 0 14m\ncalico-typha-57bf79f96f-6sk8x 1/1 Running 0 14m\ncalico-typha-57bf79f96f-g99s9 1/1 Running 0 14m\ncalico-typha-57bf79f96f-qtchs 1/1 Running 0 14m\n"})}),"\n",(0,a.jsxs)(n.p,{children:["At this point, the operator will have automatically cleaned up any Calico resources in the ",(0,a.jsx)(n.code,{children:"kube-system"})," namespace. No manual cleanup is required."]}),"\n"]}),"\n"]})]})}function u(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},50065:function(e,n,t){t.d(n,{Z:function(){return s},a:function(){return r}});var i=t(67294);let a={},o=i.createContext(a);function r(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.