Documentation
¶
Index ¶
- Constants
- func MakeAccessKeySecretResource(ns, name, accessKey, secretKey string) (*bitnamiv1alpha1.SealedSecret, error)
- func MakeSealedSecretResource(ns, name string, data map[string]string) (*bitnamiv1alpha1.SealedSecret, error)
- func MakeSecretApplyConfigResource(ns, name string, data map[string]string) *appcorev1.SecretApplyConfiguration
- type Client
- func (c *Client) ApplyResource(ctx context.Context, un *unstructured.Unstructured, force bool) error
- func (c *Client) ApplyResourceConfig(ctx context.Context, context, config string, force bool) error
- func (c *Client) CurrentAccessKeyFromSecrets(ctx context.Context, ns, name string) (string, error)
- func (c *Client) DeleteResource(ctx context.Context, un *unstructured.Unstructured) error
- func (c *Client) DeleteResourceConfig(ctx context.Context, config string) error
- func (c *Client) GetSecret(ctx context.Context, ns, name string) (map[string]string, error)
- func (c *Client) ListIngressesHosts(ctx context.Context, ns string) ([]IngressHosts, error)
- func (c *Client) ListServiceDnsInfo(ctx context.Context, ns string) ([]ServiceDnsInfo, error)
- func (c *Client) PrepareResource(config string) (*unstructured.Unstructured, dynamic.ResourceInterface, error)
- func (c *Client) Restart(ctx context.Context, un *unstructured.Unstructured, force bool) error
- func (c *Client) SerializeResource(un *unstructured.Unstructured) (*SerializedResource, error)
- func (c *Client) UpdateAccessKey(ctx context.Context, ns, name, accessKey, secretKey string) error
- func (c *Client) UpdateSecret(ctx context.Context, ns, name string, data map[string]string) error
- type IngressHosts
- type SerializedResource
- type ServiceDnsInfo
Constants ¶
const ( AnnotationIngressService = "qubling.cloud/ingress-service" AnnotationLegacyIngressService = "zostay-ingress-service" AnnotationHostAliases = "qubling.cloud/host-aliases" AnnotationLegacyHostAliases = "zostay-host-aliases" AnnotationServiceName = "qubling.cloud/service-name" AnnotationLegacyServiceName = "zostay-dns-srv/service-name" AnnotationDestination = "qubling.cloud/destination" AnnotationLegacyDestination = "zostay-dns-srv/destination" AnnotationDeprecatedDNSNames = "qubling.cloud/deprecated-dns-names" LabelQublingEnabled = "qubling.cloud/infra-enabled" )
const ( AwsAccessKeyId = "aws_access_key_id" SecretAccessKey = "secret_access_key" AnnotationManagedSecret = "qubling.cloud/managed-secret" //nolint:gosec // this is not a secret )
const ( FieldManagerRestart = "qubling.cloud/restart" AnnotationRestartTrigger = "qubling.cloud/restart-trigger" )
const (
FieldManagerGenifest = "genifest" // k8s SSA field manager string used by this app
)
Variables ¶
This section is empty.
Functions ¶
func MakeAccessKeySecretResource ¶
func MakeAccessKeySecretResource( ns, name, accessKey, secretKey string, ) (*bitnamiv1alpha1.SealedSecret, error)
MakeAccessKeySecretResource is syntactic sugar around MakeSecretResource() for use with access key information.
func MakeSealedSecretResource ¶
func MakeSealedSecretResource( ns, name string, data map[string]string, ) (*bitnamiv1alpha1.SealedSecret, error)
MakeSealedSecretResource constructs a bitnami sealed secret object for the given namespace, name, and data to encrypt. It will perform the encryption of that data.
func MakeSecretApplyConfigResource ¶
func MakeSecretApplyConfigResource( ns, name string, data map[string]string, ) *appcorev1.SecretApplyConfiguration
MakeSecretApplyConfigResource constructs and returns a secret object ready to be applied via the simple Apply() method.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a help tool for accessing Kubernetes information from the Kubernetes API.
func (*Client) ApplyResource ¶
func (c *Client) ApplyResource( ctx context.Context, un *unstructured.Unstructured, force bool, ) error
ApplyResource serializes a resource and then applies.
func (*Client) ApplyResourceConfig ¶
func (c *Client) ApplyResourceConfig( ctx context.Context, context, config string, force bool, ) error
ApplyResourceConfig performs server-side apply for the given resource configuration.
func (*Client) CurrentAccessKeyFromSecrets ¶
CurrentAccessKeyFromSecrets will find and return the access key id stored in the identified secret or will return an error.
func (*Client) DeleteResource ¶
func (c *Client) DeleteResource( ctx context.Context, un *unstructured.Unstructured, ) error
DeleteResource deletes a single resource given by name.
func (*Client) DeleteResourceConfig ¶
DeleteResourceConfig performs deletion of the resource described by the given configuration file contents.
func (*Client) ListIngressesHosts ¶
ListIngressesHosts returns a list of all IngressHosts objects for every kind of supported ingress. This includes Ingress objects as well as synthetic ingress in ConfigMaps marked for=ingress.
func (*Client) ListServiceDnsInfo ¶
ListServiceDnsInfo returns all the DNS information for services in the given namespace. This uses the AnnotationServiceName and AnnotationLegacyServiceName as well as the AnnotationDestination and AnnotationLegacyDestination annotations to find the information and return it.
func (*Client) PrepareResource ¶
func (c *Client) PrepareResource( config string, ) (*unstructured.Unstructured, dynamic.ResourceInterface, error)
PrepareResource parses a configuration string into an applicable parsed configuration.
func (*Client) Restart ¶
func (c *Client) Restart( ctx context.Context, un *unstructured.Unstructured, force bool, ) error
Restart performs different tasks depending on the kind of record.
* Pod - no operation * ReplicaSet - delete pods * Deployment - modify the pod template to trigger a redeploy * Daemonset - modify the pod template to trigger a redeploy * Statefulset - modify the pod template to trigger a redeploy * CronJob - modify the job template to trigger restart, also delete jobs * Job - delete pods
As of this writing, only Deployment handling is implemented.
func (*Client) SerializeResource ¶
func (c *Client) SerializeResource( un *unstructured.Unstructured, ) (*SerializedResource, error)
SerializeResource turns a resource into JSON bytes ready for application via ApplySerializedResource and returns those bytes along with the namespace into which the resource should be applied.
func (*Client) UpdateAccessKey ¶
UpdateAccessKey is syntactic sugar around UpdateSecret() for use with access key information.
type IngressHosts ¶
type IngressHosts struct { Name string Namespace string Kind string Hosts []string LoadBalancers []string }
IngressHosts represent a collection of hosts that will need to be configured for DNS.
type SerializedResource ¶
type SerializedResource struct {
// contains filtered or unexported fields
}
SerializedResource is a resource that has been fully prepared for application, but allows some introspection for detecting changes and other such details.
func NewSerializedResource ¶
func NewSerializedResource( un *unstructured.Unstructured, dr dynamic.ResourceInterface, data []byte, ) *SerializedResource
NewSerializedResource creates a new SerializedResource from an unstructured resource and a dynamic resource interface and the serialized bytes.
func (*SerializedResource) Apply ¶
func (s *SerializedResource) Apply( ctx context.Context, force bool, ) error
Apply applies a SerializedResource to the cluster.
func (*SerializedResource) Bytes ¶
func (s *SerializedResource) Bytes() []byte
Bytes returns the serialized resource as bytes.
func (*SerializedResource) HasDynamicResource ¶
func (s *SerializedResource) HasDynamicResource() bool
HasDynamicResource returns true if the serialized resource has a dynamic resource interface set.
func (*SerializedResource) ResourceID ¶
func (s *SerializedResource) ResourceID() string
ResourceID returns a resource identifier consisting of "ns/group/version/kind/name" which provides a convenient naming scheme for comparing one revision of a resource to another.