Skip to main content

Kubectl

Kubectl is the Kubernetes command-line tool that allows you to run commands against Kubernetes clusters.

🚀 Usage​

Add the following command to your CI configuration file:

fluentci run --wasm kubectl setup

Commands​

NameDescription
setupInstalls a specific version of Kubectl.
applyApply a configuration to a resource by filename.

Code Examples​

Add fluentci-pdk crate to your Cargo.toml:

[dependencies]
fluentci-pdk = "0.2.1"

Use the following code to call a module function:

use fluentci_pdk::dag;

// ...

dag().call(
"https://pkg.fluentci.io/[email protected]?wasm=1",
"setup",
vec!["latest"],
)?;

CI/CD Integration​

The following example shows how to integrate FluentCI with popular CI providers to setup Kubectl:

ci.yml
name: ci
on:
push:
branches:
- main
jobs:
tasks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Remove preinstalled kubectl
run: |
sudo rm -rf `which kubectl`
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v5
- name: Install kubectl
run: fluentci run --wasm kubectl setup