Skip to content

Commit

Permalink
Merge pull request fluxcd#67 from dweomer/initial-move-to-k3s-io
Browse files Browse the repository at this point in the history
correct self-referential go import paths
  • Loading branch information
dweomer authored Nov 13, 2020
2 parents b4d49c7 + 349c48e commit 3559ca8
Show file tree
Hide file tree
Showing 43 changed files with 273 additions and 141 deletions.
108 changes: 57 additions & 51 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
kind: pipeline
type: docker
name: amd64

platform:
Expand All @@ -8,60 +9,60 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.5.0
commands:
- dapper ci
volumes:
- name: docker
path: /var/run/docker.sock

- name: e2e test
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.5.0
commands:
- dapper e2e
- dapper e2e
volumes:
- name: docker
path: /var/run/docker.sock
- name: docker
path: /var/run/docker.sock

- name: github_binary_release
image: plugins/github-release
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-amd64.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
- dist/artifacts/*
prerelease: true
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/helm-controller"
tag: "${DRONE_TAG}-amd64"
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: k3s-io/helm-controller
tag: "${DRONE_TAG}-${DRONE_STAGE_ARCH}"
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
Expand All @@ -70,6 +71,7 @@ volumes:

---
kind: pipeline
type: docker
name: arm64

platform:
Expand All @@ -78,7 +80,7 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.5.0
commands:
- dapper ci
volumes:
Expand All @@ -90,40 +92,40 @@ steps:
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-arm64.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
- dist/artifacts/*
prerelease: true
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/helm-controller"
tag: "${DRONE_TAG}-arm64"
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: k3s-io/helm-controller
tag: "${DRONE_TAG}-${DRONE_STAGE_ARCH}"
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
Expand All @@ -132,6 +134,7 @@ volumes:

---
kind: pipeline
type: docker
name: arm

platform:
Expand All @@ -140,7 +143,7 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.5.0
commands:
- dapper ci
volumes:
Expand All @@ -152,40 +155,40 @@ steps:
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-arm.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
- dist/artifacts/*
prerelease: true
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/helm-controller"
tag: "${DRONE_TAG}-arm"
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: k3s-io/helm-controller
tag: "${DRONE_TAG}-${DRONE_STAGE_ARCH}"
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
Expand All @@ -194,6 +197,7 @@ volumes:

---
kind: pipeline
type: docker
name: manifest

platform:
Expand All @@ -209,21 +213,23 @@ steps:
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm
target: "rancher/helm-controller:${DRONE_TAG}"
template: "rancher/helm-controller:${DRONE_TAG}-ARCH"
- linux/amd64
- linux/arm64
- linux/arm
target: "k3s-io/helm-controller:${DRONE_TAG}"
template: "k3s-io/helm-controller:${DRONE_TAG}-ARCH"
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

depends_on:
- amd64
- arm64
- arm

...
4 changes: 2 additions & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13.4-alpine3.10
FROM golang:1.13.15-alpine3.12

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
Expand All @@ -22,7 +22,7 @@ RUN curl -L https://github.com/rancher/rke/releases/download/v1.1.4/rke_linux-$A

ENV GO111MODULE off
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_SOURCE /go/src/github.com/rancher/helm-controller/
ENV DAPPER_SOURCE /go/src/github.com/k3s-io/helm-controller/
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
helm-controller
========

_NOTE: this repository has been recently (2020-10-06) moved out of the github.com/rancher org to github.com/k3s-io
supporting the [acceptance of K3s as a CNCF sandbox project](https://github.com/cncf/toc/pull/447)_.

---

A simple way to manage helm charts with a Custom Resource Definitions in k8s.

## Manifests and Deploying
The `./manifests` folder contains useful YAML manifests to use for deploying and developing the Helm Controller. This simply YAML deployment creates a HelmChart CRD + a Deployment using the `rancher/helm-controller` container. The YAML might need some modifications for your environment so read below for Namespaced vs Cluster deployments and how to use them properly.
The `./manifests` folder contains useful YAML manifests to use for deploying and developing the Helm Controller. This simply YAML deployment creates a HelmChart CRD + a Deployment using the `k3s-io/helm-controller` container. The YAML might need some modifications for your environment so read below for Namespaced vs Cluster deployments and how to use them properly.

#### Namespaced Deploys
Use the `deploy-namespaced.yaml` to create a namespace and add the Helm Controller and CRD to that namespace locking down the Helm Controller to only see changes to CRDs within that namespace. This is defaulted to `helm-controller` so update the YAML to your needs before running `kubectl create`
Expand All @@ -26,7 +32,7 @@ go build -o ./bin/helm-controller
```

#### docker/k8s
An easy way to get started with docker/k8s is to install docker for windows/mac and use the included k8s cluster. Once functioning you can easily build locally and get a docker container to pull the Helm Controller container and run it in k8s. Use `make` to launch a linux container and build to create a container. Use the `./manifests/deploy-*.yaml` definitions to get it into your cluster and update `containers.image` to point to your locally image e.g. `image: rancher/helm-controller:dev`
An easy way to get started with docker/k8s is to install docker for windows/mac and use the included k8s cluster. Once functioning you can easily build locally and get a docker container to pull the Helm Controller container and run it in k8s. Use `make` to launch a linux container and build to create a container. Use the `./manifests/deploy-*.yaml` definitions to get it into your cluster and update `containers.image` to point to your locally image e.g. `image: k3s-io/helm-controller:dev`

#### Options and Usage
Use `./bin/helm-controller help` to get full usage details. The outside of a k8s Pod the most important options are `--kubeconfig` or `--masterurl` or it will not run. All options have corresponding ENV variables you could use.
Expand All @@ -47,4 +53,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/rancher/helm-controller
module github.com/k3s-io/helm-controller

go 1.13

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"context"
"os"

helmv1 "github.com/rancher/helm-controller/pkg/generated/controllers/helm.cattle.io"
helmcontroller "github.com/rancher/helm-controller/pkg/helm"
helmv1 "github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io"
helmcontroller "github.com/k3s-io/helm-controller/pkg/helm"
batchv1 "github.com/rancher/wrangler-api/pkg/generated/controllers/batch"
corev1 "github.com/rancher/wrangler-api/pkg/generated/controllers/core"
rbacv1 "github.com/rancher/wrangler-api/pkg/generated/controllers/rbac"
Expand Down
2 changes: 1 addition & 1 deletion manifests/deploy-cluster-scoped.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ spec:
spec:
containers:
- name: helm-controller
image: rancher/helm-controller:v0.1.2
image: k3s-io/helm-controller:v0.1.2
command: ["helm-controller"]
2 changes: 1 addition & 1 deletion manifests/deploy-namespaced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ spec:
spec:
containers:
- name: helm-controller
image: rancher/helm-controller:v0.1.2
image: k3s-io/helm-controller:v0.1.2
command: ["helm-controller"]
args: ["--namespace", "helm-controller"]
2 changes: 1 addition & 1 deletion pkg/apis/helm.cattle.io/v1/zz_generated_register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/codegen/main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package main

import (
v1 "github.com/rancher/helm-controller/pkg/apis/helm.cattle.io/v1"
v1 "github.com/k3s-io/helm-controller/pkg/apis/helm.cattle.io/v1"
controllergen "github.com/rancher/wrangler/pkg/controller-gen"
"github.com/rancher/wrangler/pkg/controller-gen/args"
)

func main() {
controllergen.Run(args.Options{
OutputPackage: "github.com/rancher/helm-controller/pkg/generated",
OutputPackage: "github.com/k3s-io/helm-controller/pkg/generated",
Boilerplate: "hack/boilerplate.go.txt",
Groups: map[string]args.Group{
"helm.cattle.io": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/generated/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/generated/clientset/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3559ca8

Please sign in to comment.