mirror of https://github.com/kubernetes/kops.git
Remove outdated docs for Calico
This commit is contained in:
parent
dcef2ff689
commit
f772c552e7
|
@ -1,52 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2017 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# create_migration_manifest.sh
|
||||
#
|
||||
# Script that returns a templated Calico CIDR migration manifest file.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
set -e
|
||||
|
||||
command -v jq >/dev/null 2>&1 || { echo >&2 "jq is required to run this script."; exit 1; }
|
||||
command -v kops >/dev/null 2>&1 || { echo >&2 "kops is required to run this script."; exit 1; }
|
||||
|
||||
[ -z "$NAME" ] && echo "Please set NAME to the name of your cluster you wish to perform this migration against." && exit 1;
|
||||
|
||||
export MIGRATION_TEMPLATE="jobs.yaml.template"
|
||||
export MIGRATION_MANIFEST="jobs.yaml"
|
||||
export NON_MASQUERADE_CIDR="`kops get cluster $NAME -o json --full | jq .spec.nonMasqueradeCIDR --raw-output`"
|
||||
export POD_CIDR="`kops get cluster $NAME -o json --full | jq .spec.kubeControllerManager.clusterCIDR --raw-output`"
|
||||
export IS_CROSS_SUBNET="`kops get cluster $NAME -o json --full | jq .spec.networking.calico.crossSubnet --raw-output`"
|
||||
|
||||
cp ${MIGRATION_TEMPLATE} ${MIGRATION_MANIFEST}
|
||||
|
||||
if [ "$IS_CROSS_SUBNET" = "true" ]; then
|
||||
echo "ipip mode is set to 'cross-subnet'. Honouring in migration manifest."
|
||||
else
|
||||
echo "ipip mode is set to 'Always'. Honouring in migration manifest."
|
||||
sed -i "/mode: cross-subnet/d" ${MIGRATION_MANIFEST}
|
||||
fi
|
||||
|
||||
sed -i -e "s@{{NON_MASQUERADE_CIDR}}@${NON_MASQUERADE_CIDR}@g" ${MIGRATION_MANIFEST}
|
||||
sed -i -e "s@{{POD_CIDR}}@${POD_CIDR}@g" ${MIGRATION_MANIFEST}
|
||||
|
||||
echo "jobs.yaml created. Please run: "
|
||||
echo "kubectl apply -f jobs.yaml"
|
|
@ -1,108 +0,0 @@
|
|||
# This ConfigMap is used in the creation of a new Calico IP Pool.
|
||||
kind: ConfigMap
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: calico-config-ippool
|
||||
namespace: kube-system
|
||||
data:
|
||||
# The default IP Pool to be created for the cluster.
|
||||
# Pod IP addresses will be assigned from this pool.
|
||||
ippool.yaml: |
|
||||
apiVersion: v1
|
||||
kind: ipPool
|
||||
metadata:
|
||||
cidr: {{POD_CIDR}}
|
||||
spec:
|
||||
ipip:
|
||||
enabled: true
|
||||
mode: cross-subnet
|
||||
nat-outgoing: true
|
||||
---
|
||||
## This manifest deploys a Job which adds a new ippool to calico
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: configure-calico-ippool
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: calico
|
||||
role.kubernetes.io/networking: "1"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: configure-calico-ippool
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
spec:
|
||||
hostNetwork: true
|
||||
serviceAccountName: calico
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
- key: CriticalAddonsOnly
|
||||
operator: Exists
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: configure-calico
|
||||
image: calico/ctl:v1.2.1
|
||||
args:
|
||||
- apply
|
||||
- -f
|
||||
- /etc/config/calico/ippool.yaml
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /etc/config
|
||||
env:
|
||||
# The location of the etcd cluster.
|
||||
- name: ETCD_ENDPOINTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: calico-config
|
||||
key: etcd_endpoints
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: calico-config-ippool
|
||||
items:
|
||||
- key: ippool.yaml
|
||||
path: calico/ippool.yaml
|
||||
|
||||
---
|
||||
## This manifest deploys a Job which deletes the old ippool from calico
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: configure-calico-ippool-remove
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: calico
|
||||
role.kubernetes.io/networking: "1"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: configure-calico-ippool-remove
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
spec:
|
||||
hostNetwork: true
|
||||
serviceAccountName: calico
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
- key: CriticalAddonsOnly
|
||||
operator: Exists
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: configure-calico
|
||||
image: calico/ctl:v1.2.1
|
||||
args:
|
||||
- delete
|
||||
- ipPool
|
||||
- {{NON_MASQUERADE_CIDR}}
|
||||
env:
|
||||
# The location of the etcd cluster.
|
||||
- name: ETCD_ENDPOINTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: calico-config
|
||||
key: etcd_endpoints
|
|
@ -1,6 +1,5 @@
|
|||
./addons/cluster-autoscaler/cluster-autoscaler.sh
|
||||
./addons/prometheus-operator/sync-repo.sh
|
||||
./docs/calico_cidr_migration/create_migration_manifest.sh
|
||||
./hack/common.sh
|
||||
./hack/dev-build.sh
|
||||
./hack/make-apimachinery.sh
|
||||
|
|
Loading…
Reference in New Issue