k8s-crd

command module
v0.0.0-...-69a20ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

KubeApi

KubeApi is a Kubernetes Custom Resource which runs REST API server in Kubernetes.

Go Report Card

Available commands
$ make generate         // to build the deepcopy funcs, clientset, informers, listers
$ make manifests        // to build the manifest file for kubernetes custom resource definition
Kubernetes Custom Resource Definition Manifest file

Manifest file generated from above command.

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: (devel)
  creationTimestamp: null
  name: kubeapis.stable.example.com
spec:
  group: stable.example.com
  names:
    kind: KubeApi
    listKind: KubeApiList
    plural: kubeapis
    shortNames:
    - kapi
    singular: kubeapi
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    - jsonPath: .status.deploymentName
      name: Deployment
      type: string
    - jsonPath: .status.serviceName
      name: Service
      type: string
    - jsonPath: .status.replicas
      name: Replicas
      type: integer
    - jsonPath: .status.phase
      name: Status
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: KubeApiSpec Defines KubeApi Object spec
            properties:
              container:
                properties:
                  containerPort:
                    description: Container port of Api Server
                    format: int32
                    type: integer
                  image:
                    description: Container image of the Api Server
                    type: string
                required:
                - containerPort
                - image
                type: object
              deploymentName:
                type: string
              replicas:
                default: 1
                format: int32
                type: integer
              serviceName:
                type: string
              serviceType:
                default: ClusterIP
                enum:
                - ClusterIP
                - NodePort
                type: string
              version:
                type: string
            required:
            - container
            - serviceType
            type: object
          status:
            properties:
              phase:
                type: string
              replicas:
                description: Conditions         []metav1.Condition `json:"conditions"`
                format: int32
                type: integer
            required:
            - phase
            - replicas
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []

Kubebuilder markers
  • // +kubebuilder:object:root=true tells the object generator that this type represents a kind.
  • // +kubebuilder:subresource:status tells the object generator that we want a status subresource.
  • // +kubebuilder:object:generator=true is a package level marker.
  • // +groupName=stable.example.com is a package level marker that represent the API group.
Controller
  • Controllers are the core of kubernetes, and of any operator.
  • It's controller job to ensure that, for any given object, the actual state of the world matches the desired state in the object.
  • Each controller focuses on one root Kind, but may interact with other Kinds.
References:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
apis/stable.example.com/v1alpha1
+groupName=stable.example.com +kubebuilder:object:generator=true
+groupName=stable.example.com +kubebuilder:object:generator=true
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/stable.example.com/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/stable.example.com/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL