Skip to content

Commit

Permalink
Replace kube-core rendering with operators render
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Oct 8, 2018
1 parent 2f42f8a commit 7c15908
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 64 deletions.
2 changes: 0 additions & 2 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ type bootstrapTemplateData struct {
EtcdCluster string
EtcdctlImage string
HyperkubeImage string
KubeCoreRenderImage string
ReleaseImage string
}

Expand Down Expand Up @@ -156,7 +155,6 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig) (*bootst
CloudProvider: getCloudProvider(installConfig),
CloudProviderConfig: getCloudProviderConfig(installConfig),
DebugConfig: "",
KubeCoreRenderImage: "quay.io/coreos/kube-core-renderer-dev:3b6952f5a1ba89bb32dd0630faddeaf2779c9a85",
EtcdCertSignerImage: "quay.io/coreos/kube-etcd-signer-server:678cc8e6841e2121ebfdb6e2db568fce290b67d6",
EtcdctlImage: "quay.io/coreos/etcd:v3.2.14",
BootkubeImage: "quay.io/coreos/bootkube:v0.10.0",
Expand Down
65 changes: 23 additions & 42 deletions pkg/asset/ignition/content/bootkube.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (
BootkubeShFileTemplate = template.Must(template.New("bootkube.sh").Parse(`#!/usr/bin/env bash
set -e
mkdir --parents /etc/kubernetes/manifests/
mkdir --parents /etc/kubernetes/{manifests,bootstrap-configs}
MACHINE_CONFIG_OPERATOR_IMAGE=$(podman run --rm {{.ReleaseImage}} image machine-config-operator)
echo "Found Machine Config Operator's image: $MACHINE_CONFIG_OPERATOR_IMAGE"
Expand All @@ -52,23 +52,6 @@ then
cp --recursive cvo-bootstrap/bootstrap/bootstrap-pod.yaml /etc/kubernetes/manifests/
fi
if [ ! -d kco-bootstrap ]
then
echo "Rendering Kubernetes core manifests..."
# shellcheck disable=SC2154
podman run \
--volume "$PWD:/assets:z" \
--volume /etc/kubernetes:/etc/kubernetes:z \
"{{.KubeCoreRenderImage}}" \
--config=/assets/kco-config.yaml \
--output=/assets/kco-bootstrap
cp --recursive kco-bootstrap/bootstrap-configs /etc/kubernetes/bootstrap-configs
cp --recursive kco-bootstrap/bootstrap-manifests .
cp --recursive kco-bootstrap/manifests .
fi
if [ ! -d kube-apiserver-bootstrap ]
then
echo "Rendering Kubernetes API server core manifests..."
Expand All @@ -78,15 +61,15 @@ then
--volume "$PWD:/assets:z" \
"${KUBE_APISERVER_OPERATOR_IMAGE}" \
/usr/bin/cluster-kube-apiserver-operator render \
--manifest-etcd-server-urls={{.EtcdCluster}} \
--asset-input-dir=/assets/tls \
--asset-output-dir=/assets/kube-apiserver-bootstrap \
--config-override-file=/usr/share/bootkube/manifests/config/config-overrides.yaml \
--config-output-file=/assets/kube-apiserver-bootstrap/config
# TODO: copy the bootstrap manifests to replace kube-core-operator
cp --recursive kube-apiserver-bootstrap/manifests/openshift-kube-apiserver-ns.yaml manifests/00_openshift-kube-apiserver-ns.yaml
cp --recursive kube-apiserver-bootstrap/manifests/secret-* manifests/
cp --recursive kube-apiserver-bootstrap/manifests/configmap-* manifests/
cp kube-apiserver-bootstrap/config /etc/kubernetes/bootstrap-configs/kube-apiserver-config.yaml
cp --recursive kube-apiserver-bootstrap/bootstrap-manifests .
cp --recursive kube-apiserver-bootstrap/manifests .
fi
if [ ! -d kube-controller-manager-bootstrap ]
Expand All @@ -103,30 +86,28 @@ then
--config-override-file=/usr/share/bootkube/manifests/config/config-overrides.yaml \
--config-output-file=/assets/kube-controller-manager-bootstrap/config
# TODO: copy the bootstrap manifests to replace kube-core-operator
cp --recursive kube-controller-manager-bootstrap/manifests/openshift-kube-controller-manager-ns.yaml manifests/00_openshift-kube-controller-manager-ns.yaml
cp --recursive kube-controller-manager-bootstrap/manifests/secret-* manifests/
cp --recursive kube-controller-manager-bootstrap/manifests/configmap-* manifests/
cp kube-controller-manager-bootstrap/config /etc/kubernetes/bootstrap-configs/kube-controller-manager-config.yaml
cp --recursive kube-controller-manager-bootstrap/bootstrap-manifests/* bootstrap-manifests/
cp --recursive kube-controller-manager-bootstrap/manifests manifests/
fi
if [ ! -d kube-scheduler-bootstrap ]
then
echo "Rendering Kubernetes Scheduler core manifests..."
# shellcheck disable=SC2154
podman run \
--volume "$PWD:/assets:z" \
"${KUBE_SCHEDULER_OPERATOR_IMAGE}" \
/usr/bin/cluster-kube-scheduler-operator render \
--asset-input-dir=/assets/tls \
--asset-output-dir=/assets/kube-scheduler-bootstrap \
--config-override-file=/usr/share/bootkube/manifests/config/config-overrides.yaml \
--config-output-file=/assets/kube-scheduler-bootstrap/config
# TODO: copy the bootstrap manifests to replace kube-core-operator
cp --recursive kube-scheduler-bootstrap/manifests/openshift-kube-scheduler-ns.yaml manifests/00_openshift-kube-scheduler-ns.yaml
cp --recursive kube-scheduler-bootstrap/manifests/secret-* manifests/
cp --recursive kube-scheduler-bootstrap/manifests/configmap-* manifests/
echo "Rendering Kubernetes Scheduler core manifests..."
# shellcheck disable=SC2154
podman run \
--volume "$PWD:/assets:z" \
"${KUBE_SCHEDULER_OPERATOR_IMAGE}" \
/usr/bin/cluster-kube-scheduler-operator render \
--asset-input-dir=/assets/tls \
--asset-output-dir=/assets/kube-scheduler-bootstrap \
--config-override-file=/usr/share/bootkube/manifests/config/config-overrides.yaml \
--config-output-file=/assets/kube-scheduler-bootstrap/config
cp kube-scheduler-bootstrap/config /etc/kubernetes/bootstrap-configs/kube-scheduler-config.yaml
cp --recursive kube-scheduler-bootstrap/bootstrap-manifests/* bootstrap-manifests/
cp --recursive kube-scheduler-bootstrap/manifests manifests/
fi
if [ ! -d mco-bootstrap ]
Expand Down
20 changes: 0 additions & 20 deletions pkg/asset/manifests/content/bootkube/cvo-overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@ upstream: http://localhost:8080/graph
channel: fast
clusterID: {{.CVOClusterID}}
overrides:
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-core-operators
name: openshift-cluster-kube-apiserver-operator
unmanaged: true
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-core-operators
name: openshift-cluster-kube-scheduler-operator
unmanaged: true
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-core-operators
name: openshift-cluster-kube-controller-manager-operator
unmanaged: true
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-core-operators
name: openshift-cluster-openshift-apiserver-operator
unmanaged: true
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-core-operators
name: openshift-cluster-openshift-controller-manager-operator
unmanaged: true
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-cluster-network-operator
name: cluster-network-operator
Expand Down

0 comments on commit 7c15908

Please sign in to comment.