The Impact Framework provides a helm chart, making it easy to run on a Kubernetes cluster.
The helm chart is provided in OCI format on GitHub Container Registry, so you need to specify oci: when referencing the chart.
$ helm install if oci://ghcr.io/green-software-foundation/charts/ifFor security reasons, three builtin plugins (Shell, CSVImport, CSVLookup) are disabled by default, but they can be enabled by specifying in values.yaml.
# enable all builtin plugins
disabledPlugins: []You can also specify in values.yaml to install external plugins when the pod starts.
additionalPlugins:
- carbon-intensity-plugin
- Green-Software-Foundation/if-github-pluginIf an .npmrc file is required, you can create a Secret by specifying it in the npmrc section of the values.yaml file.
additionalPlugins:
- Green-Software-Foundation/community-plugins
- danuw/if-casdk-plugin
npmrc: |
//npm.pkg.github.com/:_authToken=<YOUR_PERSONAL_ACCESS_TOKEN>
@Green-Software-Foundation:registry=https://npm.pkg.github.com/You can also extract the access token as an environment variable.
additionalPlugins:
- Green-Software-Foundation/community-plugins
- danuw/if-casdk-plugin
npmrc: |
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
@Green-Software-Foundation:registry=https://npm.pkg.github.com/
env:
secret:
GITHUB_TOKEN: <YOUR_PERSONAL_ACCESS_TOKEN>By creating and using a container image with external plugins pre-installed, you can use external plugins without installing them at pod startup, which reduces pod startup time.
values.yaml for using my-image-repository:my-version as the container image:
image:
repository: my-image-repository
tag: my-versionBy default, a ClusterIP service is deployed, so you can access the API server by running kubectl port-forward.
$ kubectl port-forward svc/if 3000:3000 &
$ curl -H "Content-Type: application/yaml" --data-binary @manifest.yaml http://localhost:3000/v1/runYou can access the API server from outside the cluster without using port-forward by changing the service type to NodePort or LoadBalancer.
values.yaml for the NodePort:
# Using NodePort
service:
type: NodePort
nodePort: 32000values.yaml for the LoadBalancer:
# Using LoadBalancer
service:
type: LoadBalancer