Skip to content

Commit 53d1bb0

Browse files
committed
Configure Kubernetes deployment
Signed-off-by: Stefan Prodan <[email protected]>
1 parent 30f0f87 commit 53d1bb0

29 files changed

+109
-380
lines changed

.github/actions/kubebuilder/Dockerfile

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/actions/kubebuilder/action.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/actions/kubebuilder/entrypoint.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88

99
jobs:
1010
unit:
@@ -22,9 +22,9 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@v2
2424
with:
25-
go-version: 1.14.x
25+
go-version: 1.15.x
2626
- name: Setup Kubebuilder
27-
uses: ./.github/actions/kubebuilder
27+
uses: fluxcd/pkg/actions/kubebuilder@main
2828
- name: Run tests
2929
run: make test
3030
env:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.15 as builder
1+
FROM golang:1.15-alpine as builder
22

33
WORKDIR /workspace
44

@@ -14,7 +14,7 @@ COPY main.go main.go
1414
COPY controllers/ controllers/
1515

1616
# build
17-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o source-watcher main.go
17+
RUN CGO_ENABLED=0 go build -a -o source-watcher main.go
1818

1919
FROM alpine:3.12
2020

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ uninstall: manifests
3535

3636
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
3737
deploy: manifests
38-
cd config/manager && kustomize edit set image controller=${IMG}
38+
cd config/manager && kustomize edit set image source-watcher=${IMG}
3939
kustomize build config/default | kubectl apply -f -
4040

4141
# Generate manifests e.g. CRD, RBAC etc.
4242
manifests: controller-gen
43-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
43+
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=source-reader webhook paths="./..." output:crd:artifacts:config=config/crd/bases
4444

4545
# Run go fmt against code
4646
fmt:

config/certmanager/certificate.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

config/certmanager/kustomization.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

config/certmanager/kustomizeconfig.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

config/default/kustomization.yaml

Lines changed: 9 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,9 @@
1-
# Adds namespace to all resources.
2-
namespace: source-watcher-system
3-
4-
# Value of this field is prepended to the
5-
# names of all resources, e.g. a deployment named
6-
# "wordpress" becomes "alices-wordpress".
7-
# Note that it should also match with the prefix (text before '-') of the namespace
8-
# field above.
9-
namePrefix: source-watcher-
10-
11-
# Labels to add to all resources and selectors.
12-
#commonLabels:
13-
# someName: someValue
14-
15-
bases:
16-
- ../crd
17-
- ../rbac
18-
- ../manager
19-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
20-
# crd/kustomization.yaml
21-
#- ../webhook
22-
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
23-
#- ../certmanager
24-
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
25-
#- ../prometheus
26-
27-
patchesStrategicMerge:
28-
# Protect the /metrics endpoint by putting it behind auth.
29-
# If you want your controller-manager to expose the /metrics
30-
# endpoint w/o any authn/z, please comment the following line.
31-
- manager_auth_proxy_patch.yaml
32-
33-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
34-
# crd/kustomization.yaml
35-
#- manager_webhook_patch.yaml
36-
37-
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
38-
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
39-
# 'CERTMANAGER' needs to be enabled to use ca injection
40-
#- webhookcainjection_patch.yaml
41-
42-
# the following config is for teaching kustomize how to do var substitution
43-
vars:
44-
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
45-
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
46-
# objref:
47-
# kind: Certificate
48-
# group: cert-manager.io
49-
# version: v1alpha2
50-
# name: serving-cert # this name should match the one in certificate.yaml
51-
# fieldref:
52-
# fieldpath: metadata.namespace
53-
#- name: CERTIFICATE_NAME
54-
# objref:
55-
# kind: Certificate
56-
# group: cert-manager.io
57-
# version: v1alpha2
58-
# name: serving-cert # this name should match the one in certificate.yaml
59-
#- name: SERVICE_NAMESPACE # namespace of the service
60-
# objref:
61-
# kind: Service
62-
# version: v1
63-
# name: webhook-service
64-
# fieldref:
65-
# fieldpath: metadata.namespace
66-
#- name: SERVICE_NAME
67-
# objref:
68-
# kind: Service
69-
# version: v1
70-
# name: webhook-service
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: source-system
4+
resources:
5+
- ../rbac
6+
- ../manager
7+
- github.com/fluxcd/source-controller/config//crd?ref=v0.2.0
8+
- github.com/fluxcd/source-controller/config//manager?ref=v0.2.0
9+
- namespace.yaml

0 commit comments

Comments
 (0)