Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Fix bugs of nestedcomponent controllers #42

Merged
Merged
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
2 changes: 1 addition & 1 deletion apis/controlplane/v1alpha4/nestedapiserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type NestedAPIServerStatus struct {
}

//+kubebuilder:object:root=true
//+kubebuilder:resource:scope=Namespaced,path=nestedapiservers,shortName=napiserver
//+kubebuilder:resource:scope=Namespaced,path=nestedapiservers,shortName=nkas
//+kubebuilder:categories=capi,capn
//+kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
Expand Down
4 changes: 4 additions & 0 deletions apis/controlplane/v1alpha4/nestedcontrollermanager_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ type NestedControllerManagerStatus struct {
}

//+kubebuilder:object:root=true
//+kubebuilder:resource:scope=Namespaced,path=nestedcontrollermanager,shortName=nkcm
//+kubebuilder:categories=capi,capn
//+kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:subresource:status

// NestedControllerManager is the Schema for the nestedcontrollermanagers API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ spec:
timeoutSeconds: 30
volumeMounts:
- mountPath: /etc/kubernetes/pki/apiserver
name: {{.nestedControlPlaneName}}-apiserver-client-crt
name: {{.nestedControlPlaneName}}-apiserver
readOnly: true
- mountPath: /etc/kubernetes/pki/root
name: {{.nestedControlPlaneName}}-apiserver
name: {{.nestedControlPlaneName}}-ca
readOnly: true
- mountPath: /etc/kubernetes/pki/service-account
name: {{.nestedControlPlaneName}}-sa
Expand All @@ -85,14 +85,14 @@ spec:
searches:
- cluster.local
volumes:
- name: {{.nestedControlPlaneName}}-apiserver-client-crt
secret:
defaultMode: 420
secretName: {{.nestedControlPlaneName}}-apiserver-client-crt
- name: {{.nestedControlPlaneName}}-apiserver
secret:
defaultMode: 420
secretName: {{.nestedControlPlaneName}}-apiserver
- name: {{.nestedControlPlaneName}}-ca
secret:
defaultMode: 420
secretName: {{.nestedControlPlaneName}}-ca
- name: {{.nestedControlPlaneName}}-sa
secret:
defaultMode: 420
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
timeoutSeconds: 15
volumeMounts:
- mountPath: /etc/kubernetes/pki/root
name: {{.nestedControlPlaneName}}-apiserver
name: {{.nestedControlPlaneName}}-ca
readOnly: true
- mountPath: /etc/kubernetes/pki/service-account
name: {{.nestedControlPlaneName}}-sa
Expand All @@ -66,10 +66,10 @@ spec:
name: {{.nestedControllerManagerName}}-kubeconfig
readOnly: true
volumes:
- name: {{.nestedControlPlaneName}}-apiserver
- name: {{.nestedControlPlaneName}}-ca
secret:
defaultMode: 420
secretName: {{.nestedControlPlaneName}}-apiserver
secretName: {{.nestedControlPlaneName}}-ca
- name: {{.nestedControlPlaneName}}-sa
secret:
defaultMode: 420
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: {{.nestedetcdName}}
namespace: {{.nestedetcdNamespace}}
name: {{.nestedEtcdName}}
namespace: {{.nestedEtcdNamespace}}
labels:
component-name: {{.nestedetcdName}}
component-name: {{.nestedEtcdName}}
spec:
publishNotReadyAddresses: true
clusterIP: None
selector:
component-name: {{.nestedetcdName}}
component-name: {{.nestedEtcdName}}
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ spec:
timeoutSeconds: 15
volumeMounts:
- mountPath: /etc/kubernetes/pki/etcd
name: {{.nestedControlPlaneName}}-etcd-client-cert
name: {{.nestedControlPlaneName}}-etcd
readOnly: true
- mountPath: /etc/kubernetes/pki/root
name: {{.nestedControlPlaneName}}-etcd
name: {{.nestedControlPlaneName}}-ca
readOnly: true
volumes:
- name: {{.nestedControlPlaneName}}-etcd-client-cert
secret:
defaultMode: 420
secretName: {{.nestedControlPlaneName}}-etcd-client-cert
- name: {{.nestedControlPlaneName}}-etcd
secret:
defaultMode: 420
secretName: {{.nestedControlPlaneName}}-etcd
- name: {{.nestedControlPlaneName}}-ca
secret:
defaultMode: 420
secretName: {{.nestedControlPlaneName}}-ca
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
listKind: NestedAPIServerList
plural: nestedapiservers
shortNames:
- napiserver
- nkas
singular: nestedapiserver
scope: Namespaced
versions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1-0.20201002000720-57250aac17f6
creationTimestamp: null
name: nestedcontrollermanagers.controlplane.cluster.x-k8s.io
name: nestedcontrollermanager.controlplane.cluster.x-k8s.io
spec:
group: controlplane.cluster.x-k8s.io
names:
kind: NestedControllerManager
listKind: NestedControllerManagerList
plural: nestedcontrollermanagers
plural: nestedcontrollermanager
shortNames:
- nkcm
singular: nestedcontrollermanager
scope: Namespaced
versions:
- name: v1alpha4
- additionalPrinterColumns:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha4
schema:
openAPIV3Schema:
description: NestedControllerManager is the Schema for the nestedcontrollermanagers API
Expand Down
30 changes: 0 additions & 30 deletions config/crd/kustomization.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions config/crd/kustomizeconfig.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions config/crd/patches/cainjection_in_nestedapiservers.yaml

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions config/crd/patches/cainjection_in_nestedcontrolplanes.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions config/crd/patches/cainjection_in_nestedetcds.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions config/crd/patches/webhook_in_nestedapiservers.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions config/crd/patches/webhook_in_nestedcontrollermanagers.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions config/crd/patches/webhook_in_nestedcontrolplanes.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions config/crd/patches/webhook_in_nestedetcds.yaml

This file was deleted.

15 changes: 10 additions & 5 deletions controllers/controlplane/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,22 @@ limitations under the License.
package controlplane

const (
statefulsetOwnerKey = ".metadata.controller"
statefulsetOwnerKeyNEtcd = ".metadata.netcd.controller"
statefulsetOwnerKeyNKas = ".metadata.nkas.controller"
statefulsetOwnerKeyNKcm = ".metadata.nkcm.controller"
defaultEtcdStatefulSetURL = "https://raw.githubusercontent.com/kubernetes-sigs/" +
"cluster-api-provider-nested/master/config/component-templates/" +
"nestedetcd/nested-etcd-statefulset-template.yaml"
"nested-etcd/nested-etcd-statefulset-template.yaml"
defaultEtcdServiceURL = "https://raw.githubusercontent.com/kubernetes-sigs/" +
"cluster-api-provider-nested/master/config/component-templates/" +
"nestedetcd/nested-etcd-service-template.yaml"
"nested-etcd/nested-etcd-service-template.yaml"
defaultKASStatefulSetURL = "https://raw.githubusercontent.com/kubernetes-sigs/" +
"cluster-api-provider-nested/master/config/component-templates/" +
"nestedetcd/nested-apiserver-statefulset-template.yaml"
"nested-apiserver/nested-apiserver-statefulset-template.yaml"
defaultKASServiceURL = "https://raw.githubusercontent.com/kubernetes-sigs/" +
"cluster-api-provider-nested/master/config/component-templates/" +
"nestedetcd/nested-apiserver-service-template.yaml"
"nested-apiserver/nested-apiserver-service-template.yaml"
defaultKCMStatefulSetURL = "https://raw.githubusercontent.com/kubernetes-sigs/" +
"cluster-api-provider-nested/master/config/component-templates/" +
"nested-controllermanager/nested-controllermanager-statefulset-template.yaml"
)
Loading