1 package v1 2 3 import ( 4 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 ) 6 7 // +genclient 8 // +genclient:nonNamespaced 9 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 11 // Proxy holds cluster-wide information on how to configure default proxies for the cluster. The canonical name is `cluster` 12 // 13 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 14 // +openshift:compatibility-gen:level=1 15 type Proxy struct { 16 metav1.TypeMeta `json:",inline"` 17 18 // metadata is the standard object's metadata. 19 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 20 metav1.ObjectMeta `json:"metadata,omitempty"` 21 22 // Spec holds user-settable values for the proxy configuration 23 // +kubebuilder:validation:Required 24 // +required 25 Spec ProxySpec `json:"spec"` 26 // status holds observed values from the cluster. They may not be overridden. 27 // +optional 28 Status ProxyStatus `json:"status"` 29 } 30 31 // ProxySpec contains cluster proxy creation configuration. 32 type ProxySpec struct { 33 // httpProxy is the URL of the proxy for HTTP requests. Empty means unset and will not result in an env var. 34 // +optional 35 HTTPProxy string `json:"httpProxy,omitempty"` 36 37 // httpsProxy is the URL of the proxy for HTTPS requests. Empty means unset and will not result in an env var. 38 // +optional 39 HTTPSProxy string `json:"httpsProxy,omitempty"` 40 41 // noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used. 42 // Empty means unset and will not result in an env var. 43 // +optional 44 NoProxy string `json:"noProxy,omitempty"` 45 46 // readinessEndpoints is a list of endpoints used to verify readiness of the proxy. 47 // +optional 48 ReadinessEndpoints []string `json:"readinessEndpoints,omitempty"` 49 50 // trustedCA is a reference to a ConfigMap containing a CA certificate bundle. 51 // The trustedCA field should only be consumed by a proxy validator. The 52 // validator is responsible for reading the certificate bundle from the required 53 // key "ca-bundle.crt", merging it with the system default trust bundle, 54 // and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle" 55 // in the "openshift-config-managed" namespace. Clients that expect to make 56 // proxy connections must use the trusted-ca-bundle for all HTTPS requests to 57 // the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as 58 // well. 59 // 60 // The namespace for the ConfigMap referenced by trustedCA is 61 // "openshift-config". Here is an example ConfigMap (in yaml): 62 // 63 // apiVersion: v1 64 // kind: ConfigMap 65 // metadata: 66 // name: user-ca-bundle 67 // namespace: openshift-config 68 // data: 69 // ca-bundle.crt: | 70 // -----BEGIN CERTIFICATE----- 71 // Custom CA certificate bundle. 72 // -----END CERTIFICATE----- 73 // 74 // +optional 75 TrustedCA ConfigMapNameReference `json:"trustedCA,omitempty"` 76 } 77 78 // ProxyStatus shows current known state of the cluster proxy. 79 type ProxyStatus struct { 80 // httpProxy is the URL of the proxy for HTTP requests. 81 // +optional 82 HTTPProxy string `json:"httpProxy,omitempty"` 83 84 // httpsProxy is the URL of the proxy for HTTPS requests. 85 // +optional 86 HTTPSProxy string `json:"httpsProxy,omitempty"` 87 88 // noProxy is a comma-separated list of hostnames and/or CIDRs for which the proxy should not be used. 89 // +optional 90 NoProxy string `json:"noProxy,omitempty"` 91 } 92 93 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 94 95 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 96 // +openshift:compatibility-gen:level=1 97 type ProxyList struct { 98 metav1.TypeMeta `json:",inline"` 99 100 // metadata is the standard list's metadata. 101 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 102 metav1.ListMeta `json:"metadata"` 103 104 Items []Proxy `json:"items"` 105 } 106