This repository was archived by the owner on Oct 28, 2024. It is now read-only.
generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 69
NestedControlPlane & NestedCluster Proposal #29
Merged
Fei-Guo
merged 1 commit into
kubernetes-retired:master
from
christopherhein:proposal/ncp-document
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2019 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. | ||
|
||
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
SOURCES := $(shell find ${ROOT_DIR} -name \*.plantuml) | ||
DIAGRAMS := $(SOURCES:%.plantuml=%.png) | ||
|
||
# Hosts running SELinux need :z added to volume mounts | ||
SELINUX_ENABLED := $(shell cat /sys/fs/selinux/enforce 2> /dev/null || echo 0) | ||
|
||
ifeq ($(SELINUX_ENABLED),1) | ||
DOCKER_VOL_OPTS?=:z | ||
endif | ||
|
||
.PHONY: diagrams | ||
diagrams: $(DIAGRAMS) | ||
|
||
%.png: %.plantuml | ||
docker run \ | ||
--rm \ | ||
--volume ${ROOT_DIR}:/workdir$(DOCKER_VOL_OPTS) \ | ||
--user $(shell id -u):$(shell id -g) \ | ||
k8s.gcr.io/cluster-api/plantuml:1.2019.6 \ | ||
-v /workdir/$(shell echo '$^' | sed -e 's,.*docs/,,g' ) |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes
File renamed without changes
81 changes: 81 additions & 0 deletions
81
docs/proposals/images/nestedcontrolplane/nc-activity.plantuml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
@startuml | ||
skinparam roundcorner 20 | ||
skinparam ParticipantPadding 20 | ||
skinparam BoxPadding 50 | ||
skinparam Shadowing false | ||
skinparam NoteBorderColor #444 | ||
skinparam NoteBackgroundColor #fff | ||
skinparam NoteFontColor #444 | ||
skinparam EntityBackgroundColor #fff | ||
skinparam EntityBorderColor #444 | ||
skinparam ArrowFontColor #444 | ||
skinparam ArrowColor #444 | ||
skinparam ArrowLollipopColor #444 | ||
skinparam ArrowThickness 1 | ||
skinparam ControlBorderColor #444 | ||
skinparam ControlBackgroundColor #fff | ||
skinparam ParticipantBorderColor #444 | ||
skinparam ParticipantBackgroundColor #fff | ||
skinparam ParticipantFontSize 17 | ||
skinparam ParticipantFontColor #444 | ||
skinparam ActorBorderColor #444 | ||
skinparam ActorFontColor #444 | ||
skinparam ActorFontSize 17 | ||
skinparam ActorBackgroundColor #fff | ||
skinparam GroupBorderColor #444 | ||
skinparam GroupBorderThickness 1 | ||
skinparam GroupHeaderFontColor #444 | ||
skinparam GroupFontColor #444 | ||
skinparam SequenceLifeLineBorderColor #444 | ||
skinparam ActivityBorderColor #444 | ||
skinparam ActivityBackgroundColor #fff | ||
skinparam ActivityDiamondBorderColor #444 | ||
skinparam ActivityDiamondBackgroundColor #fff | ||
|
||
title NestedCluster Creation | ||
|
||
start | ||
|
||
if (NC exists?) then (no) | ||
:return nil; | ||
end | ||
else (yes) | ||
endif | ||
|
||
if (deletionTimestamp?) then (yes) | ||
:handle deletion; | ||
end | ||
else (no) | ||
endif | ||
|
||
if (owningCluster exists?) then (no) | ||
:return nil; | ||
end | ||
else (yes) | ||
endif | ||
|
||
if (cluster paused?) then (yes) | ||
:return nil; | ||
end | ||
else (no) | ||
endif | ||
|
||
if (controlPlane exists?) then (no) | ||
:return failed to get control plane; | ||
end | ||
endif | ||
|
||
:set cluster.Status.Ready == ncp.Status.Ready; | ||
:set cluster.Spec.ControlPlaneEndpoint == ncp.Spec.ControlPlaneEndpoint; | ||
|
||
:patch cluster; | ||
if (errors?) then (yes) | ||
:return error; | ||
end | ||
endif | ||
|
||
:return nil; | ||
|
||
end | ||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions
117
docs/proposals/images/nestedcontrolplane/ncp-activity.plantuml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
@startuml | ||
skinparam roundcorner 20 | ||
skinparam ParticipantPadding 20 | ||
skinparam BoxPadding 50 | ||
skinparam Shadowing false | ||
skinparam NoteBorderColor #444 | ||
skinparam NoteBackgroundColor #fff | ||
skinparam NoteFontColor #444 | ||
skinparam EntityBackgroundColor #fff | ||
skinparam EntityBorderColor #444 | ||
skinparam ArrowFontColor #444 | ||
skinparam ArrowColor #444 | ||
skinparam ArrowLollipopColor #444 | ||
skinparam ArrowThickness 1 | ||
skinparam ControlBorderColor #444 | ||
skinparam ControlBackgroundColor #fff | ||
skinparam ParticipantBorderColor #444 | ||
skinparam ParticipantBackgroundColor #fff | ||
skinparam ParticipantFontSize 17 | ||
skinparam ParticipantFontColor #444 | ||
skinparam ActorBorderColor #444 | ||
skinparam ActorFontColor #444 | ||
skinparam ActorFontSize 17 | ||
skinparam ActorBackgroundColor #fff | ||
skinparam GroupBorderColor #444 | ||
skinparam GroupBorderThickness 1 | ||
skinparam GroupHeaderFontColor #444 | ||
skinparam GroupFontColor #444 | ||
skinparam SequenceLifeLineBorderColor #444 | ||
skinparam ActivityBorderColor #444 | ||
skinparam ActivityBackgroundColor #fff | ||
skinparam ActivityDiamondBorderColor #444 | ||
skinparam ActivityDiamondBackgroundColor #fff | ||
|
||
title NestedControlPlane Creation | ||
|
||
start | ||
|
||
if (NCP exists?) then (no) | ||
:return nil; | ||
end | ||
else (yes) | ||
endif | ||
|
||
if (deletionTimestamp?) then (yes) | ||
:handle deletion; | ||
end | ||
endif | ||
|
||
if (component CRs exist?) then (no) | ||
:emit event; | ||
:return retryAfter; | ||
end | ||
else (yes) | ||
if (has ownerReferences?) then (no) | ||
:setup OwnerReferences back; | ||
endif | ||
endif | ||
|
||
if (cluster CA/Certs exists?) then (no) | ||
:call secret.NewCertificatesForInitialControlPlane; | ||
:store certs as secrets; | ||
if (errors?) then (yes) | ||
:return err; | ||
end | ||
elseif (error with Conflicts?) then (yes) | ||
:return retryAfter; | ||
end | ||
else (no) | ||
endif | ||
endif | ||
|
||
if (ControlPlaneEndpoint set?) then (no) | ||
:return nil; | ||
end | ||
endif | ||
|
||
|
||
if (admin kubeconfig exists?) then (no) | ||
:get ControlPlaneEndpoint; | ||
:create kubeconfig; | ||
if (errors?) then (yes) | ||
:return err; | ||
end | ||
endif | ||
elseif (kubeconfig owned?) then (no) | ||
:adopt kubeconfig; | ||
else (yes) | ||
if (certs need rotation?) then (yes) | ||
:regenerate and store; | ||
if (errors?) then (yes) | ||
:return err; | ||
end | ||
endif | ||
endif | ||
endif | ||
|
||
if (conditions updated?) then (no) | ||
if (etcd managed?) then (yes) | ||
:try to fetch common status fields; | ||
if (errors?) then (yes) | ||
:set etcd as unknown state; | ||
endif | ||
endif | ||
:get nested component statuses; | ||
:update NestedControlPlane status; | ||
if (errors?) then (yes) | ||
:return err; | ||
end | ||
endif | ||
endif | ||
|
||
:return nil; | ||
|
||
end | ||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.