Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand pvc plugin changes #2

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -56127,6 +56127,15 @@
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"
}
},
"conditions": {
"description": "Current service state of PVC",
"type": "array",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.PvcCondition"
},
"x-kubernetes-patch-merge-key": "type",
"x-kubernetes-patch-strategy": "merge"
},
"phase": {
"description": "Phase represents the current phase of PersistentVolumeClaim.",
"type": "string"
Expand Down Expand Up @@ -56892,6 +56901,37 @@
}
}
},
"io.k8s.api.core.v1.PvcCondition": {
"description": "PvcCondition contails details about state of pvc",
"required": [
"type",
"status"
],
"properties": {
"lastProbeTime": {
"description": "Last time we probed the condition.",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"
},
"lastTransitionTime": {
"description": "Last time the condition transitioned from one status to another.",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"
},
"message": {
"description": "Human-readable message indicating details about last transition.",
"type": "string"
},
"reason": {
"description": "Unique, one-word, CamelCase reason for the condition's last transition.",
"type": "string"
},
"status": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"io.k8s.api.core.v1.QuobyteVolumeSource": {
"description": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.",
"required": [
Expand Down
39 changes: 39 additions & 0 deletions api/swagger-spec/apps_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6043,6 +6043,45 @@
"capacity": {
"type": "object",
"description": "Represents the actual resources of the underlying volume."
},
"conditions": {
"type": "array",
"items": {
"$ref": "v1.PvcCondition"
},
"description": "Current service state of PVC"
}
}
},
"v1.PvcCondition": {
"id": "v1.PvcCondition",
"description": "PvcCondition contails details about state of pvc",
"required": [
"type",
"status"
],
"properties": {
"type": {
"type": "string"
},
"status": {
"type": "string"
},
"lastProbeTime": {
"type": "string",
"description": "Last time we probed the condition."
},
"lastTransitionTime": {
"type": "string",
"description": "Last time the condition transitioned from one status to another."
},
"reason": {
"type": "string",
"description": "Unique, one-word, CamelCase reason for the condition's last transition."
},
"message": {
"type": "string",
"description": "Human-readable message indicating details about last transition."
}
}
},
Expand Down
39 changes: 39 additions & 0 deletions api/swagger-spec/apps_v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7662,6 +7662,45 @@
"capacity": {
"type": "object",
"description": "Represents the actual resources of the underlying volume."
},
"conditions": {
"type": "array",
"items": {
"$ref": "v1.PvcCondition"
},
"description": "Current service state of PVC"
}
}
},
"v1.PvcCondition": {
"id": "v1.PvcCondition",
"description": "PvcCondition contails details about state of pvc",
"required": [
"type",
"status"
],
"properties": {
"type": {
"type": "string"
},
"status": {
"type": "string"
},
"lastProbeTime": {
"type": "string",
"description": "Last time we probed the condition."
},
"lastTransitionTime": {
"type": "string",
"description": "Last time the condition transitioned from one status to another."
},
"reason": {
"type": "string",
"description": "Unique, one-word, CamelCase reason for the condition's last transition."
},
"message": {
"type": "string",
"description": "Human-readable message indicating details about last transition."
}
}
},
Expand Down
39 changes: 39 additions & 0 deletions api/swagger-spec/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -18746,6 +18746,45 @@
"capacity": {
"type": "object",
"description": "Represents the actual resources of the underlying volume."
},
"conditions": {
"type": "array",
"items": {
"$ref": "v1.PvcCondition"
},
"description": "Current service state of PVC"
}
}
},
"v1.PvcCondition": {
"id": "v1.PvcCondition",
"description": "PvcCondition contails details about state of pvc",
"required": [
"type",
"status"
],
"properties": {
"type": {
"type": "string"
},
"status": {
"type": "string"
},
"lastProbeTime": {
"type": "string",
"description": "Last time we probed the condition."
},
"lastTransitionTime": {
"type": "string",
"description": "Last time the condition transitioned from one status to another."
},
"reason": {
"type": "string",
"description": "Unique, one-word, CamelCase reason for the condition's last transition."
},
"message": {
"type": "string",
"description": "Human-readable message indicating details about last transition."
}
}
},
Expand Down
1 change: 1 addition & 0 deletions cmd/kube-controller-manager/app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ go_library(
"//pkg/controller/statefulset:go_default_library",
"//pkg/controller/ttl:go_default_library",
"//pkg/controller/volume/attachdetach:go_default_library",
"//pkg/controller/volume/expand:go_default_library",
"//pkg/controller/volume/persistentvolume:go_default_library",
"//pkg/features:go_default_library",
"//pkg/quota/install:go_default_library",
Expand Down
1 change: 1 addition & 0 deletions cmd/kube-controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func NewControllerInitializers() map[string]InitFunc {
controllers["route"] = startRouteController
controllers["persistentvolume-binder"] = startPersistentVolumeBinderController
controllers["attachdetach"] = startAttachDetachController
controllers["volume-expand"] = startVolumeExpandController

return controllers
}
Expand Down
16 changes: 16 additions & 0 deletions cmd/kube-controller-manager/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import (
serviceaccountcontroller "k8s.io/kubernetes/pkg/controller/serviceaccount"
ttlcontroller "k8s.io/kubernetes/pkg/controller/ttl"
"k8s.io/kubernetes/pkg/controller/volume/attachdetach"
"k8s.io/kubernetes/pkg/controller/volume/expand"
persistentvolumecontroller "k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
"k8s.io/kubernetes/pkg/features"
quotainstall "k8s.io/kubernetes/pkg/quota/install"
Expand Down Expand Up @@ -186,6 +187,21 @@ func startAttachDetachController(ctx ControllerContext) (bool, error) {
return true, nil
}

func startVolumeExpandController(ctx ControllerContext) (bool, error) {
expandController, expandControllerErr := expand.NewExpandController(
ctx.ClientBuilder.ClientOrDie("expand-controller"),
ctx.InformerFactory.Core().V1().PersistentVolumeClaims(),
ctx.InformerFactory.Core().V1().PersistentVolumes(),
ctx.Cloud,
ProbeAttachableVolumePlugins(ctx.Options.VolumeConfiguration))

if expandControllerErr != nil {
return true, fmt.Errorf("Failed to start volume expand controller : %v", expandControllerErr)
}
go expandController.Run(ctx.Stop)
return true, nil
}

func startEndpointController(ctx ControllerContext) (bool, error) {
go endpointcontroller.NewEndpointController(
ctx.InformerFactory.Core().V1().Pods(),
Expand Down
76 changes: 76 additions & 0 deletions docs/api-reference/apps/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,13 @@ <h3 id="_v1_persistentvolumeclaimstatus">v1.PersistentVolumeClaimStatus</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">object</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">conditions</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Current service state of PVC</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_pvccondition">v1.PvcCondition</a> array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -5957,6 +5964,75 @@ <h3 id="_v1_cindervolumesource">v1.CinderVolumeSource</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_pvccondition">v1.PvcCondition</h3>
<div class="paragraph">
<p>PvcCondition contails details about state of pvc</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">type</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">status</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">lastProbeTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Last time we probed the condition.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">lastTransitionTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Last time the condition transitioned from one status to another.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">reason</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Unique, one-word, CamelCase reason for the condition&#8217;s last transition.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">message</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Human-readable message indicating details about last transition.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_securitycontext">v1.SecurityContext</h3>
Expand Down
Loading