Documentation ¶
Index ¶
Constants ¶
const ApiVersion = "v1"
const ContentTypeJSON = "application/json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIDoc ¶
type APIDoc struct { *kates.TypeMeta Metadata *kates.ObjectMeta `json:"metadata,omitempty"` TargetRef *kates.ObjectReference `json:"targetRef,omitempty"` Data []byte `json:"data,omitempty"` }
The APIDoc type is custom object built in the style of a Kubernetes resource (name, type, version) which holds a reference to a Kubernetes object from which an OpenAPI document was scrapped (Data field)
type AmbassadorMetaInfo ¶
type KubernetesSnapshot ¶
type KubernetesSnapshot struct { // k8s resources IngressClasses []*kates.IngressClass `json:"ingressclasses"` Ingresses []*kates.Ingress `json:"ingresses"` Services []*kates.Service `json:"service"` Endpoints []*kates.Endpoints `json:"Endpoints"` // ambassador resources Listeners []*ambv3alpha1.AmbassadorListener `json:"Listener"` Hosts []*ambv3alpha1.AmbassadorHost `json:"Host"` Mappings []*ambv3alpha1.AmbassadorMapping `json:"Mapping"` TCPMappings []*ambv3alpha1.AmbassadorTCPMapping `json:"TCPMapping"` Modules []*amb.Module `json:"Module"` TLSContexts []*amb.TLSContext `json:"TLSContext"` // plugin services AuthServices []*amb.AuthService `json:"AuthService"` RateLimitServices []*amb.RateLimitService `json:"RateLimitService"` LogServices []*amb.LogService `json:"LogService"` TracingServices []*amb.TracingService `json:"TracingService"` DevPortals []*amb.DevPortal `json:"DevPortal"` // resolvers ConsulResolvers []*amb.ConsulResolver `json:"ConsulResolver"` KubernetesEndpointResolvers []*amb.KubernetesEndpointResolver `json:"KubernetesEndpointResolver"` KubernetesServiceResolvers []*amb.KubernetesServiceResolver `json:"KubernetesServiceResolver"` // gateway api GatewayClasses []*gw.GatewayClass Gateways []*gw.Gateway HTTPRoutes []*gw.HTTPRoute KNativeClusterIngresses []*kates.Unstructured `json:"clusteringresses.networking.internal.knative.dev,omitempty"` KNativeIngresses []*kates.Unstructured `json:"ingresses.networking.internal.knative.dev,omitempty"` K8sSecrets []*kates.Secret `json:"-"` // Secrets from Kubernetes FSSecrets map[SecretRef]*kates.Secret `json:"-"` // Secrets from the filesystem Secrets []*kates.Secret `json:"secret"` // Secrets we'll feed to Ambassador Annotations []kates.Object `json:"-"` // Pods, Deployments and ConfigMaps were added to be used by Ambassador Agent so it can // report to AgentCom in Ambassador Cloud. Pods []*kates.Pod `json:"Pods,omitempty"` Deployments []*kates.Deployment `json:"Deployments,omitempty"` ConfigMaps []*kates.ConfigMap `json:"ConfigMaps,omitempty"` // ArgoRollouts represents the argo-rollout CRD state of the world that may or may not be present // in the client's cluster. For this reason, Rollouts resources are fetched making use of the // k8s dynamic client that returns an unstructured.Unstructured object. This is a better strategy // for Ambassador code base for the following reasons: // - it is forward compatible // - no need to maintain types defined by the Argo projects // - no unnecessary overhead Marshaling/Unmarshaling it into json as the state is opaque to // Ambassador. ArgoRollouts []*kates.Unstructured `json:"ArgoRollouts,omitempty"` // ArgoApplications represents the argo-rollout CRD state of the world that may or may not be present // in the client's cluster. For reasons why this is defined as unstructured see ArgoRollouts attribute. ArgoApplications []*kates.Unstructured `json:"ArgoApplications,omitempty"` }
func (*KubernetesSnapshot) Render ¶
func (a *KubernetesSnapshot) Render() string
func (*KubernetesSnapshot) Sanitize ¶
func (ambInputs *KubernetesSnapshot) Sanitize() error
func (*KubernetesSnapshot) UnmarshalJSON ¶
func (a *KubernetesSnapshot) UnmarshalJSON(data []byte) error
Custom Unmarshaller for the kubernetes snapshot TODO: This should be REMOVED once LEGACY_MODE is removed. This unmarshall will take a snapshot that comes from watt, and translate the mis-named fields into the correct fields in KubernetesSnapshot
type Snapshot ¶
type Snapshot struct { // meta information to identify the ambassador AmbassadorMeta *AmbassadorMetaInfo // The Kubernetes field contains all the ambassador inputs from kubernetes. Kubernetes *KubernetesSnapshot // The Consul field contains endpoint data for any mappings setup to use a // consul resolver. Consul *watt.ConsulSnapshot // The Deltas field contains a list of deltas to indicate what has changed // since the prior snapshot. This is only computed for the Kubernetes // portion of the snapshot. Changes in the Consul endpoint data are not // reflected in this field. Deltas []*kates.Delta // The APIDocs field contains a list of OpenAPI documents scrapped from // Ambassador Mappings part of the KubernetesSnapshot APIDocs []*APIDoc `json:"APIDocs,omitempty"` // The Invalid field contains any kubernetes resources that have failed // validation. Invalid []*kates.Unstructured Raw json.RawMessage `json:"-"` }
The snapshot type represents a complete configuration snapshot as sent to diagd.
func (*Snapshot) Sanitize ¶
Currently, this only removes "sensitive" information, which, for now, is just Secrets.data and anything that's not object metadata from Invalid objects. (since we couldn't parse the things in "invalid", we actually don't know what they are so they could contain secrets.)
TODO:(@acookin) Could also remove server generated bits from here, e.g. the last applied configuration annotation that the kube server applies. The benefit of that would be to reduce bits sent across the wire.