Documentation
¶
Index ¶
- func Client(context string) (*kubernetes.Clientset, error)
- func CreateBucket(projectID, bucketName string) error
- func CreateConfigMap(sData SetupData) error
- func CreateGCPServiceAccount(projectID, serviceAccountName string) (*adminpb.ServiceAccount, error)
- func CreateHMACKey(projectID string, serviceAccountEmail string) (*storage.HMACKey, error)
- func CreateIAMRole(...) (string, error)
- func CreateS3Bucket(bucketName, region string) error
- func DeleteConfigMap(name string, namespace string) error
- func DeleteGCPServiceAccount(setupData SetupData) error
- func DeleteGCSBucket(setupData SetupData)
- func DeleteIAMRoleWithPolicies(roleArn string) error
- func DeleteS3Bucket(bucketName, region string) error
- func DynamicClient(context string) (dynamic.Interface, error)
- func GenerateReleaseIdentifier() string
- func GetAWSAccountID() (string, error)
- func GetCurrentEKSClusterName() (string, error)
- func GetCurrentKubeContextAPIEndpoint() (string, error)
- func GetCurrentNamespace() (string, error)
- func GetDefaultAwsRegion() (string, error)
- func GetEKSClusterDetails(clusterName string) (*types.Cluster, error)
- func GetEksClusterNameByApiServerUrl(apiServerUrl string) (string, error)
- func GetReleaseIdentifierFromReleaseName(releaseName string) string
- func GetS3PolicyDocument(bucketName string) string
- func GrantAllAccessToBucket(projectID, bucketName, serviceAccountEmail string) error
- func HasOIDCProvider(clusterName, region string) (bool, error)
- func KubeContextForCluster(clusterEndpoint string) (string, error)
- func Kubeconfig() (*clientcmdapi.Config, error)
- func List(kubeContext string) ([]*release.Release, error)
- func PrettyPrint(s1 map[string]interface{})
- func SetupAWS(setupData SetupData) (string, string, string, error)
- func SetupAWSBase(setupData SetupData) (string, string, error)
- func SetupHelm(setupData SetupData) error
- func Status(kubeContext, releaseName, namespace string) (string, error)
- func StructToMap2(s interface{}) (map[string]interface{}, error)
- func TearDownAWS(setupData SetupData, region string) error
- func TearDownHelm(releaseName, namespace string)
- func Teardown(releaseName, namespace, region string) error
- func Uninstall(kubeContext, releaseName, namespace string) error
- type Auth
- type Autoscaling
- type Backend
- type BackendPort
- type BackendService
- type Bucket
- type CertIssuer
- type Config
- type Etcd
- type EtcdAuth
- type Helm
- type Host
- type IAMPolicy
- type Image
- type Ingester
- type Ingress
- type MinIO
- type NameValue
- type Path
- type Persistence
- type PodSecurityContext
- type RBAC
- type ReplicaCount
- type Resources
- type SecurityContext
- type Service
- type ServiceAccount
- type SetupData
- type Statement
- type TLS
- type VolumePermission
- type ZincObserveValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBucket ¶
func CreateConfigMap ¶
func CreateGCPServiceAccount ¶
func CreateGCPServiceAccount(projectID, serviceAccountName string) (*adminpb.ServiceAccount, error)
func CreateHMACKey ¶
CreateHMACKey creates a new HMAC key using the given project and service account.
func CreateIAMRole ¶
func CreateIAMRole(accountId, region, issuerId, roleName, policyName, clusterName, releaseName, bucketName string) (string, error)
CreateIAMRole creates an IAM role with the EKS trusted entity and attaches an S3 bucket policy to it. It returns the ARN of the created role, or an error if one occurs.
func CreateS3Bucket ¶
CreateS3Bucket creates an S3 bucket with the specified name.
func DeleteConfigMap ¶
func DeleteGCPServiceAccount ¶
DeleteGCPServiceAccount deletes a service account
func DeleteGCSBucket ¶
func DeleteGCSBucket(setupData SetupData)
func DeleteIAMRoleWithPolicies ¶
DeleteIAMRoleWithPolicies deletes an IAM role and all of its associated policies. It returns an error if one occurs.
func GenerateReleaseIdentifier ¶
func GenerateReleaseIdentifier() string
func GetAWSAccountID ¶
GetAWSAccountID retrieves the AWS account number for the current user. It returns the account number string, or an error if one occurs.
func GetCurrentEKSClusterName ¶
GetCurrentEKSClusterName is a function that retrieves the name of the Amazon EKS cluster currently in use by the kubectl command-line tool. The function first retrieves the API server endpoint of the current Kubernetes context by calling the GetCurrentKubeContextAPIEndpoint function. The function then retrieves the name of the Amazon EKS cluster associated with the API server endpoint by calling the GetEksClusterNameByApiServerUrl function. The function returns the name of the Amazon EKS cluster and an error if one occurs.
func GetCurrentNamespace ¶
func GetDefaultAwsRegion ¶
GetDefaultAwsRegion retrieves the default region for the AWS account. It returns the region string, or an error if one occurs.
func GetEKSClusterDetails ¶
GetEKSClusterDetails retrieves details for the specified EKS cluster. It returns a pointer to the Cluster object or an error if one occurs.
func GetEksClusterNameByApiServerUrl ¶
GetEksClusterNameByApiServerUrl is a function that retrieves the name of an Amazon EKS cluster using its API server URL. The function takes in the API server URL as an argument. The function returns the name of the cluster and an error if one occurs.
func GetS3PolicyDocument ¶
func GrantAllAccessToBucket ¶
func HasOIDCProvider ¶
HasOIDCProvider is a function that checks whether an OIDC provider has already been configured for an Amazon EKS cluster. The function takes in the name of the cluster and its region as arguments. The function returns a boolean value indicating whether an OIDC provider exists for the cluster and an error if one occurs.
func KubeContextForCluster ¶
func Kubeconfig ¶
func Kubeconfig() (*clientcmdapi.Config, error)
func SetupAWS ¶
SetupAWS sets up the necessary AWS resources for a given release. It returns the name of the S3 bucket and the IAM role ARN that were created. If an error occurs, it returns an empty string for both values and the error itself.
func SetupAWSBase ¶
SetupAWSBase creates an S3 bucket, IAM role and inline policy for the role. It returns the ARN of the role. func SetupAWSBase(releaseIdentifer, clusterName, releaseName, region string) (string, string, error) {
func SetupHelm ¶
SetupHelm sets up the necessary kubernetes resources using official Helm chart. It returns the name of the S3 bucket and the IAM role ARN that were created. If an error occurs, it returns an empty string for both values and the error itself. It requires the name of the release, the namespace to deploy to, the name of the S3 bucket, and the IAM role ARN. If namespace is an empty string, it will default to "default". If namespace does not exist, it will be created. func SetupHelm(releaseName, namespace, bucket, role string) error {
func Status ¶
Status returns the status of the specified release in the specified Kubernetes cluster.
func StructToMap2 ¶
func TearDownAWS ¶
TearDownAWS tears down the AWS resources associated with a given release. It deletes the S3 bucket and the IAM role and policy. If an error occurs, it panics with the error message.
func TearDownHelm ¶
func TearDownHelm(releaseName, namespace string)
Types ¶
type Autoscaling ¶
type BackendPort ¶
type BackendPort struct {
Port string `yaml:"port"`
}
type BackendService ¶
type BackendService struct { Name string `yaml:"name"` Port BackendPort `yaml:"port"` }
type CertIssuer ¶
type CertIssuer struct {
Enabled bool `yaml:"enabled"`
}
type Config ¶
type Config struct { ZOLOCALMODE string `yaml:"ZO_LOCAL_MODE"` ZOHTTPPORT string `yaml:"ZO_HTTP_PORT"` ZOGRPCPORT string `yaml:"ZO_GRPC_PORT"` ZOGRPCTIMEOUT string `yaml:"ZO_GRPC_TIMEOUT"` ZOGRPCORGHEADERKEY string `yaml:"ZO_GRPC_ORG_HEADER_KEY"` ZOROUTETIMEOUT string `yaml:"ZO_ROUTE_TIMEOUT"` ZOLOCALMODESTORAGE string `yaml:"ZO_LOCAL_MODE_STORAGE"` ZONODEROLE string `yaml:"ZO_NODE_ROLE"` ZOINSTANCENAME string `yaml:"ZO_INSTANCE_NAME"` ZODATADIR string `yaml:"ZO_DATA_DIR"` ZODATAWALDIR string `yaml:"ZO_DATA_WAL_DIR"` ZODATASTREAMDIR string `yaml:"ZO_DATA_STREAM_DIR"` ZOWALMEMORYMODEENABLED string `yaml:"ZO_WAL_MEMORY_MODE_ENABLED"` ZOFILEEXTJSON string `yaml:"ZO_FILE_EXT_JSON"` ZOFILEEXTPARQUET string `yaml:"ZO_FILE_EXT_PARQUET"` ZOPARQUETCOMPRESSION string `yaml:"ZO_PARQUET_COMPRESSION"` ZOTIMESTAMPCOL string `yaml:"ZO_TIME_STAMP_COL"` ZOWIDENINGSCHEMAEVOLUTION string `yaml:"ZO_WIDENING_SCHEMA_EVOLUTION"` ZOFEATUREPERTHREADLOCK string `yaml:"ZO_FEATURE_PER_THREAD_LOCK"` ZOFEATUREFULLTEXTONALLFIELDS string `yaml:"ZO_FEATURE_FULLTEXT_ON_ALL_FIELDS"` ZOUIENABLED string `yaml:"ZO_UI_ENABLED"` ZOMETRICSDEDUPENABLED string `yaml:"ZO_METRICS_DEDUP_ENABLED"` ZOTRACINGENABLED string `yaml:"ZO_TRACING_ENABLED"` OTELOTLPHTTPENDPOINT string `yaml:"OTEL_OTLP_HTTP_ENDPOINT"` ZOTRACINGHEADERKEY string `yaml:"ZO_TRACING_HEADER_KEY"` ZOTRACINGHEADERVALUE string `yaml:"ZO_TRACING_HEADER_VALUE"` ZOTELEMETRY string `yaml:"ZO_TELEMETRY"` ZOTELEMETRYURL string `yaml:"ZO_TELEMETRY_URL"` ZOJSONLIMIT string `yaml:"ZO_JSON_LIMIT"` ZOPAYLOADLIMIT string `yaml:"ZO_PAYLOAD_LIMIT"` ZOMAXFILESIZEONDISK string `yaml:"ZO_MAX_FILE_SIZE_ON_DISK"` ZOMAXFILERETENTIONTIME string `yaml:"ZO_MAX_FILE_RETENTION_TIME"` ZOFILEPUSHINTERVAL string `yaml:"ZO_FILE_PUSH_INTERVAL"` ZOFILEMOVETHREADNUM string `yaml:"ZO_FILE_MOVE_THREAD_NUM"` ZOQUERYTHREADNUM string `yaml:"ZO_QUERY_THREAD_NUM"` ZOTSALLOWEDUPTO string `yaml:"ZO_TS_ALLOWED_UPTO"` ZOMETRICSLEADERPUSHINTERVAL string `yaml:"ZO_METRICS_LEADER_PUSH_INTERVAL"` ZOMETRICSLEADERELECTIONINTERVAL string `yaml:"ZO_METRICS_LEADER_ELECTION_INTERVAL"` ZOHEARTBEATINTERVAL string `yaml:"ZO_HEARTBEAT_INTERVAL"` ZOCOMPACTENABLED string `yaml:"ZO_COMPACT_ENABLED"` ZOCOMPACTINTERVAL string `yaml:"ZO_COMPACT_INTERVAL"` ZOCOMPACTMAXFILESIZE string `yaml:"ZO_COMPACT_MAX_FILE_SIZE"` ZOMEMORYCACHEENABLED string `yaml:"ZO_MEMORY_CACHE_ENABLED"` ZOMEMORYCACHECACHELATESTFILES string `yaml:"ZO_MEMORY_CACHE_CACHE_LATEST_FILES"` ZOMEMORYCACHEMAXSIZE string `yaml:"ZO_MEMORY_CACHE_MAX_SIZE"` ZOMEMORYCACHERELEASESIZE string `yaml:"ZO_MEMORY_CACHE_RELEASE_SIZE"` RUSTLOG string `yaml:"RUST_LOG"` ZOCOLSPERRECORDLIMIT string `yaml:"ZO_COLS_PER_RECORD_LIMIT"` ZOETCDPREFIX string `yaml:"ZO_ETCD_PREFIX"` ZOETCDCONNECTTIMEOUT string `yaml:"ZO_ETCD_CONNECT_TIMEOUT"` ZOETCDCOMMANDTIMEOUT string `yaml:"ZO_ETCD_COMMAND_TIMEOUT"` ZOETCDLOCKWAITTIMEOUT string `yaml:"ZO_ETCD_LOCK_WAIT_TIMEOUT"` ZOETCDUSER string `yaml:"ZO_ETCD_USER"` ZOETCDPASSWORD string `yaml:"ZO_ETCD_PASSWORD"` ZOETCDCLIENTCERTAUTH string `yaml:"ZO_ETCD_CLIENT_CERT_AUTH"` ZOETCDTRUSTEDCAFILE string `yaml:"ZO_ETCD_TRUSTED_CA_FILE"` ZOETCDCERTFILE string `yaml:"ZO_ETCD_CERT_FILE"` ZOETCDKEYFILE string `yaml:"ZO_ETCD_KEY_FILE"` ZOETCDDOMAINNAME string `yaml:"ZO_ETCD_DOMAIN_NAME"` ZOETCDLOADPAGESIZE string `yaml:"ZO_ETCD_LOAD_PAGE_SIZE"` ZOSLEDDATADIR string `yaml:"ZO_SLED_DATA_DIR"` ZOSLEDPREFIX string `yaml:"ZO_SLED_PREFIX"` ZOS3SERVERURL string `yaml:"ZO_S3_SERVER_URL"` ZOS3REGIONNAME string `yaml:"ZO_S3_REGION_NAME"` ZOS3BUCKETNAME string `yaml:"ZO_S3_BUCKET_NAME"` ZOS3PROVIDER string `yaml:"ZO_S3_PROVIDER"` ZODATALIFECYCLE string `yaml:"ZO_DATA_LIFECYCLE"` }
type Etcd ¶
type Etcd struct { Enabled bool `yaml:"enabled"` ExternalUrl string `yaml:"externalUrl"` ReplicaCount int `yaml:"replicaCount"` Image Image `yaml:"image"` ExtraEnvVars []NameValue `yaml:"extraEnvVars"` Persistence Persistence `yaml:"persistence"` Auth EtcdAuth `yaml:"auth"` LogLevel string `yaml:"logLevel"` }
type Helm ¶
type Helm struct { AppVersion string ChartName string ChartVersion string Namespace string PostRenderer postrender.PostRenderer ReleaseName string RepositoryURL string Wait bool SetValues []string ValuesFile string }
func (*Helm) DownloadChart ¶
DownloadChart downloads the specified Helm chart from the repository URL and chart version, and returns a pointer to the Chart object or an error if one occurs.
type Ingester ¶
type Ingester struct {
Persistence Persistence `yaml:"persistence"`
}
type MinIO ¶
type MinIO struct { Enabled bool `yaml:"enabled"` Region string `yaml:"region"` RootUser string `yaml:"rootUser"` RootPassword string `yaml:"rootPassword"` DrivesPerNode int `yaml:"drivesPerNode"` Replicas int `yaml:"replicas"` Mode string `yaml:"mode"` Image Image `yaml:"image"` MCImage Image `yaml:"mcImage"` Buckets []Bucket `yaml:"buckets"` Resources Resources `yaml:"resources"` Persistence Persistence `yaml:"persistence"` }
type Persistence ¶
type PodSecurityContext ¶
type ReplicaCount ¶
type SecurityContext ¶
type ServiceAccount ¶
type SetupData ¶
type SetupData struct { Identifier string `json:"identifier"` // unique identifier generated randomly to avoid conflicts BucketName string `json:"bucket_name"` // s3 bucket name ReleaseName string `json:"name"` // helm release name IamRole string `json:"iam_role"` // role name K8s string `json:"k8s"` // k8s cluster name eks, gke, plain S3AccessKey string `json:"s3_access_key"` S3SecretKey string `json:"s3_secret_key"` Namespace string `json:"namespace"` Region string `json:"region"` GCPProjectId string `json:"gcp_project_id"` ClusterName string `json:"cluster_name"` ServiceAccount string `json:"service_account"` InstallMinIO bool `json:"install_minio"` StorageProvider string `json:"storage_provider"` S3ServerURL string `json:"s3_server_url"` }
type VolumePermission ¶
type VolumePermission struct {
Enabled bool `yaml:"enabled"`
}
type ZincObserveValues ¶
type ZincObserveValues struct { Image Image `yaml:"image"` ImagePullSecrets []string `yaml:"imagePullSecrets"` NameOverride string `yaml:"nameOverride"` FullnameOverride string `yaml:"fullnameOverride"` ServiceAccount ServiceAccount `yaml:"serviceAccount"` PodSecurityContext PodSecurityContext `yaml:"podSecurityContext"` SecurityContext SecurityContext `yaml:"securityContext"` ReplicaCount ReplicaCount `yaml:"replicaCount"` Auth Auth `yaml:"auth"` Config Config `yaml:"config"` Service Service `yaml:"service"` Ingress Ingress `yaml:"ingress"` Resources Resources `yaml:"resources"` Autoscaling Autoscaling `yaml:"autoscaling"` CertIssuer CertIssuer `yaml:"certIssuer"` Ingester Ingester `yaml:"ingester"` Etcd Etcd `yaml:"etcd"` MinIO MinIO `yaml:"minio"` }