Skip to content

Commit

Permalink
Merge branch 'main' into add-liveness-and-readiness-probes-insta
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakis authored Jun 29, 2023
2 parents 0d28729 + 9098de3 commit 22acb43
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 51 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/instascale-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
description: 'Release tag (for example: v0.0.0)'
required: true
default: 'v0.0.0-dev'
mcad-version:
description: 'Published version of multi-cluster-app-dispatcher to be used as a dependency for InstaScale'
description: 'Published version of multi-cluster-app-dispatcher to be used as a dependency for InstaScale (for example: v0.0.0)'
required: true
default: 'v0.0.0-dev'
is-latest:
description: 'Select if the built image should be tagged as latest'
is-stable:
description: 'Select if the built image should be tagged as stable'
required: true
type: boolean
quay-organization:
Expand All @@ -33,6 +31,18 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Verify that release doesn't exist yet
shell: bash {0}
run: |
gh release view ${{ github.event.inputs.tag }}
status=$?
if [[ $status -eq 0 ]]; then
echo "Release ${{ github.event.inputs.tag }} already exists."
exit 1
fi
env:
GITHUB_TOKEN: ${{ github.TOKEN }}

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand All @@ -59,11 +69,11 @@ jobs:
run: |
make image-build -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:${{ github.event.inputs.tag }}
make image-push -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:${{ github.event.inputs.tag }}
- name: Image Push as latest tag
if: ${{ inputs.is-latest }}
- name: Image Push as stable tag
if: ${{ inputs.is-stable }}
run: |
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
make image-push -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:latest
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
make image-push -e IMG=quay.io/${{ github.event.inputs.quay-organization }}/instascale-controller:stable
# Update dependencies
- name: Commit go.mod and go.sum changes back to repository
Expand All @@ -75,7 +85,7 @@ jobs:
# Create a release in InstaScale
- name: Creates a release in GitHub
run: |
gh release create ${{ github.event.inputs.tag }} --generate-notes
gh release create ${{ github.event.inputs.tag }} --target ${{ github.ref }} --generate-notes
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
Expand Down
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [

{
"name": "Debug Controller",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"args": [],
"env": {
"KUBECONFIG": "<PATH_TO_KUBECONFIG>"
},
"showLog": true
}
]
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ endif

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

.PHONY: uninstall
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.
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
Expand Down
42 changes: 8 additions & 34 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ namePrefix: instascale-1-
#commonLabels:
# someName: someValue

bases:
- ../crd
- ../rbac
- ../manager
# - ../crd
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
Expand All @@ -24,11 +21,9 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

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

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

# the following config is for teaching kustomize how to do var substitution
vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
# fieldref:
# fieldpath: metadata.namespace
#- name: CERTIFICATE_NAME
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
#- name: SERVICE_NAMESPACE # namespace of the service
# objref:
# kind: Service
# version: v1
# name: webhook-service
# fieldref:
# fieldpath: metadata.namespace
#- name: SERVICE_NAME
# objref:
# kind: Service
# version: v1
# name: webhook-service
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../rbac
- ../manager
patches:
- path: manager_auth_proxy_patch.yaml
10 changes: 8 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: manager-config
files:
- files:
- controller_manager_config.yaml
name: manager-config
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: controller
newTag: latest
23 changes: 21 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,33 @@ require (
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cilium/ebpf v0.10.0 // indirect
github.com/cosiner/argv v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/derekparker/trie v0.0.0-20221221181808-1424fce0c981 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-delve/delve v1.20.2 // indirect
github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-dap v0.9.1 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand All @@ -56,14 +68,21 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
Expand Down
Loading

0 comments on commit 22acb43

Please sign in to comment.