Skip to content

Commit

Permalink
openshift: calico preliminary support
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed May 13, 2020
1 parent 49f48a0 commit 27bc3ac
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kvirt/openshift/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import json
import os
import sys
from kvirt.common import info, pprint, gen_mac, get_oc, get_values, pwd_path, insecure_fetch
from kvirt.common import info, pprint, gen_mac, get_oc, get_values, pwd_path, insecure_fetch, fetch
from kvirt.openshift.calico import calicoassets
from random import randint
import re
from shutil import copy2, move
Expand Down Expand Up @@ -363,6 +364,9 @@ def create(config, plandir, cluster, overrides):
if os.path.exists(manifestsdir) and os.path.isdir(manifestsdir):
for f in glob("%s/*.yaml" % manifestsdir):
copy2(f, "%s/openshift" % clusterdir)
if 'network_type' in data and data['network_type'] == 'Calico':
for asset in calicoassets:
fetch(asset, manifestsdir)
call('openshift-install --dir=%s create ignition-configs' % clusterdir, shell=True)
staticdata = gather_dhcp(data, platform)
if staticdata:
Expand Down
26 changes: 26 additions & 0 deletions kvirt/openshift/calico.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
calicoassets = ['crds/01-crd-installation.yaml',
'crds/01-crd-tigerastatus.yaml',
'crds/calico/kdd/02-crd-bgpconfiguration.yaml',
'crds/calico/kdd/02-crd-bgppeer.yaml',
'crds/calico/kdd/02-crd-blockaffinity.yaml',
'crds/calico/kdd/02-crd-clusterinformation.yaml',
'crds/calico/kdd/02-crd-felixconfiguration.yaml',
'crds/calico/kdd/02-crd-globalnetworkpolicy.yaml',
'crds/calico/kdd/02-crd-globalnetworkset.yaml',
'crds/calico/kdd/02-crd-hostendpoint.yaml',
'crds/calico/kdd/02-crd-ipamblock.yaml',
'crds/calico/kdd/02-crd-ipamconfig.yaml',
'crds/calico/kdd/02-crd-ipamhandle.yaml',
'crds/calico/kdd/02-crd-ippool.yaml',
'crds/calico/kdd/02-crd-kubecontrollersconfiguration.yaml',
'crds/calico/kdd/02-crd-networkpolicy.yaml',
'crds/calico/kdd/02-crd-networkset.yaml',
'tigera-operator/00-namespace-tigera-operator.yaml',
'tigera-operator/02-rolebinding-tigera-operator.yaml',
'tigera-operator/02-role-tigera-operator.yaml',
'tigera-operator/02-serviceaccount-tigera-operator.yaml',
'tigera-operator/02-configmap-calico-resources.yaml',
'tigera-operator/02-configmap-tigera-install-script.yaml',
'tigera-operator/02-tigera-operator.yaml',
'01-cr-installation.yaml']
calicoassets = ['https://docs.projectcalico.org/manifests/ocp/%s' % asset for asset in calicoassets]
2 changes: 2 additions & 0 deletions kvirt/openshift/kcli_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ info: |
Default version is latest stable but you can instead use ci, for which you will need a specific pull secret
Upstream okd version can be specified with the upstream flag.
the baremetal flag allows to get the baremetal operator deployed, so that you can deploy physical workers afterwards.
Sdn defaults to OpenShiftSDN but OVNKubernetes or Calico can be specified instead
masters: 1
workers: 0
image: rhcos44
network: default
cluster: testk
domain: karmalabs.com
network_type: OpenShiftSDN
minimal: false
numcpus: 4
master_memory: 8192
Expand Down

0 comments on commit 27bc3ac

Please sign in to comment.