Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
38ae5785
Commit
38ae5785
authored
Feb 05, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs for removing UniqueLabelKey from deployment spec
parent
bb0c5fea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
28 deletions
+7
-28
deployment.md
docs/proposals/deployment.md
+4
-13
deployments.md
docs/user-guide/deployments.md
+3
-15
No files found.
docs/proposals/deployment.md
View file @
38ae5785
...
@@ -71,7 +71,7 @@ type DeploymentSpec struct {
...
@@ -71,7 +71,7 @@ type DeploymentSpec struct {
// Label selector for pods. Existing ReplicationControllers whose pods are
// Label selector for pods. Existing ReplicationControllers whose pods are
// selected by this will be scaled down. New ReplicationControllers will be
// selected by this will be scaled down. New ReplicationControllers will be
// created with this selector, with a unique label
as defined by UniqueLabelKey
.
// created with this selector, with a unique label
`pod-template-hash`
.
// If Selector is empty, it is defaulted to the labels present on the Pod template.
// If Selector is empty, it is defaulted to the labels present on the Pod template.
Selector
map
[
string
]
string
Selector
map
[
string
]
string
...
@@ -80,15 +80,6 @@ type DeploymentSpec struct {
...
@@ -80,15 +80,6 @@ type DeploymentSpec struct {
// The deployment strategy to use to replace existing pods with new ones.
// The deployment strategy to use to replace existing pods with new ones.
Strategy
DeploymentStrategy
Strategy
DeploymentStrategy
// Key of the selector that is added to existing RCs (and label key that is
// added to its pods) to prevent the existing RCs to select new pods (and old
// pods being selected by new RC).
// Users can set this to an empty string to indicate that the system should
// not add any selector and label. If unspecified, system uses
// "deployment.kubernetes.io/podTemplateHash".
// Value of this key is hash of DeploymentSpec.PodTemplateSpec.
UniqueLabelKey
*
string
}
}
type
DeploymentStrategy
struct
{
type
DeploymentStrategy
struct
{
...
@@ -170,7 +161,7 @@ For each pending deployment, it will:
...
@@ -170,7 +161,7 @@ For each pending deployment, it will:
selector to all these RCs (and the corresponding label to their pods) to ensure
selector to all these RCs (and the corresponding label to their pods) to ensure
that they do not select the newly created pods (or old pods get selected by
that they do not select the newly created pods (or old pods get selected by
new RC).
new RC).
-
The label key will be "
deployment.kubernetes.io/podTemplateH
ash".
-
The label key will be "
pod-template-h
ash".
-
The label value will be hash of the podTemplateSpec for that RC without
-
The label value will be hash of the podTemplateSpec for that RC without
this label. This value will be unique for all RCs, since PodTemplateSpec should be unique.
this label. This value will be unique for all RCs, since PodTemplateSpec should be unique.
-
If the RCs and pods dont already have this label and selector:
-
If the RCs and pods dont already have this label and selector:
...
@@ -178,10 +169,10 @@ For each pending deployment, it will:
...
@@ -178,10 +169,10 @@ For each pending deployment, it will:
ensure that all new pods that they create will have this label.
ensure that all new pods that they create will have this label.
-
Then we will add this label to their existing pods and then add this as a selector
-
Then we will add this label to their existing pods and then add this as a selector
to that RC.
to that RC.
3.
Find if there exists an RC for which value of "
deployment.kubernetes.io/podTemplateH
ash" label
3.
Find if there exists an RC for which value of "
pod-template-h
ash" label
is same as hash of DeploymentSpec.PodTemplateSpec. If it exists already, then
is same as hash of DeploymentSpec.PodTemplateSpec. If it exists already, then
this is the RC that will be ramped up. If there is no such RC, then we create
this is the RC that will be ramped up. If there is no such RC, then we create
a new one using DeploymentSpec and then add a "
deployment.kubernetes.io/podTemplateH
ash" label
a new one using DeploymentSpec and then add a "
pod-template-h
ash" label
to it. RCSpec.replicas = 0 for a newly created RC.
to it. RCSpec.replicas = 0 for a newly created RC.
4.
Scale up the new RC and scale down the olds ones as per the DeploymentStrategy.
4.
Scale up the new RC and scale down the olds ones as per the DeploymentStrategy.
-
Raise an event if we detect an error, like new pods failing to come up.
-
Raise an event if we detect an error, like new pods failing to come up.
...
...
docs/user-guide/deployments.md
View file @
38ae5785
...
@@ -47,7 +47,6 @@ Documentation for other releases can be found at
...
@@ -47,7 +47,6 @@ Documentation for other releases can be found at
-
[
Pod Template
](
#pod-template
)
-
[
Pod Template
](
#pod-template
)
-
[
Replicas
](
#replicas
)
-
[
Replicas
](
#replicas
)
-
[
Selector
](
#selector
)
-
[
Selector
](
#selector
)
-
[
Unique Label Key
](
#unique-label-key
)
-
[
Strategy
](
#strategy
)
-
[
Strategy
](
#strategy
)
-
[
Recreate Deployment
](
#recreate-deployment
)
-
[
Recreate Deployment
](
#recreate-deployment
)
-
[
Rolling Update Deployment
](
#rolling-update-deployment
)
-
[
Rolling Update Deployment
](
#rolling-update-deployment
)
...
@@ -153,7 +152,7 @@ Running ```kubectl get rc``` and ```kubectl get pods``` will show the replicatio
...
@@ -153,7 +152,7 @@ Running ```kubectl get rc``` and ```kubectl get pods``` will show the replicatio
$
kubectl get rc
$
kubectl get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
REPLICAS AGE
REPLICAS AGE
deploymentrc-1975012602 nginx nginx:1.7.9
deployment.kubernetes.io/podTemplateH
ash=1975012602,app=nginx 3 2m
deploymentrc-1975012602 nginx nginx:1.7.9
pod-template-h
ash=1975012602,app=nginx 3 2m
```
```
```
console
```
console
...
@@ -237,8 +236,8 @@ which it scaled up to 3 replicas, and has scaled down the old RC to 0 replicas.
...
@@ -237,8 +236,8 @@ which it scaled up to 3 replicas, and has scaled down the old RC to 0 replicas.
```
console
```
console
kubectl get rc
kubectl get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
deploymentrc-1562004724 nginx nginx:1.9.1
deployment.kubernetes.io/podTemplateH
ash=1562004724,app=nginx 3 5m
deploymentrc-1562004724 nginx nginx:1.9.1
pod-template-h
ash=1562004724,app=nginx 3 5m
deploymentrc-1975012602 nginx nginx:1.7.9
deployment.kubernetes.io/podTemplateH
ash=1975012602,app=nginx 0 7m
deploymentrc-1975012602 nginx nginx:1.7.9
pod-template-h
ash=1975012602,app=nginx 0 7m
```
```
Running
`get pods`
should now show only the new pods:
Running
`get pods`
should now show only the new pods:
...
@@ -335,17 +334,6 @@ template is different than `.spec.template` or if the total number of such pods
...
@@ -335,17 +334,6 @@ template is different than `.spec.template` or if the total number of such pods
exceeds
`.spec.replicas`
. It will bring up new pods with
`.spec.template`
if
exceeds
`.spec.replicas`
. It will bring up new pods with
`.spec.template`
if
number of pods are less than the desired number.
number of pods are less than the desired number.
### Unique Label Key
`.spec.uniqueLabelKey`
is an optional field specifying key of the selector that
is added to existing RCs (and label key that is added to its pods) to prevent
the existing RCs to select new pods (and old pods being selected by new RC).
Users can set this to an empty string to indicate that the system should
not add any selector and label. If unspecified, the system uses
`deployment.kubernetes.io/podTemplateHash`
.
The value of this key is the hash of
`.spec.template`
.
No label is added if this is set to the empty string.
### Strategy
### Strategy
`.spec.strategy`
specifies the strategy used to replace old pods by new ones.
`.spec.strategy`
specifies the strategy used to replace old pods by new ones.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment