Skip to content

Commit

Permalink
pull in latest main of kubefirst
Browse files Browse the repository at this point in the history
  • Loading branch information
jarededwards committed Sep 1, 2024
2 parents f9ead3a + 5d71fa1 commit a87700b
Show file tree
Hide file tree
Showing 70 changed files with 480 additions and 448 deletions.
11 changes: 11 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "devcontainer",
"image": "ghcr.io/kubefirst/devcontainers/full",
"features": {},
"customizations": {
"vscode": {
"extensions": [],
"settings": {}
}
}
}
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.go]
indent_style = tab
indent_size = 4

[Makefile]
indent_style = tab
indent_size = 4
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/kubefirst/kubefirst/blob/main/CODE_OF_CONDUCT.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/konstructio/kubefirst/blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Documentations
url: https://github.com/kubefirst/docs/issues/new?assignees=&labels=docs&template=docs.yml&title=%5BDocs%5D%3A+
url: https://github.com/konstructio/kubefirst-docs/issues/new?assignees=&labels=docs&template=docs.yml&title=%5BDocs%5D%3A+
about: Any suggestions related to the documentation, whether it's an issue, missing information, unclear steps or new page that should be created
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/kubefirst/kubefirst/blob/main/CODE_OF_CONDUCT.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/konstructio/kubefirst/blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
16 changes: 16 additions & 0 deletions .github/workflows/check-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Run unit tests

on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Running Golang tests
run: go test -v -short ./...
35 changes: 2 additions & 33 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
uses: actions/checkout@v2
- name: Update version file
run: echo $GITHUB_REF_NAME > VERSION.md
- name: Release kubefirst/gitops-template
run: gh release create -R kubefirst/gitops-template ${{ github.REF_NAME }} --notes "${{ env.RELEASE_NOTES }}"
- name: Release konstructio/gitops-template
run: gh release create -R konstructio/gitops-template ${{ github.REF_NAME }} --generate-notes
goreleaser:
runs-on: ubuntu-latest
steps:
Expand All @@ -41,34 +41,3 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

release-docker:
needs: goreleaser
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
context: ./build
build-args: KUBEFIRST_VERSION=${{ github.REF_NAME }}
file: ./build/Dockerfile
tags: kubefirst/kubefirst:${{ github.REF_NAME }},kubefirst/kubefirst:latest
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: kubefirst/kubefirst
short-description: ${{ github.event.repository.description }}
30 changes: 14 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name: Test CI
name: Test CI

on:
push:
jobs:
on:
push:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Running Tests
run: |
docker-compose -f docker-compose-test.yaml build --no-cache \
&& docker compose -f docker-compose-test.yaml run kubefirst-unit-tests
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Running Docker Compose tests
run: |
docker-compose -f docker-compose-test.yaml build --no-cache \
&& docker compose -f docker-compose-test.yaml run kubefirst-unit-tests
8 changes: 4 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builds:
flags:
- -trimpath
ldflags:
- -X github.com/kubefirst/kubefirst-api/configs.K1Version=v{{.Version}}
- -X github.com/konstructio/kubefirst-api/configs.K1Version=v{{.Version}}

#archives:
# - replacements:
Expand All @@ -35,10 +35,10 @@ changelog:
- '^test:'
brews:
- name: kubefirst
homepage: https://github.com/kubefirst/kubefirst
homepage: https://github.com/konstructio/kubefirst
repository:
owner: kubefirst
name: homebrew-tools
owner: konstructio
name: homebrew-taps
dependencies:
- aws-iam-authenticator
version: 2
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This Code of Conduct applies within all community spaces, and also applies when

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [conduct@kubefirst.com](mailto:conduct@kubefirst.com). All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [conduct@konstruct.io](mailto:conduct@konstruct.io). All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Expand Down
44 changes: 36 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,56 @@ Note we have a [code of conduct](CODE_OF_CONDUCT.md) which needs to be followed

At Kubefirst, we believe that every contribution is valuable, not just the code one, which means we welcome

- [bug reports](https://github.com/kubefirst/kubefirst/issues/new);
- [feature requests](https://github.com/kubefirst/kubefirst/issues/new?assignees=&labels=feature-request&template=feature_request.md&title=);
- [documentations issues reports](https://github.com/kubefirst/kubefirst/issues/new?assignees=&labels=feature-request&template=feature_request.md&title=) like unclear section, missing information or even typos;
- [bug reports](https://github.com/konstructio/kubefirst/issues/new);
- [feature requests](https://github.com/konstructio/kubefirst/issues/new?assignees=&labels=feature-request&template=feature_request.md&title=);
- [documentations issues reports](https://github.com/konstructio/kubefirst/issues/new?assignees=&labels=feature-request&template=feature_request.md&title=) like unclear section, missing information or even typos;
- and, of course, any code contributions to Kubefirst, or the documentations.

Before making a code change, first discuss your idea via an [issue](https://github.com/kubefirst/kubefirst/issues/new/choose). Please check if a feature request or bug report does [already exist](https://github.com/kubefirst/kubefirst/issues/) before creating a new one.
Before making a code change, first discuss your idea via an [issue](https://github.com/konstructio/kubefirst/issues/new/choose). Please check if a feature request or bug report does [already exist](https://github.com/konstructio/kubefirst/issues/) before creating a new one.

## Getting Started with the Code

### Dev containers

A [.devcontainer](https://containers.dev/) configuration is provided to allow for a full-featured development environment.

### Local development

#### The CLI

Kubefirst is created using the [Go Programming Language](https://go.dev). To set up your computer, follow [these steps](https://go.dev/doc/install).

Once Go is installed, you can run Kubefirst from any branch using `go run .`. Go will automatically install the needed modules listed in the [go.mod](go.mod) file. As an example, if you want to create a [local cluster](https://docs.kubefirst.io/kubefirst/local/install.html), the command would be `go run . k3d create`. Note that even if you run kubefirst from `main`, the [gitops-template](https://github.com/kubefirst/gitops-template) version used will be the [latest release](https://github.com/kubefirst/gitops-template/releases). If you also want to use the latest from `main` for the template also, you need to run to use the `--gitops-template-url`, and the `--gitops-template-branch` as follow:
Once Go is installed, you can run Kubefirst from any branch using `go run .`. Go will automatically install the needed modules listed in the [go.mod](go.mod) file. Since Go is a compiled programming language, every time you use the `run` command, Go will compile the code before running it. If you want to save time, you can compile your code using `go build`, which will generate a file named `kubefirst`. You will then be able to run your compiled version with the `./kubefirst` command.

If you want to create a [Civo cluster](https://docs.kubefirst.io/kubefirst/local/install.html), the command would be `go run . civo create`.

#### GitOps Template

Note that even if you run kubefirst from `main`, the [gitops-template](https://github.com/konstructio/gitops-template) version used will be the [latest release](https://github.com/konstructio/gitops-template/releases). If you also want to use the latest from `main` for the template, you need to run to use the `--gitops-template-url`, and the `--gitops-template-branch` as follow:

```shell
go run . k3d create --gitops-template-url https://github.com/kubefirst/gitops-template --gitops-template-branch main
go run . civo create --gitops-template-url https://github.com/konstructio/gitops-template --gitops-template-branch main
```

#### Kubefirst API

If you need to use a specific branch or latest from `main` that wasn't released yet for the [kubefirst-api](https://github.com/konstructio/kubefirst-api) repository, you will need to first run it locally as described in [its documentation](https://github.com/konstructio/kubefirst-api#running-locally). You will also need to run the code from [console](https://github.com/konstructio/console) repository, whether you need to use a specific version of the code or not, as we don't expose the API directly. To do so, follow the [instructions in its README](https://github.com/konstructio/console#setup-instructions). Before running the CLI as mentionned "The CLI" section, you need to export a local variable:

```shell
export K1_CONSOLE_REMOTE_URL="http://localhost:3000"
```

The previous steps will work for all clouds except k3d which use our runtime for now: we have plan to remove this dependencies completely and use the API also to make the code easier to maintain, and less prone to issues. For that step, instead of running the API, and console locally, you simply need to clone the [kubefirst-api](https://github.com/konstructio/kubefirst-api) repository locally, and add the following line in the `go.mod` file:

```go
github.com/konstructio/kubefirst-api vX.X.XX => /path-to/kubefirst-api/
```

Since Go is a compiled programming language, every time you use the `run` command, Go will compile the code before running it. If you want to save time, you can compile your code using `go build`, which will generate a file named `kubefirst`. You will then be able to run your compiled version with the `./kubefirst` command.
Replace `vX.X.XX` with the latest version used in the mode file for the API, and the `/path-to/kubefirst-api/` with the path to the folder of your locally Kubefirst API folder.

## Getting Started with the Documentation

Please check the [CONTRIBUTING.md](https://github.com/kubefirst/docs/blob/main/CONTRIBUTING.md) file from the [docs](https://github.com/kubefirst/docs/) repository.
Please check the [CONTRIBUTING.md](https://github.com/konstructio/kubefirst-docs/blob/main/CONTRIBUTING.md) file from the [docs](https://github.com/konstructio/kubefirst-docs/) repository.

## Help

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
</p>

<p align="center">
<a href="https://github.com/kubefirst/kubefirst/releases"><img title="Release" src="https://img.shields.io/github/v/release/kubefirst/kubefirst"/></a>
<a href="https://github.com/konstructio/kubefirst/releases"><img title="Release" src="https://img.shields.io/github/v/release/kubefirst/kubefirst"/></a>
<!-- <a href=""><img title="Docker builds" src="https://img.shields.io/docker/automated/kubeshop/tracetest"/></a> -->
<a href="https://github.com/kubefirst/kubefirst/releases"><img title="Release date" src="https://img.shields.io/github/release-date/kubefirst/kubefirst"/></a>
<a href="https://github.com/konstructio/kubefirst/releases"><img title="Release date" src="https://img.shields.io/github/release-date/kubefirst/kubefirst"/></a>
</p>

---
Expand Down Expand Up @@ -57,7 +57,7 @@ Feed K-Ray a GitHub star ⭐ above to bookmark our project and keep K-Ray happy!

## Contributions

We want to thank all of our contributors who created a pull request to fix a bug, add a new feature or update the [documentation](https://github.com/kubefirst/docs/). We also value a lot contributions in the form of bug reporting or feature requests: it helps us continuously make kubefirst better. Lastly, helping the users in our Slack community, or helping us share the love on social media are also ways in which you support us tremendously. We know your time is valuable, and we can't thank you enough for everything you do: we wouldn't be where we are without you!
We want to thank all of our contributors who created a pull request to fix a bug, add a new feature or update the [documentation](https://github.com/konstructio/kubefirst-docs/). We also value a lot contributions in the form of bug reporting or feature requests: it helps us continuously make kubefirst better. Lastly, helping the users in our Slack community, or helping us share the love on social media are also ways in which you support us tremendously. We know your time is valuable, and we can't thank you enough for everything you do: we wouldn't be where we are without you!

A special thanks to [DrummyFloyd](https://github.com/DrummyFloyd) who, in addition to adding support for k3s, is a champion all around within our community and the kubefirst project 🫶

Expand Down
2 changes: 1 addition & 1 deletion SUPPORT.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Issues

If you are having an issue with kubefirst, we highly suggest that you share the problem with us on our Slack Community (read the next section for more information). If you are certain it's a bug with our platform, you can create an [issue](https://github.com/kubefirst/kubefirst/issues/new/choose). We'll get back to you as soon as possible.
If you are having an issue with kubefirst, we highly suggest that you share the problem with us on our Slack Community (read the next section for more information). If you are certain it's a bug with our platform, you can create an [issue](https://github.com/konstructio/kubefirst/issues/new/choose). We'll get back to you as soon as possible.

## Questions

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN curl -LO https://s3.us-west-2.amazonaws.com/amazon-eks/1.21.2/2021-07-05/bin
SHELL ["/bin/bash", "-c"]

# Kubefirst cli
RUN curl -LO https://github.com/kubefirst/kubefirst/releases/download/$KUBEFIRST_VERSION/kubefirst_${KUBEFIRST_VERSION:1}_linux_amd64.tar.gz && \
RUN curl -LO https://github.com/konstructio/kubefirst/releases/download/$KUBEFIRST_VERSION/kubefirst_${KUBEFIRST_VERSION:1}_linux_amd64.tar.gz && \
tar -xvzf kubefirst_${KUBEFIRST_VERSION:1}_linux_amd64.tar.gz -C /usr/local/bin/ && \
chmod +x /usr/local/bin/kubefirst && \
rm kubefirst_${KUBEFIRST_VERSION:1}_linux_amd64.tar.gz
Expand Down
14 changes: 8 additions & 6 deletions cmd/akamai/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ package akamai
import (
"fmt"

"github.com/kubefirst/kubefirst-api/pkg/constants"
"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/konstructio/kubefirst-api/pkg/constants"
"github.com/konstructio/kubefirst/internal/common"
"github.com/konstructio/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand All @@ -35,6 +35,7 @@ var (
nodeTypeFlag string
nodeCountFlag string
installCatalogApps string
installKubefirstProFlag bool

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand All @@ -55,7 +56,7 @@ func NewCommand() *cobra.Command {
Long: "kubefirst akamai",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about akamai in kubefirst, run:")
fmt.Println(" kubefirst akamai --help")
fmt.Println(" kubefirst beta akamai --help")

if progress.Progress != nil {
progress.Progress.Quit()
Expand Down Expand Up @@ -97,9 +98,10 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&githubOrgFlag, "github-org", "", "the GitHub organization for the new gitops and metaphor repositories - required if using github")
createCmd.Flags().StringVar(&gitlabGroupFlag, "gitlab-group", "", "the GitLab group for the new gitops and metaphor projects - required if using gitlab")
createCmd.Flags().StringVar(&gitopsTemplateBranchFlag, "gitops-template-branch", "", "the branch to clone for the gitops-template repository")
createCmd.Flags().StringVar(&gitopsTemplateURLFlag, "gitops-template-url", "https://github.com/kubefirst/gitops-template.git", "the fully qualified url to the gitops-template repository to clone")
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma seperated values to install after provision")
createCmd.Flags().StringVar(&gitopsTemplateURLFlag, "gitops-template-url", "https://github.com/konstructio/gitops-template.git", "the fully qualified url to the gitops-template repository to clone")
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma separated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")

return createCmd
}
Expand Down
19 changes: 9 additions & 10 deletions cmd/akamai/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import (
"os"
"strings"

internalssh "github.com/kubefirst/kubefirst-api/pkg/ssh"
pkg "github.com/kubefirst/kubefirst-api/pkg/utils"
"github.com/kubefirst/kubefirst/internal/catalog"
"github.com/kubefirst/kubefirst/internal/cluster"
"github.com/kubefirst/kubefirst/internal/gitShim"
"github.com/kubefirst/kubefirst/internal/launch"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/kubefirst/kubefirst/internal/provision"
"github.com/kubefirst/kubefirst/internal/utilities"
internalssh "github.com/konstructio/kubefirst-api/pkg/ssh"
pkg "github.com/konstructio/kubefirst-api/pkg/utils"
"github.com/konstructio/kubefirst/internal/catalog"
"github.com/konstructio/kubefirst/internal/cluster"
"github.com/konstructio/kubefirst/internal/gitShim"
"github.com/konstructio/kubefirst/internal/launch"
"github.com/konstructio/kubefirst/internal/progress"
"github.com/konstructio/kubefirst/internal/provision"
"github.com/konstructio/kubefirst/internal/utilities"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -50,7 +50,6 @@ func createAkamai(cmd *cobra.Command, args []string) error {
utilities.CreateK1ClusterDirectory(clusterNameFlag)

gitAuth, err := gitShim.ValidateGitCredentials(cliFlags.GitProvider, cliFlags.GithubOrg, cliFlags.GitlabGroup)

if err != nil {
progress.Error(err.Error())
return nil
Expand Down
Loading

0 comments on commit a87700b

Please sign in to comment.