Created
April 16, 2020 02:43
-
-
Save madorn/999a572e1d6e2fcbcf0e7b86d4d577f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package v1alpha1 | |
import ( | |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
) | |
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | |
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | |
// PodSetSpec defines the desired state of PodSet | |
type PodSetSpec struct { | |
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | |
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file | |
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html | |
Replicas int32 `json:"replicas"` | |
} | |
// PodSetStatus defines the observed state of PodSet | |
type PodSetStatus struct { | |
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | |
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file | |
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html | |
PodNames []string `json:"podNames"` | |
} | |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | |
// PodSet is the Schema for the podsets API | |
// +kubebuilder:subresource:status | |
// +kubebuilder:resource:path=podsets,scope=Namespaced | |
type PodSet struct { | |
metav1.TypeMeta `json:",inline"` | |
metav1.ObjectMeta `json:"metadata,omitempty"` | |
Spec PodSetSpec `json:"spec,omitempty"` | |
Status PodSetStatus `json:"status,omitempty"` | |
} | |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | |
// PodSetList contains a list of PodSet | |
type PodSetList struct { | |
metav1.TypeMeta `json:",inline"` | |
metav1.ListMeta `json:"metadata,omitempty"` | |
Items []PodSet `json:"items"` | |
} | |
func init() { | |
SchemeBuilder.Register(&PodSet{}, &PodSetList{}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment