Skip to content

Commit 719fdfa

Browse files
authored
Implement statefulset operator installer chart (#142)
Signed-off-by: Tamal Saha <[email protected]>
1 parent 7216939 commit 719fdfa

34 files changed

+6468
-0
lines changed

apis/installer/v1alpha1/register.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
7474
&ScannerList{},
7575
&Sidekick{},
7676
&SidekickList{},
77+
&StatefulSet{},
78+
&StatefulSetList{},
7779
&Supervisor{},
7880
&SupervisorList{},
7981
)
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
3+
4+
Licensed under the AppsCode Community License 1.0.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
core "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
)
23+
24+
const (
25+
ResourceKindStatefulSet = "StatefulSet"
26+
ResourceStatefulSet = "statefulset"
27+
ResourceStatefulSets = "statefulsets"
28+
)
29+
30+
// StatefulSet defines the schama for StatefulSet operator installer.
31+
32+
// +genclient
33+
// +genclient:skipVerbs=updateStatus
34+
// +k8s:openapi-gen=true
35+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
36+
37+
// +kubebuilder:object:root=true
38+
type StatefulSet struct {
39+
metav1.TypeMeta `json:",inline,omitempty"`
40+
metav1.ObjectMeta `json:"metadata,omitempty"`
41+
Spec StatefulSetSpec `json:"spec,omitempty"`
42+
}
43+
44+
// StatefulSetSpec is the schema for Operator Operator values file
45+
type StatefulSetSpec struct {
46+
//+optional
47+
NameOverride string `json:"nameOverride"`
48+
//+optional
49+
FullnameOverride string `json:"fullnameOverride"`
50+
RegistryFQDN string `json:"registryFQDN"`
51+
ReplicaCount int32 `json:"replicaCount"`
52+
Operator ContianerRef `json:"operator"`
53+
RbacProxy ImageRef `json:"rbacproxy"`
54+
Cleaner CleanerRef `json:"cleaner"`
55+
ImagePullPolicy string `json:"imagePullPolicy"`
56+
//+optional
57+
ImagePullSecrets []string `json:"imagePullSecrets"`
58+
//+optional
59+
CriticalAddon bool `json:"criticalAddon"`
60+
//+optional
61+
LogLevel int32 `json:"logLevel"`
62+
//+optional
63+
Annotations map[string]string `json:"annotations"`
64+
//+optional
65+
PodAnnotations map[string]string `json:"podAnnotations"`
66+
//+optional
67+
PodLabels map[string]string `json:"podLabels"`
68+
//+optional
69+
NodeSelector map[string]string `json:"nodeSelector"`
70+
// If specified, the pod's tolerations.
71+
// +optional
72+
Tolerations []core.Toleration `json:"tolerations"`
73+
// If specified, the pod's scheduling constraints
74+
// +optional
75+
Affinity *core.Affinity `json:"affinity"`
76+
// PodSecurityContext holds pod-level security attributes and common container settings.
77+
// Optional: Defaults to empty. See type description for default values of each field.
78+
// +optional
79+
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
80+
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
81+
// +optional
82+
Apiserver WebHookSpec `json:"apiserver"`
83+
Monitoring Monitoring `json:"monitoring"`
84+
}
85+
86+
type ContianerRef struct {
87+
ImageRef `json:",inline"`
88+
// Compute Resources required by the sidecar container.
89+
// +optional
90+
Resources core.ResourceRequirements `json:"resources"`
91+
}
92+
93+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
94+
95+
// StatefulSetList is a list of StatefulSets
96+
type StatefulSetList struct {
97+
metav1.TypeMeta `json:",inline"`
98+
metav1.ListMeta `json:"metadata,omitempty"`
99+
// Items is a list of StatefulSet CRD objects
100+
Items []StatefulSet `json:"items,omitempty"`
101+
}

apis/installer/v1alpha1/zz_generated.deepcopy.go

Lines changed: 146 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/statefulset/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
# Helm files
23+
OWNERS

charts/statefulset/Chart.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
description: StatefulSet Operator by AppsCode
3+
name: statefulset
4+
version: v0.0.1
5+
appVersion: v0.0.1
6+
home: https://kubedb.com/
7+
icon: https://cdn.appscode.com/images/products/stash/statefulset-icon.png
8+
sources:
9+
- https://github.com/stashed
10+
maintainers:
11+
- name: appscode
12+

charts/statefulset/OWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
approvers:
2+
- tamalsaha
3+
reviewers:
4+
- tamalsaha
5+

0 commit comments

Comments
 (0)