Skip to content

Commit

Permalink
Implement statefulset operator installer chart (#142)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Jan 29, 2024
1 parent 7216939 commit 719fdfa
Show file tree
Hide file tree
Showing 34 changed files with 6,468 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&ScannerList{},
&Sidekick{},
&SidekickList{},
&StatefulSet{},
&StatefulSetList{},
&Supervisor{},
&SupervisorList{},
)
Expand Down
101 changes: 101 additions & 0 deletions apis/installer/v1alpha1/statefulset_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the AppsCode Community License 1.0.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
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.
*/

package v1alpha1

import (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindStatefulSet = "StatefulSet"
ResourceStatefulSet = "statefulset"
ResourceStatefulSets = "statefulsets"
)

// StatefulSet defines the schama for StatefulSet operator installer.

// +genclient
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
type StatefulSet struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec StatefulSetSpec `json:"spec,omitempty"`
}

// StatefulSetSpec is the schema for Operator Operator values file
type StatefulSetSpec struct {
//+optional
NameOverride string `json:"nameOverride"`
//+optional
FullnameOverride string `json:"fullnameOverride"`
RegistryFQDN string `json:"registryFQDN"`
ReplicaCount int32 `json:"replicaCount"`
Operator ContianerRef `json:"operator"`
RbacProxy ImageRef `json:"rbacproxy"`
Cleaner CleanerRef `json:"cleaner"`
ImagePullPolicy string `json:"imagePullPolicy"`
//+optional
ImagePullSecrets []string `json:"imagePullSecrets"`
//+optional
CriticalAddon bool `json:"criticalAddon"`
//+optional
LogLevel int32 `json:"logLevel"`
//+optional
Annotations map[string]string `json:"annotations"`
//+optional
PodAnnotations map[string]string `json:"podAnnotations"`
//+optional
PodLabels map[string]string `json:"podLabels"`
//+optional
NodeSelector map[string]string `json:"nodeSelector"`
// If specified, the pod's tolerations.
// +optional
Tolerations []core.Toleration `json:"tolerations"`
// If specified, the pod's scheduling constraints
// +optional
Affinity *core.Affinity `json:"affinity"`
// PodSecurityContext holds pod-level security attributes and common container settings.
// Optional: Defaults to empty. See type description for default values of each field.
// +optional
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
// +optional
Apiserver WebHookSpec `json:"apiserver"`
Monitoring Monitoring `json:"monitoring"`
}

type ContianerRef struct {
ImageRef `json:",inline"`
// Compute Resources required by the sidecar container.
// +optional
Resources core.ResourceRequirements `json:"resources"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// StatefulSetList is a list of StatefulSets
type StatefulSetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of StatefulSet CRD objects
Items []StatefulSet `json:"items,omitempty"`
}
146 changes: 146 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions charts/statefulset/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# Helm files
OWNERS
12 changes: 12 additions & 0 deletions charts/statefulset/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
description: StatefulSet Operator by AppsCode
name: statefulset
version: v0.0.1
appVersion: v0.0.1
home: https://kubedb.com/
icon: https://cdn.appscode.com/images/products/stash/statefulset-icon.png
sources:
- https://github.com/stashed
maintainers:
- name: appscode
email: [email protected]
5 changes: 5 additions & 0 deletions charts/statefulset/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
approvers:
- tamalsaha
reviewers:
- tamalsaha

Loading

0 comments on commit 719fdfa

Please sign in to comment.