Documentation ¶
Index ¶
- Constants
- func GetSignedTokenString(claims jwt.Claims) (string, error)
- func Marshal(conf *Config) (yamlString string, err error)
- func SaveToFile(filename string, conf *Config) (err error)
- func Set(conf *Config)
- func ValidateToken(tokenString string) (string, error)
- type ApiConfig
- type ApiNamespacesConfig
- type AuthConfig
- type Config
- type ExternalServices
- type GrafanaConfig
- type IanaClaims
- type IstioConfig
- type IstioLabels
- type KubernetesConfig
- type LoginToken
- type PrometheusConfig
- type Server
- type ThreeScaleConfig
- type TokenGenerated
- type TracingConfig
Constants ¶
const ( EnvInstallationTag = "KIALI_INSTALLATION_TAG" EnvIdentityCertFile = "IDENTITY_CERT_FILE" EnvIdentityPrivateKeyFile = "IDENTITY_PRIVATE_KEY_FILE" EnvInCluster = "IN_CLUSTER" EnvIstioIdentityDomain = "ISTIO_IDENTITY_DOMAIN" EnvIstioSidecarAnnotation = "ISTIO_SIDECAR_ANNOTATION" EnvIstioUrlServiceVersion = "ISTIO_URL_SERVICE_VERSION" EnvApiNamespacesExclude = "API_NAMESPACES_EXCLUDE" EnvServerAddress = "SERVER_ADDRESS" EnvServerPort = "SERVER_PORT" EnvWebRoot = "SERVER_WEB_ROOT" EnvServerStaticContentRootDirectory = "SERVER_STATIC_CONTENT_ROOT_DIRECTORY" EnvServerCORSAllowAll = "SERVER_CORS_ALLOW_ALL" EnvServerAuditLog = "SERVER_AUDIT_LOG" EnvServerMetricsPort = "SERVER_METRICS_PORT" EnvServerMetricsEnabled = "SERVER_METRICS_ENABLED" EnvPrometheusServiceURL = "PROMETHEUS_SERVICE_URL" EnvPrometheusCustomMetricsURL = "PROMETHEUS_CUSTOM_METRICS_URL" EnvPrometheusInsecureSkipVerify = "PROMETHEUS_INSECURE_SKIP_VERIFY" EnvGrafanaDisplayLink = "GRAFANA_DISPLAY_LINK" EnvGrafanaInCluster = "GRAFANA_IN_CLUSTER" EnvGrafanaURL = "GRAFANA_URL" EnvGrafanaNamespace = "GRAFANA_NAMESPACE" EnvGrafanaService = "GRAFANA_SERVICE" EnvGrafanaWorkloadDashboardPattern = "GRAFANA_WORKLOAD_DASHBOARD_PATTERN" EnvGrafanaServiceDashboardPattern = "GRAFANA_SERVICE_DASHBOARD_PATTERN" EnvGrafanaVarNamespace = "GRAFANA_VAR_NAMESPACE" EnvGrafanaVarService = "GRAFANA_VAR_SERVICE" EnvGrafanaVarWorkload = "GRAFANA_VAR_WORKLOAD" EnvGrafanaAPIKey = "GRAFANA_API_KEY" EnvGrafanaUsername = "GRAFANA_USERNAME" EnvGrafanaPassword = "GRAFANA_PASSWORD" EnvGrafanaInsecureSkipVerify = "GRAFANA_INSECURE_SKIP_VERIFY" EnvTracingEnabled = "TRACING_ENABLED" EnvTracingURL = "TRACING_URL" EnvTracingServiceNamespace = "TRACING_SERVICE_NAMESPACE" EnvThreeScaleAdapterName = "THREESCALE_ADAPTER_NAME" EnvThreeScaleServiceName = "THREESCALE_SERVICE_NAME" EnvThreeScaleServicePort = "THREESCALE_SERVICE_PORT" EnvLoginTokenSigningKey = "LOGIN_TOKEN_SIGNING_KEY" EnvLoginTokenExpirationSeconds = "LOGIN_TOKEN_EXPIRATION_SECONDS" EnvIstioNamespace = "ISTIO_NAMESPACE" EnvIstioLabelNameApp = "ISTIO_LABEL_NAME_APP" EnvIstioLabelNameVersion = "ISTIO_LABEL_NAME_VERSION" EnvKubernetesBurst = "KUBERNETES_BURST" EnvKubernetesQPS = "KUBERNETES_QPS" EnvKubernetesCacheEnabled = "KUBERNETES_CACHE_ENABLED" EnvKubernetesCacheDuration = "KUBERNETES_CACHE_DURATION" EnvAuthStrategy = "AUTH_STRATEGY" EnvNamespaceLabelSelector = "NAMESPACE_LABEL_SELECTOR" )
Environment vars can define some default values. NOTE: If you add a new variable, don't forget to update README.adoc
const ( IstioVersionSupported = ">= 1.1" MaistraVersionSupported = ">= 0.7.0" )
The versions that Kiali requires
const ( AuthStrategyOpenshift = "openshift" AuthStrategyLogin = "login" AuthStrategyAnonymous = "anonymous" TokenCookieName = "kiali-token" AuthStrategyOpenshiftIssuer = "kiali-openshift" AuthStrategyLoginIssuer = "kiali-login" )
The valid auth strategies and values for cookie handling
const ( LoginSecretUsername = "/kiali-secret/username" LoginSecretPassphrase = "/kiali-secret/passphrase" )
the paths we expect the login secret to be located
Variables ¶
This section is empty.
Functions ¶
func GetSignedTokenString ¶ added in v0.16.0
func SaveToFile ¶
SaveToFile converts the Config object and stores its YAML string into the given file, overwriting any data that is in the file.
func Set ¶
func Set(conf *Config)
Set the global Config This function should not be called outside of main or tests. If possible keep config unmutated and use globals and/or appstate package for mutable states to avoid concurrent writes risk.
func ValidateToken ¶
ValidateToken checks if the input token is still valid
Types ¶
type ApiConfig ¶ added in v0.9.1
type ApiConfig struct {
Namespaces ApiNamespacesConfig
}
ApiConfig contains API specific configuration.
type ApiNamespacesConfig ¶ added in v0.9.1
type ApiNamespacesConfig struct { Exclude []string LabelSelector string `yaml:"label_selector,omitempty" json:"labelSelector"` }
ApiNamespacesConfig provides a list of regex strings defining namespaces to blacklist.
type AuthConfig ¶ added in v0.16.0
type AuthConfig struct {
Strategy string `yaml:"strategy,omitempty"`
}
AuthConfig provides details on how users are to authenticate
type Config ¶
type Config struct { Identity security.Identity `yaml:",omitempty"` Server Server `yaml:",omitempty"` InCluster bool `yaml:"in_cluster,omitempty"` ExternalServices ExternalServices `yaml:"external_services,omitempty"` LoginToken LoginToken `yaml:"login_token,omitempty"` IstioNamespace string `yaml:"istio_namespace,omitempty"` InstallationTag string `yaml:"installation_tag,omitempty"` IstioLabels IstioLabels `yaml:"istio_labels,omitempty"` KubernetesConfig KubernetesConfig `yaml:"kubernetes_config,omitempty"` API ApiConfig `yaml:"api,omitempty"` Auth AuthConfig `yaml:"auth,omitempty"` }
Config defines full YAML configuration.
func LoadFromFile ¶
LoadFromFile reads the YAML from the given file, parses the content, and returns its Config object representation.
type ExternalServices ¶
type ExternalServices struct { Istio IstioConfig `yaml:"istio,omitempty"` Prometheus PrometheusConfig `yaml:"prometheus,omitempty"` Grafana GrafanaConfig `yaml:"grafana,omitempty"` Tracing TracingConfig `yaml:"tracing,omitempty"` ThreeScale ThreeScaleConfig `yaml:"threescale,omitempty"` }
ExternalServices holds configurations for other systems that Kiali depends on
type GrafanaConfig ¶
type GrafanaConfig struct { DisplayLink bool `yaml:"display_link"` InCluster bool `yaml:"in_cluster"` URL string `yaml:"url"` Namespace string `yaml:"namespace"` Service string `yaml:"service"` APIKey string `yaml:"api_key"` Username string `yaml:"username"` Password string `yaml:"password"` InsecureSkipVerify bool `yaml:"insecure_skip_verify,omitempty"` }
GrafanaConfig describes configuration used for Grafana links
type IanaClaims ¶ added in v0.16.0
type IanaClaims struct { SessionId string `json:"sid,omitempty"` jwt.StandardClaims }
Structured version of Claims Section, as referenced at https://tools.ietf.org/html/rfc7519#section-4.1 See examples for how to use this with your own claim types
func GetTokenClaimsIfValid ¶ added in v0.16.0
func GetTokenClaimsIfValid(tokenString string) (*IanaClaims, error)
type IstioConfig ¶
type IstioConfig struct { UrlServiceVersion string `yaml:"url_service_version"` IstioIdentityDomain string `yaml:"istio_identity_domain,omitempty"` IstioSidecarAnnotation string `yaml:"istio_sidecar_annotation,omitempty"` }
IstioConfig describes configuration used for istio links
type IstioLabels ¶ added in v0.7.0
type IstioLabels struct { AppLabelName string `yaml:"app_label_name,omitempty" json:"appLabelName"` VersionLabelName string `yaml:"version_label_name,omitempty" json:"versionLabelName"` }
IstioLabels holds configuration about the labels required by Istio
type KubernetesConfig ¶ added in v0.9.0
type KubernetesConfig struct { Burst int `yaml:"burst,omitempty"` QPS float32 `yaml:"qps,omitempty"` CacheEnabled bool `yaml:"cache_enabled,omitempty"` CacheDuration int64 `yaml:"cache_duration,omitempty"` }
KubernetesConfig holds the k8s client configuration
type LoginToken ¶ added in v0.6.0
type LoginToken struct { SigningKey string `yaml:"signing_key,omitempty"` ExpirationSeconds int64 `yaml:"expiration_seconds,omitempty"` }
LoginToken holds config used in token-based authentication
type PrometheusConfig ¶ added in v0.18.0
type PrometheusConfig struct { URL string `yaml:"url,omitempty"` CustomMetricsURL string `yaml:"custom_metrics_url,omitempty"` InsecureSkipVerify bool `yaml:"insecure_skip_verify,omitempty"` }
PrometheusConfig describes configuration of the Prometheus component
type Server ¶
type Server struct { Address string `yaml:",omitempty"` Port int `yaml:",omitempty"` Credentials security.Credentials `yaml:",omitempty"` WebRoot string `yaml:"web_root,omitempty"` StaticContentRootDirectory string `yaml:"static_content_root_directory,omitempty"` CORSAllowAll bool `yaml:"cors_allow_all,omitempty"` AuditLog bool `yaml:"audit_log,omitempty"` MetricsPort int `yaml:"metrics_port,omitempty"` MetricsEnabled bool `yaml:"metrics_enabled,omitempty"` }
Server configuration
type ThreeScaleConfig ¶ added in v0.20.0
type ThreeScaleConfig struct { AdapterName string `yaml:"adapter_name"` AdapterService string `yaml:"adapter_service"` AdapterPort string `yaml:"adapter_port"` }
ThreeScaleConfig describes configuration used for 3Scale adapter
type TokenGenerated ¶
type TokenGenerated struct { Username string `json:"username"` Token string `json:"token"` ExpiresOn time.Time `json:"expiresOn"` }
func GenerateToken ¶
func GenerateToken(username string) (TokenGenerated, error)
GenerateToken generates a signed token with an expiration of <ExpirationSeconds> seconds
type TracingConfig ¶ added in v0.20.0
type TracingConfig struct { // Enable autodiscover and Jaeger in Kiali Enabled bool `yaml:"enabled"` Namespace string `yaml:"namespace"` Service string `yaml:"service"` URL string `yaml:"url"` // Path store the value of QUERY_BASE_PATH Path string `yaml:"-"` }
TracingConfig describes configuration used for tracing links