diff --git a/.github/workflows/cron-sync-core.yaml b/.github/workflows/cron-sync-core.yaml deleted file mode 100644 index 2dacc3a..0000000 --- a/.github/workflows/cron-sync-core.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: Sync latest core release -# We pull from here to prevent too much coupling to the core repo. -on: - workflow_dispatch: - schedule: - - cron: "0 19 * * *" - -jobs: - sync-core-release: - runs-on: ubuntu-latest - permissions: - contents: read - # Not required as we use CI_PAT directly so we can trigger workflows - # pull-requests: write - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.CI_PAT }} - - - id: get-core-release - run: | - curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/calyptia/core/releases/latest - LATEST_RELEASE_TAG=$(curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/calyptia/core/releases/latest|jq -r .tag_name) - echo "Found tag for latest release: $LATEST_RELEASE_TAG" - echo "tag=$LATEST_RELEASE_TAG" >> $GITHUB_OUTPUT - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.CI_PAT }} - - # Note we assume a simple version update so no chart version update - - name: Run the sed on the chart file - run: | - if [[ "$NEW_CALYPTIA_CORE_VERSION" =~ ^v?([0-9]+\.[0-9]+\.[0-9]+)$ ]] ; then - NEW_CALYPTIA_CORE_VERSION=${BASH_REMATCH[1]} - echo "Valid version string: $NEW_CALYPTIA_CORE_VERSION" - else - echo "ERROR: Invalid semver string: $NEW_CALYPTIA_CORE_VERSION" - exit 1 - fi - sed -i "s/^version.*$/version: $NEW_CALYPTIA_CORE_VERSION/g" ./charts/core/Chart.yaml - sed -i "s/^appVersion.*$/appVersion: $NEW_CALYPTIA_CORE_VERSION/g" ./charts/core/Chart.yaml - echo "chart version=$NEW_CALYPTIA_CORE_VERSION" >> $GITHUB_OUTPUT - echo "app version=$NEW_CALYPTIA_CORE_VERSION" >> $GITHUB_OUTPUT - env: - NEW_CALYPTIA_CORE_VERSION: ${{ steps.get-core-release.outputs.tag }} - shell: bash - - - name: Generate PR - uses: peter-evans/create-pull-request@v5 - with: - commit-message: 'ci: update to latest core version' - signoff: true - branch: ci_update_core - delete-branch: true - title: 'ci: update to latest core version' - # We need workflows permission so have to use the CI_PAT - token: ${{ secrets.CI_PAT }} - labels: ci,automerge - body: | - Update core version - - Created by ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - - Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - draft: false diff --git a/.github/workflows/cron-sync-lts.yaml b/.github/workflows/cron-sync-lts.yaml index 40ad91a..e4aac52 100644 --- a/.github/workflows/cron-sync-lts.yaml +++ b/.github/workflows/cron-sync-lts.yaml @@ -19,8 +19,8 @@ jobs: - id: get-fb-release run: | - curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/calyptia/calyptia-fluent-bit/releases/latest - LATEST_RELEASE_TAG=$(curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/calyptia/calyptia-fluent-bit/releases/latest|jq -r .tag_name) + curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/chronosphereio/calyptia-calyptia-fluent-bit/releases/latest + LATEST_RELEASE_TAG=$(curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/chronosphereio/calyptia-calyptia-fluent-bit/releases/latest|jq -r .tag_name) echo "Found tag for latest release: $LATEST_RELEASE_TAG" echo "tag=$LATEST_RELEASE_TAG" >> $GITHUB_OUTPUT shell: bash diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6e168de..5122131 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -75,3 +75,10 @@ jobs: - Created by ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request draft: false + + - name: Check outputs + if: ${{ steps.cpr.outputs.pull-request-number }} + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + shell: bash diff --git a/README.md b/README.md index 69b2677..d92162d 100644 --- a/README.md +++ b/README.md @@ -24,82 +24,3 @@ To uninstall the chart: ```shell helm delete my- ``` - -## Current supported charts - -### Calyptia-core - -First, get a project token from [Calyptia Cloud](https://cloud.calyptia.com/) -To install a calyptia-core instance on the default namespace, run with: - -```shell -helm install calyptia-core calyptia/core --set project_token= -``` - -YAML-only install - -Calyptia Core can be installed without Helm as well using equivalent YAML. - -The template YAML is auto-generated on each release for you as [`install-core.yaml.tmpl`](./install-core.yaml.tmpl). -It requires the definition of the following environment variables: - -* `PROJECT_TOKEN` - the Calyptia Core token to use. -* `CORE_INSTANCE_NAME` - the name of the Calyptia Core instance to create. -* `CORE_INSTANCE_TAGS` - a comma-separated list of tags to add to the Calyptia Core instance. - -With these variables defined we can then use substitution in the YAML like so: - -```shell -$ export PROJECT_TOKEN=XXX -$ export CORE_INSTANCE_TAGS=test -$ export CORE_INSTANCE_NAME=test-instance -$ curl -sSfL https://raw.githubusercontent.com/calyptia/charts/master/install-core.yaml.tmpl | envsubst '$PROJECT_TOKEN,$CORE_INSTANCE_TAGS,$CORE_INSTANCE_NAME' | kubectl apply -f - -serviceaccount/calyptia-core created -clusterrole.rbac.authorization.k8s.io/calyptia-core created -clusterrolebinding.rbac.authorization.k8s.io/calyptia-core created -deployment.apps/calyptia-core created -``` - -In the example above we also show how you can set the Calyptia Core instance name (if not present then it will be auto-generated) and the Calyptia Core instance tags. - -**The recommendation would always be to download and verify directly without applying initially for security purposes.** - -An all-in-one command to do it is therefore (replacing `XXX` with your token, and changing the name/tags as appropriate) on Linux or compatible platforms with `envsubst` available: - -```shell -export PROJECT_TOKEN=XXX;export CORE_INSTANCE_TAGS=onelineinstall;export CORE_INSTANCE_NAME=$HOSTNAME;curl -sSfL https://raw.githubusercontent.com/calyptia/charts/master/install-core.yaml.tmpl | envsubst '$PROJECT_TOKEN,$CORE_INSTANCE_TAGS,$CORE_INSTANCE_NAME' | kubectl apply -f - -``` - -For Windows or other platforms without envsubst available the YAML template can be downloaded and the PROJECT_TOKEN substituted manually or in some other fashion. - -#### Enable specific functionality on Calyptia Core - -To enable the experimental cluster logging functionality: - -```shell -helm install --set-string cluster_logging=true --set project_token= -``` - -To add tags to the calyptia-core instance: - -```shell -helm install --set-string core_instance_tags='one\,two' --set project_token= -``` - -Note that a valid project token is required. - -#### Install core-operator with core-instance - -core-operator - -```shell -helm install core-operator calyptia/core-operator -``` - -core-instance - -```shell -helm install core-inst calyptia/core-instance --set coreInstance= --set cloudToken= -``` - -Token can be retrieved from the [Core UI](https://core.calyptia.com) under "Settings" diff --git a/install-core.yaml.tmpl b/install-core.yaml.tmpl deleted file mode 100644 index f403e25..0000000 --- a/install-core.yaml.tmpl +++ /dev/null @@ -1,126 +0,0 @@ ---- -# Source: core/templates/serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: calyptia-core - labels: - helm.sh/chart: core-1.4.1 - app.kubernetes.io/name: core - app.kubernetes.io/instance: calyptia - app.kubernetes.io/version: "1.4.1" - app.kubernetes.io/managed-by: Helm ---- -# Source: core/templates/clusterrole.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: calyptia-core - labels: - helm.sh/chart: core-1.4.1 - app.kubernetes.io/name: core - app.kubernetes.io/instance: calyptia - app.kubernetes.io/version: "1.4.1" - app.kubernetes.io/managed-by: Helm -rules: - - apiGroups: - - "" - - "apps" - resources: - - namespaces - - deployments - - replicasets - - daemonsets - - pods - - services - - configmaps - - deployments/scale - - secrets - verbs: - - get - - list - - create - - delete - - patch - - update - - watch - - deletecollection ---- -# Source: core/templates/clusterrolebinding.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: calyptia-core - labels: - helm.sh/chart: core-1.4.1 - app.kubernetes.io/name: core - app.kubernetes.io/instance: calyptia - app.kubernetes.io/version: "1.4.1" - app.kubernetes.io/managed-by: Helm -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: calyptia-core -subjects: - - kind: ServiceAccount - name: calyptia-core - namespace: default ---- -# Source: core/templates/deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: calyptia-core - labels: - helm.sh/chart: core-1.4.1 - app.kubernetes.io/name: core - app.kubernetes.io/instance: calyptia - app.kubernetes.io/version: "1.4.1" - app.kubernetes.io/managed-by: Helm -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: core - app.kubernetes.io/instance: calyptia - template: - metadata: - labels: - app.kubernetes.io/name: core - app.kubernetes.io/instance: calyptia - spec: - serviceAccountName: calyptia-core - automountServiceAccountToken: true - securityContext: - {} - containers: - - name: core - securityContext: - {} - args: - - -debug=true - image: "ghcr.io/calyptia/core:1.4.1" - imagePullPolicy: Always - env: - - name: CORE_INSTANCE_TAGS - value: $CORE_INSTANCE_TAGS - - name: CORE_INSTANCE_ENVIRONMENT - value: default - - name: CORE_INSTANCE_CLUSTER_LOGGING - value: "false" - - name: AGGREGATOR_NAME - value: $CORE_INSTANCE_NAME - - name: PROJECT_TOKEN - value: $PROJECT_TOKEN - - name: AGGREGATOR_FLUENTBIT_CLOUD_URL - value: https://cloud-api.calyptia.com/ - - name: AGGREGATOR_FLUENTBIT_TLS_VERIFY - value: "on" - - name: AGGREGATOR_FLUENTBIT_TLS - value: "on" - - name: AGGREGATOR_SIDECAR_URL - value: "nats://tcp-4222-nats-messaging.default.svc.local:4222" - - name: CORE_INSTANCE_SERVICE_ACCOUNT_NAME - value: "calyptia-core" - resources: - {}