Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@npm-wharf/fabrik8
Advanced tools
provision a new Kubernetes cluster and deploy software to it from a single API
Provision and deploy cluster specifications from a single API.
fabrik8
was designed to handle initialization of Kubernetes clusters with an initial, known-set of software using a mcgonagall
specification.
It works well in environments where you might want ephemeral clusters, clusters on demand (think single tenancy), or think about things like automation and disaster recovery a lot.
fabrik8
is not a CD solution (at least not presently). It is not meant to be run continuously against the same target (it cannot guarantee 100% idempotence, but makes a best effort to be). Running fabrik8
multiple times may yield unexpected results. For CD solutions, see hikaru
.
fabrik8 uses kubeform
, mcgonagall
, and hikaru
to provision clusters, transform specifications, and deploy them to the newly created cluster.
As noted in kubeform
, many of the environment variables are cloud provider specific and will only be necessary when using a specific provider.
Variable | Description | Default |
---|---|---|
KUBE_SERVICE | The backing service to use for the request | 'GKE' |
GOOGLE_APPLICATION_CREDENTIALS | Path to Google API credentials file | '' |
GOOGLE_ORGANIZATION_ID | Google Organization Id to create projects under | '' |
GOOGLE_BILLING_ID | Google Billing Account Id to associate with project | '' |
initialize(cluster, specification, data|onData)
The initialize
call requires three arguments and returns a promise.
cluster
This will be the same as the kubeform
cluster specification (not repeated here).
specification
The specification argument must either be a file path to the spec or a URL to the GitHub repo where the mcgonagall specification is located.
data|onData
The third argument can either be a hash of data required to satisfy tokens present in the specification, or a function that is passed a list of tokens required by the specification. If a function is provided, the result expected is a promise providing a hash of data.
function getTokens (tokenList) {
// return token hash as a promise
return Promise.resolve({
tokenName: tokenValue
})
}
To control how cluster data will be merged with the mcgonagall specification data, the hash should include a function named onCluster
. It will be passed the cluster information returned from kubeform
and the data. The signature is:
function onCluster (data, clusterInfo) {
// assign new properties to data from clusterInfo as needed
data.someValue = clusterInfo.someSourceValue
}
Without passing this function, all cluster details will be set as children of a .cluster
property.
Returns the cluster information from kubeform
and the data used to satisfy the specification (under the property specData
).
The expectation is that this information will be stored for future retrieval when interacting with the cluster. fabrik8
does not do anything beyond coordinate calls between libraries in order to simplify creation of fully functional
It is recommended that sensitive data (like the Kubernetes admin password) is stored separately in Vault or encrypted before storage.
A CLI is also provided for fabrik8
that allows you to invoke the API from the command line:
fabrik8 create [--name name] [--url url] --spec ./path/to/spec
Creates a full cluster, reading defaults and existing configuration securely from centralized cluster-info. The only options that are required are configuration for cluster-info, a name or cluster url, and the path to a McGonagall specification. If re-running, only a name is required -- options will be re-read from cluster-info.
--url
, -u
the url of the cluster you wish to create, e.g. mycluster.npme.io
--name
, -n
the name of the cluster. Can be inferred from the url--domain
the domain of the cluster. Can be inferred from the url. Defaults to whatever is specified in the cluster-info defaults, if only a name is provided.--projectId
the name of the gke project to use. Can be inferred from the cluster name--environment
the environment of the cluster, e.g. development, production--specification
, -m
, --spec
the path or URL to the mcgonagall specification--verbose
output verbose logging (status check output for hikaru)--redisUrl
the url of the redis containing cluster information. Can also be set through the REDIS_URL
environment variable--vaultHost
the host of the vault server containing sensitive cluster information, auth data, and defaults. Can also be set through the VAULT_HOST
environment variable--vaultToken
an auth token for the vault server. Can also be set through the VAULT_TOKEN
environment variable--provider
the cloud provider to use, defaults to KUBE_SERVICE
environment variable or GKE
--output
, -o
file to write cluster-info to, for debuggingValues from the defaults can also be overridden as command line args, by prefixing the key with --arg-
, e.g. --arg-cluster.worker.memory 26GB
, or --arg-common.zones eu-central1-a
. Look at the cluster-info defaults for a list of values that can be overridden.
Command line arguments take precedence over saved cluster-info, which take precedence over default cluster-info. Cluster info-will be saved everytime you run fabrik8
, so re-running fabrik8 create
can be used to change values.
fabrik8 init ./path/to/config -a ./path/to/authFile -s ./path/to/spec -f ./path/to/data -p gke
DEPRECATED
Similar to a blend of CLIs from its component libraries, fabrik8
requires the following arguments:
./path/to/config
: configuration to base cluster provisioning on-a
, --auth
: the authfile to use when authenticating with the cloud provider-m
, --spec
: the path or URL to the mcgonagall specification-f
, --data
: the path to the data file to supply values for specification tokens-o
, --output
: the file to write data about the new cluster to (defaults to cluster-{date-time}.json
)-p
, --provider
: the cloud provider to use-s
, --scale
: a scale factor (if available in the spec)-t
, --tokens
: where to write out all data used to populate the specification-v
, --apiVersion
: the Kubernetes API version (will attempt to detect the default version)--verbose
: verbose logging, defaults to falseFAQs
provision a new Kubernetes cluster and deploy software to it from a single API
The npm package @npm-wharf/fabrik8 receives a total of 3 weekly downloads. As such, @npm-wharf/fabrik8 popularity was classified as not popular.
We found that @npm-wharf/fabrik8 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.