github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/applications/calico/README.md (about) 1 # Build a kubernetes-withcalico CloudImage 2 3 ```shell script 4 sealer build -t kubernetes-withcalico:v1.19.9 . 5 sealer push kubernetes-withcalico:v1.19.9 6 ``` 7 8 ## Using kubernetes-withcalico CloudImage 9 10 This image contains the default Calico configuration [custom-resources.yaml](etc/custom-resources.yaml). 11 12 Clusterfile: 13 14 ```yaml 15 apiVersion: sealer.cloud/v2 16 kind: Cluster 17 metadata: 18 name: my-cluster 19 spec: 20 image: kubernetes:v1.19.8 21 ... 22 ``` 23 24 ```shell script 25 sealer apply -f Clusterfile 26 ``` 27 28 If you want to override the default Calico configuration file, you need to add sealer configuration to the Clusterfile. 29 30 Clusterfile: 31 32 ```yaml 33 apiVersion: sealer.aliyun.com/v1alpha1 34 kind: Cluster 35 metadata: 36 name: my-cluster 37 spec: 38 image: kubernetes:v1.19.8 39 ... 40 41 --- 42 ## Custom configurations must specify kind 43 kind: ClusterConfiguration 44 kubernetesVersion: v1.19.8 45 networking: 46 # dnsDomain: cluster.local 47 podSubnet: 100.1.0.0/10 #custom cidr 48 serviceSubnet: 10.96.0.0/22 49 --- 50 apiVersion: sealer.aliyun.com/v1alpha1 51 kind: Config 52 metadata: 53 name: calico 54 spec: 55 path: etc/custom-resources.yaml 56 data: | 57 apiVersion: operator.tigera.io/v1 58 kind: Installation 59 metadata: 60 name: default 61 spec: 62 # Configures Calico networking. 63 registry: sea.hub:5000 64 calicoNetwork: 65 # Note: The ipPools section cannot be modified post-install. 66 ipPools: 67 - blockSize: 26 68 cidr: 100.1.0.0/10 #custom cidr 69 encapsulation: VXLANCrossSubnet 70 natOutgoing: Enabled 71 nodeSelector: all() 72 ``` 73 74 ```shell script 75 sealer apply -f Clusterfile 76 ``` 77 78 For more information about calico installation configuration, see [the installation reference](https://docs.projectcalico.org/reference/installation/api#operator.tigera.io/v1.Installation). 79 80 ## Using kubernetes-withcalico CloudImage as Base Image 81 82 ```shell script 83 FROM kubernetes:v1.19.8 84 RUN wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml 85 CMD kubectl apply -f recommended.yaml 86 ``` 87