Deploy Calico using Tigera Operator
* Migrate the Calico function in airshipctl to deploy the Tigera Operator, instead of raw manifests * Added a new executor `kubernetes-apply-nowait` to run phase with nowait * nowait had to be done for phase `initinfra-networking-<ephemeral/target>` because of an issue with phase status-check for a specific resource `installation` which is part of tigera operator CR Change-Id: I748813667cdc5d05c9f0758d9c1e28082d79bdbe Closes: #368
This commit is contained in:
parent
30e69fedf5
commit
f212cfd55b
@ -1,5 +1,5 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../../function/cni/calico/v3
|
- ../../function/cni/tigera-operator/v1.13.0
|
||||||
- ../../function/cert-manager/v1.1.0
|
- ../../function/cert-manager/v1.1.0
|
||||||
|
17
manifests/function/cni/tigera-operator/README.rst
Normal file
17
manifests/function/cni/tigera-operator/README.rst
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Calico Operator
|
||||||
|
===============
|
||||||
|
|
||||||
|
This function contains a Kubernetes operator which manages the lifecycle of a Calico or Calico Enterprise installation on Kubernetes.
|
||||||
|
|
||||||
|
* Tigera Calico operator and custom resource definitions are defined in `tigera-operator.yaml`_.
|
||||||
|
* Calico is installed via tigera operator using `custom-resources.yaml`_ by specifying the default variant of product to be installed.
|
||||||
|
* The `tigera-operator.yaml`_ is taken from `GitHub URL`_.
|
||||||
|
* Included Operator version: v1.13.0
|
||||||
|
* Included Calico version: v3.17.0
|
||||||
|
|
||||||
|
To know more about tigera installtion see the `installation reference`_.
|
||||||
|
|
||||||
|
.. _tigera-operator.yaml: https://github.com/airshipit/airshipctl/tree/master/manifests/function/tigera-operator/v1.13.0/upstream/tigera-operator.yaml
|
||||||
|
.. _custom-resources.yaml: https://github.com/airshipit/airshipctl/tree/master/manifests/function/tigera-operator/v1.13.0/custom-resources.yaml
|
||||||
|
.. _GitHub URL: https://docs.projectcalico.org/manifests/tigera-operator.yaml
|
||||||
|
.. _installation reference: https://docs.projectcalico.org/getting-started/kubernetes/quickstart
|
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: operator.tigera.io/v1
|
||||||
|
kind: Installation
|
||||||
|
metadata:
|
||||||
|
name: default
|
||||||
|
spec: {}
|
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
bases:
|
||||||
|
- upstream
|
||||||
|
resources:
|
||||||
|
- custom-resources.yaml
|
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- tigera-operator.yaml
|
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,23 @@ config:
|
|||||||
pruneOptions:
|
pruneOptions:
|
||||||
prune: false
|
prune: false
|
||||||
---
|
---
|
||||||
|
# This is added to support phase with no-wait
|
||||||
|
# When there is a wait, then it does status-check and fails
|
||||||
|
# if the resource status(condition) is not met.
|
||||||
|
# There are cases where the resource do not have status
|
||||||
|
# field implemeneted. So a wait will fail with status check
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: KubernetesApply
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
airshipit.org/deploy-k8s: "false"
|
||||||
|
name: kubernetes-apply-nowait
|
||||||
|
config:
|
||||||
|
waitOptions:
|
||||||
|
timeout: 0
|
||||||
|
pruneOptions:
|
||||||
|
prune: false
|
||||||
|
---
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
kind: Clusterctl
|
kind: Clusterctl
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -23,6 +23,18 @@ config:
|
|||||||
---
|
---
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
kind: Phase
|
kind: Phase
|
||||||
|
metadata:
|
||||||
|
name: initinfra-networking-ephemeral
|
||||||
|
clusterName: ephemeral-cluster
|
||||||
|
config:
|
||||||
|
executorRef:
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: KubernetesApply
|
||||||
|
name: kubernetes-apply-nowait
|
||||||
|
documentEntryPoint: ephemeral/initinfra-networking
|
||||||
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: Phase
|
||||||
metadata:
|
metadata:
|
||||||
name: controlplane-ephemeral
|
name: controlplane-ephemeral
|
||||||
clusterName: ephemeral-cluster
|
clusterName: ephemeral-cluster
|
||||||
@ -48,6 +60,19 @@ config:
|
|||||||
---
|
---
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
kind: Phase
|
kind: Phase
|
||||||
|
metadata:
|
||||||
|
name: initinfra-networking-target
|
||||||
|
clusterName: target-cluster
|
||||||
|
config:
|
||||||
|
cluster: target-cluster
|
||||||
|
executorRef:
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: KubernetesApply
|
||||||
|
name: kubernetes-apply-nowait
|
||||||
|
documentEntryPoint: target/initinfra-networking
|
||||||
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: Phase
|
||||||
metadata:
|
metadata:
|
||||||
name: controlplane-target
|
name: controlplane-target
|
||||||
clusterName: target-cluster
|
clusterName: target-cluster
|
||||||
|
@ -6,9 +6,11 @@ phaseGroups:
|
|||||||
- name: group1
|
- name: group1
|
||||||
phases:
|
phases:
|
||||||
- name: initinfra-ephemeral
|
- name: initinfra-ephemeral
|
||||||
|
- name: initinfra-networking-ephemeral
|
||||||
- name: clusterctl-init-ephemeral
|
- name: clusterctl-init-ephemeral
|
||||||
- name: controlplane-ephemeral
|
- name: controlplane-ephemeral
|
||||||
- name: initinfra-target
|
- name: initinfra-target
|
||||||
|
- name: initinfra-networking-target
|
||||||
- name: workers-target
|
- name: workers-target
|
||||||
- name: workers-classification
|
- name: workers-classification
|
||||||
- name: workload-target
|
- name: workload-target
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
resources:
|
||||||
|
- ../../../../composite/infra/
|
||||||
|
|
||||||
|
commonLabels:
|
||||||
|
airshipit.org/stage: initinfra
|
@ -2,12 +2,10 @@ resources:
|
|||||||
- ../../../../function/baremetal-operator
|
- ../../../../function/baremetal-operator
|
||||||
- ../../../../function/hwcc
|
- ../../../../function/hwcc
|
||||||
- ../../../../function/clusterctl
|
- ../../../../function/clusterctl
|
||||||
- ../../../../composite/infra
|
|
||||||
- ../catalogues
|
- ../catalogues
|
||||||
|
|
||||||
commonLabels:
|
commonLabels:
|
||||||
airshipit.org/stage: initinfra
|
airshipit.org/stage: initinfra
|
||||||
|
|
||||||
transformers:
|
transformers:
|
||||||
- ../../../../composite/infra/replacements
|
|
||||||
- ../../../../function/baremetal-operator/replacements
|
- ../../../../function/baremetal-operator/replacements
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
resources:
|
||||||
|
- ../../../../composite/infra/
|
||||||
|
|
||||||
|
commonLabels:
|
||||||
|
airshipit.org/stage: initinfra
|
@ -3,14 +3,12 @@ resources:
|
|||||||
- ../../../../function/hwcc
|
- ../../../../function/hwcc
|
||||||
- ../../../../function/clusterctl
|
- ../../../../function/clusterctl
|
||||||
- ../../../../composite/flux-helm
|
- ../../../../composite/flux-helm
|
||||||
- ../../../../composite/infra
|
|
||||||
- ../catalogues
|
- ../catalogues
|
||||||
|
|
||||||
commonLabels:
|
commonLabels:
|
||||||
airshipit.org/stage: initinfra
|
airshipit.org/stage: initinfra
|
||||||
|
|
||||||
transformers:
|
transformers:
|
||||||
- ../../../../composite/infra/replacements
|
|
||||||
- ../../../../function/baremetal-operator/replacements
|
- ../../../../function/baremetal-operator/replacements
|
||||||
- ../../../../function/flux/source-controller/replacements
|
- ../../../../function/flux/source-controller/replacements
|
||||||
- ../../../../function/flux/helm-controller/replacements
|
- ../../../../function/flux/helm-controller/replacements
|
||||||
|
@ -17,6 +17,15 @@ set -xe
|
|||||||
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
||||||
export KUBECONFIG_EPHEMERAL_CONTEXT=${KUBECONFIG_EPHEMERAL_CONTEXT:-"ephemeral-cluster"}
|
export KUBECONFIG_EPHEMERAL_CONTEXT=${KUBECONFIG_EPHEMERAL_CONTEXT:-"ephemeral-cluster"}
|
||||||
|
|
||||||
|
echo "Deploy calico using tigera operator"
|
||||||
|
airshipctl phase run initinfra-networking-ephemeral --debug
|
||||||
|
|
||||||
|
echo "Wait for Calico to be deployed using tigera"
|
||||||
|
kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_EPHEMERAL_CONTEXT wait --all-namespaces --for=condition=Ready pods --all --timeout=1000s
|
||||||
|
|
||||||
|
echo "Wait for Tigerastatus to be Available"
|
||||||
|
kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_EPHEMERAL_CONTEXT wait --for=condition=Available tigerastatus --all --timeout=1000s -A
|
||||||
|
|
||||||
echo "Deploy metal3.io components to ephemeral node"
|
echo "Deploy metal3.io components to ephemeral node"
|
||||||
airshipctl phase run initinfra-ephemeral --debug
|
airshipctl phase run initinfra-ephemeral --debug
|
||||||
|
|
||||||
|
@ -18,6 +18,15 @@ export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
|||||||
NODENAME="node01"
|
NODENAME="node01"
|
||||||
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
|
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
|
||||||
|
|
||||||
|
echo "Deploy calico using tigera operator"
|
||||||
|
airshipctl phase run initinfra-networking-target --debug
|
||||||
|
|
||||||
|
echo "Wait for Calico to be deployed using tigera"
|
||||||
|
kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT wait --all-namespaces --for=condition=Ready pods --all --timeout=600s
|
||||||
|
|
||||||
|
echo "Wait for Tigerastatus to be available"
|
||||||
|
kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT wait --for=condition=Available tigerastatus --all --timeout=600s -A
|
||||||
|
|
||||||
echo "Deploy infra to cluster"
|
echo "Deploy infra to cluster"
|
||||||
airshipctl phase run initinfra-target --debug
|
airshipctl phase run initinfra-target --debug
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user