Skip to content

Commit 22acb43

Browse files
authored
Merge branch 'main' into add-liveness-and-readiness-probes-insta
2 parents 0d28729 + 9098de3 commit 22acb43

File tree

7 files changed

+145
-51
lines changed

7 files changed

+145
-51
lines changed

.github/workflows/instascale-release.yml

+21-11
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ on:
66
workflow_dispatch:
77
inputs:
88
tag:
9-
description: 'Release tag'
9+
description: 'Release tag (for example: v0.0.0)'
1010
required: true
11-
default: 'v0.0.0-dev'
1211
mcad-version:
13-
description: 'Published version of multi-cluster-app-dispatcher to be used as a dependency for InstaScale'
12+
description: 'Published version of multi-cluster-app-dispatcher to be used as a dependency for InstaScale (for example: v0.0.0)'
1413
required: true
15-
default: 'v0.0.0-dev'
16-
is-latest:
17-
description: 'Select if the built image should be tagged as latest'
14+
is-stable:
15+
description: 'Select if the built image should be tagged as stable'
1816
required: true
1917
type: boolean
2018
quay-organization:
@@ -33,6 +31,18 @@ jobs:
3331
steps:
3432
- uses: actions/checkout@v3
3533

34+
- name: Verify that release doesn't exist yet
35+
shell: bash {0}
36+
run: |
37+
gh release view ${{ github.event.inputs.tag }}
38+
status=$?
39+
if [[ $status -eq 0 ]]; then
40+
echo "Release ${{ github.event.inputs.tag }} already exists."
41+
exit 1
42+
fi
43+
env:
44+
GITHUB_TOKEN: ${{ github.TOKEN }}
45+
3646
- name: Set up Go
3747
uses: actions/setup-go@v3
3848
with:
@@ -59,11 +69,11 @@ jobs:
5969
run: |
6070
make image-build -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:${{ github.event.inputs.tag }}
6171
make image-push -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:${{ github.event.inputs.tag }}
62-
- name: Image Push as latest tag
63-
if: ${{ inputs.is-latest }}
72+
- name: Image Push as stable tag
73+
if: ${{ inputs.is-stable }}
6474
run: |
65-
podman tag quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:${{ github.event.inputs.tag }} quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:latest
66-
make image-push -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:latest
75+
podman tag quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:${{ github.event.inputs.tag }} quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:stable
76+
make image-push -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:stable
6777
6878
# Update dependencies
6979
- name: Commit go.mod and go.sum changes back to repository
@@ -75,7 +85,7 @@ jobs:
7585
# Create a release in InstaScale
7686
- name: Creates a release in GitHub
7787
run: |
78-
gh release create ${{ github.event.inputs.tag }} --generate-notes
88+
gh release create ${{ github.event.inputs.tag }} --target ${{ github.ref }} --generate-notes
7989
env:
8090
GITHUB_TOKEN: ${{ github.TOKEN }}
8191
shell: bash

.vscode/launch.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
5+
{
6+
"name": "Debug Controller",
7+
"type": "go",
8+
"request": "launch",
9+
"mode": "auto",
10+
"program": "${workspaceFolder}/main.go",
11+
"args": [],
12+
"env": {
13+
"KUBECONFIG": "<PATH_TO_KUBECONFIG>"
14+
},
15+
"showLog": true
16+
}
17+
]
18+
}

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ endif
101101

102102
.PHONY: install
103103
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
104-
$(KUSTOMIZE) build config/crd | kubectl apply -f -
104+
$(KUSTOMIZE) build config/default | kubectl apply -f -
105105

106106
.PHONY: uninstall
107107
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
108-
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
108+
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
109109

110110
.PHONY: deploy
111111
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.

config/default/kustomization.yaml

+8-34
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ namePrefix: instascale-1-
1212
#commonLabels:
1313
# someName: someValue
1414

15-
bases:
16-
- ../crd
17-
- ../rbac
18-
- ../manager
15+
# - ../crd
1916
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
2017
# crd/kustomization.yaml
2118
#- ../webhook
@@ -24,11 +21,9 @@ bases:
2421
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2522
#- ../prometheus
2623

27-
patchesStrategicMerge:
2824
# Protect the /metrics endpoint by putting it behind auth.
2925
# If you want your controller-manager to expose the /metrics
3026
# endpoint w/o any authn/z, please comment the following line.
31-
- manager_auth_proxy_patch.yaml
3227

3328
# Mount the controller config file for loading manager configurations
3429
# through a ComponentConfig type
@@ -44,31 +39,10 @@ patchesStrategicMerge:
4439
#- webhookcainjection_patch.yaml
4540

4641
# the following config is for teaching kustomize how to do var substitution
47-
vars:
48-
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
49-
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
50-
# objref:
51-
# kind: Certificate
52-
# group: cert-manager.io
53-
# version: v1
54-
# name: serving-cert # this name should match the one in certificate.yaml
55-
# fieldref:
56-
# fieldpath: metadata.namespace
57-
#- name: CERTIFICATE_NAME
58-
# objref:
59-
# kind: Certificate
60-
# group: cert-manager.io
61-
# version: v1
62-
# name: serving-cert # this name should match the one in certificate.yaml
63-
#- name: SERVICE_NAMESPACE # namespace of the service
64-
# objref:
65-
# kind: Service
66-
# version: v1
67-
# name: webhook-service
68-
# fieldref:
69-
# fieldpath: metadata.namespace
70-
#- name: SERVICE_NAME
71-
# objref:
72-
# kind: Service
73-
# version: v1
74-
# name: webhook-service
42+
apiVersion: kustomize.config.k8s.io/v1beta1
43+
kind: Kustomization
44+
resources:
45+
- ../rbac
46+
- ../manager
47+
patches:
48+
- path: manager_auth_proxy_patch.yaml

config/manager/kustomization.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ generatorOptions:
55
disableNameSuffixHash: true
66

77
configMapGenerator:
8-
- name: manager-config
9-
files:
8+
- files:
109
- controller_manager_config.yaml
10+
name: manager-config
11+
apiVersion: kustomize.config.k8s.io/v1beta1
12+
kind: Kustomization
13+
images:
14+
- name: controller
15+
newName: controller
16+
newTag: latest

go.mod

+21-2
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,33 @@ require (
3333
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
3434
github.com/beorn7/perks v1.0.1 // indirect
3535
github.com/cespare/xxhash/v2 v2.1.2 // indirect
36+
github.com/cilium/ebpf v0.10.0 // indirect
37+
github.com/cosiner/argv v0.1.0 // indirect
38+
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
3639
github.com/davecgh/go-spew v1.1.1 // indirect
40+
github.com/derekparker/trie v0.0.0-20221221181808-1424fce0c981 // indirect
3741
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
3842
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
3943
github.com/fsnotify/fsnotify v1.5.1 // indirect
44+
github.com/go-delve/delve v1.20.2 // indirect
45+
github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect
4046
github.com/go-logr/logr v1.2.0 // indirect
4147
github.com/go-logr/zapr v1.2.0 // indirect
4248
github.com/gogo/protobuf v1.3.2 // indirect
4349
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4450
github.com/golang/protobuf v1.5.2 // indirect
45-
github.com/google/go-cmp v0.5.8 // indirect
51+
github.com/google/go-cmp v0.5.9 // indirect
52+
github.com/google/go-dap v0.9.1 // indirect
4653
github.com/google/gofuzz v1.1.0 // indirect
4754
github.com/google/uuid v1.3.0 // indirect
4855
github.com/googleapis/gnostic v0.5.5 // indirect
56+
github.com/hashicorp/golang-lru v0.5.4 // indirect
4957
github.com/imdario/mergo v0.3.12 // indirect
58+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5059
github.com/json-iterator/go v1.1.12 // indirect
60+
github.com/mattn/go-colorable v0.1.13 // indirect
61+
github.com/mattn/go-isatty v0.0.19 // indirect
62+
github.com/mattn/go-runewidth v0.0.14 // indirect
5163
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
5264
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5365
github.com/modern-go/reflect2 v1.0.2 // indirect
@@ -56,14 +68,21 @@ require (
5668
github.com/prometheus/client_model v0.3.0 // indirect
5769
github.com/prometheus/common v0.37.0 // indirect
5870
github.com/prometheus/procfs v0.8.0 // indirect
71+
github.com/rivo/uniseg v0.4.4 // indirect
72+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
73+
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
74+
github.com/sirupsen/logrus v1.9.3 // indirect
75+
github.com/spf13/cobra v1.7.0 // indirect
5976
github.com/spf13/pflag v1.0.5 // indirect
77+
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
6078
go.uber.org/atomic v1.7.0 // indirect
6179
go.uber.org/multierr v1.6.0 // indirect
6280
go.uber.org/zap v1.19.1 // indirect
81+
golang.org/x/arch v0.3.0 // indirect
6382
golang.org/x/crypto v0.6.0 // indirect
6483
golang.org/x/net v0.7.0 // indirect
6584
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
66-
golang.org/x/sys v0.5.0 // indirect
85+
golang.org/x/sys v0.8.0 // indirect
6786
golang.org/x/term v0.5.0 // indirect
6887
golang.org/x/text v0.7.0 // indirect
6988
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect

0 commit comments

Comments
 (0)