Skip to content

Commit

Permalink
Merge pull request #1115 from equinor/master
Browse files Browse the repository at this point in the history
release operator
  • Loading branch information
satr authored May 10, 2024
2 parents 01baef6 + ce71593 commit 2181d90
Show file tree
Hide file tree
Showing 174 changed files with 3,506 additions and 3,167 deletions.
64 changes: 44 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ CONTAINER_REPO ?= radix$(ENVIRONMENT)
DOCKER_REGISTRY ?= $(CONTAINER_REPO).azurecr.io
APP_ALIAS_BASE_URL = app.$(DNS_ZONE)

KUBE_CODEGEN_VERSION = v0.25.3

HASH := $(shell git rev-parse HEAD)

CLUSTER_NAME = $(shell kubectl config get-contexts | grep '*' | tr -s ' ' | cut -f 3 -d ' ')
Expand All @@ -68,25 +70,12 @@ echo:
@echo "VERSION : " $(VERSION)
@echo "TAG : " $(TAG)

# find or download controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@{ \
set -e ;\
go install sigs.k8s.io/controller-tools/cmd/[email protected] ;\
}
CONTROLLER_GEN=${GOPATH}/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif

.PHONY: test
test:
LOG_LEVEL=warn go test -cover `go list ./... | grep -v 'pkg/client'`

.PHONY: mocks
mocks:
mocks: bootstrap
mockgen -source ./pkg/apis/defaults/oauth2.go -destination ./pkg/apis/defaults/oauth2_mock.go -package defaults
mockgen -source ./pkg/apis/deployment/deploymentfactory.go -destination ./pkg/apis/deployment/deploymentfactory_mock.go -package deployment
mockgen -source ./pkg/apis/deployment/deployment.go -destination ./pkg/apis/deployment/deployment_mock.go -package deployment
Expand Down Expand Up @@ -129,8 +118,13 @@ CUSTOM_RESOURCE_NAME=radix
CUSTOM_RESOURCE_VERSION=v1

.PHONY: code-gen
code-gen:
$(GOPATH)/pkg/mod/k8s.io/[email protected]/generate-groups.sh all $(ROOT_PACKAGE)/pkg/client $(ROOT_PACKAGE)/pkg/apis $(CUSTOM_RESOURCE_NAME):$(CUSTOM_RESOURCE_VERSION) --go-header-file $(GOPATH)/pkg/mod/k8s.io/[email protected]/hack/boilerplate.go.txt
code-gen: bootstrap
echo
$$(go env GOPATH)/pkg/mod/k8s.io/code-generator@$(KUBE_CODEGEN_VERSION)/generate-groups.sh all \
$(ROOT_PACKAGE)/pkg/client \
$(ROOT_PACKAGE)/pkg/apis \
$(CUSTOM_RESOURCE_NAME):$(CUSTOM_RESOURCE_VERSION) \
--go-header-file hack/boilerplate.txt

.PHONY: crds
crds: temp-crds radixapplication-crd radixbatch-crd radixdnsalias-crd delete-temp-crds
Expand All @@ -149,16 +143,46 @@ radixdnsalias-crd: temp-crds
cp $(CRD_TEMP_DIR)radix.equinor.com_radixdnsaliases.yaml $(CRD_CHART_DIR)radixdnsalias.yaml

.PHONY: temp-crds
temp-crds: controller-gen
echo "tempcrdrun"
${CONTROLLER_GEN} crd:crdVersions=v1 paths=./pkg/apis/radix/v1/ output:dir:=$(CRD_TEMP_DIR)
temp-crds: bootstrap
controller-gen crd:crdVersions=v1 paths=./pkg/apis/radix/v1/ output:dir:=$(CRD_TEMP_DIR)

.PHONY: delete-temp-crds
delete-temp-crds:
rm -rf $(CRD_TEMP_DIR)

.PHONY: lint
lint:
lint: bootstrap
golangci-lint run

.PHONY: generate
generate: bootstrap code-gen crds mocks

.PHONY: verify-generate
verify-generate: bootstrap generate
git diff --exit-code

HAS_SWAGGER := $(shell command -v swagger;)
HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;)
HAS_MOCKGEN := $(shell command -v mockgen;)
HAS_CONTROLLER_GEN := $(shell command -v controller-gen;)
HAS_GENERATE_GROUPS := $(shell command -v $$(go env GOPATH)/pkg/mod/k8s.io/code-generator@$(KUBE_CODEGEN_VERSION)/generate-groups.sh)

.PHONY: bootstrap
bootstrap:
ifndef HAS_SWAGGER
go install github.com/go-swagger/go-swagger/cmd/[email protected]
endif
ifndef HAS_GOLANGCI_LINT
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.55.2
endif
ifndef HAS_MOCKGEN
go install github.com/golang/mock/[email protected]
endif
ifndef HAS_CONTROLLER_GEN
go install sigs.k8s.io/controller-tools/cmd/[email protected]
endif
ifndef HAS_GENERATE_GROUPS
-go install k8s.io/code-generator@$(KUBE_CODEGEN_VERSION)
chmod +x $$(go env GOPATH)/pkg/mod/k8s.io/code-generator@$(KUBE_CODEGEN_VERSION)/generate-groups.sh
chmod +x $$(go env GOPATH)/pkg/mod/k8s.io/code-generator@$(KUBE_CODEGEN_VERSION)/generate-internal-groups.sh
endif
4 changes: 2 additions & 2 deletions charts/radix-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: radix-operator
version: 1.32.3
appVersion: 1.52.3
version: 1.33.0
appVersion: 1.53.0
kubeVersion: ">=1.24.0"
description: Radix Operator
keywords:
Expand Down
1,231 changes: 657 additions & 574 deletions charts/radix-operator/templates/radixapplication.yaml

Large diffs are not rendered by default.

109 changes: 63 additions & 46 deletions charts/radix-operator/templates/radixbatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.15.0
name: radixbatches.radix.equinor.com
spec:
group: radix.equinor.com
Expand Down Expand Up @@ -33,14 +32,19 @@ spec:
description: RadixBatch enables batch execution of Radix job components.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand All @@ -59,8 +63,11 @@ spec:
minimum: 0
type: integer
imageTagName:
description: "ImageTagName defines the image tag name to use
for the job image \n required: false"
description: |-
ImageTagName defines the image tag name to use for the job image
required: false
type: string
jobId:
description: Defines a user defined ID of the job.
Expand All @@ -70,13 +77,14 @@ spec:
maxLength: 63
type: string
node:
description: Specifies node attributes, where container should
be scheduled. Overrides node configuration defined for job
component in RadixDeployment.
description: |-
Specifies node attributes, where container should be scheduled.
Overrides node configuration defined for job component in RadixDeployment.
properties:
gpu:
description: 'Defines rules for allowed GPU types. More
info: https://www.radix.equinor.com/references/reference-radix-config/#gpu'
description: |-
Defines rules for allowed GPU types.
More info: https://www.radix.equinor.com/references/reference-radix-config/#gpu
type: string
gpuCount:
description: Defines minimum number of required GPUs.
Expand All @@ -90,16 +98,19 @@ spec:
description: The key of the secret to select from.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
maxLength: 253
type: string
required:
- key
- name
type: object
resources:
description: Specifies compute resource requirements. Overrides
resource configuration defined for job component in RadixDeployment.
description: |-
Specifies compute resource requirements.
Overrides resource configuration defined for job component in RadixDeployment.
properties:
limits:
additionalProperties:
Expand All @@ -110,27 +121,30 @@ spec:
requests:
additionalProperties:
type: string
description: Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified,
otherwise to an implementation-defined value.
description: |-
Requests describes the minimum amount of compute resources required.
If Requests is omitted for a container, it defaults to Limits if
that is explicitly specified, otherwise to an implementation-defined value.
type: object
type: object
restart:
description: Controls if a job should be restarted. If Restart
is set to new timestamp, and - the job is stopped - the job
is started again. - the job is running - the job is stopped
and started again. This timestamp set to the job's status.restart.
description: |-
Controls if a job should be restarted.
If Restart is set to new timestamp, and
- the job is stopped - the job is started again.
- the job is running - the job is stopped and started again.
This timestamp set to the job's status.restart.
type: string
stop:
description: Controls if a job should be stopped. If Stop is
set to true, the underlying Kubernetes Job is deleted. A job
that is stopped cannot be started again by setting Stop to
false.
description: |-
Controls if a job should be stopped.
If Stop is set to true, the underlying Kubernetes Job is deleted.
A job that is stopped cannot be started again by setting Stop to false.
type: boolean
timeLimitSeconds:
description: Specifies maximum job run time. Overrides timeLimitSeconds
defined for job component in RadixDeployment.
description: |-
Specifies maximum job run time.
Overrides timeLimitSeconds defined for job component in RadixDeployment.
format: int64
minimum: 1
type: integer
Expand All @@ -151,7 +165,9 @@ spec:
description: The job name of the RadixDeployment to select.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
maxLength: 253
type: string
required:
Expand Down Expand Up @@ -205,12 +221,12 @@ spec:
format: date-time
type: string
endTime:
description: 'The time at which the batch job ended. The value
is set when phase is either Succeeded, Failed or Stopped.
description: |-
The time at which the batch job ended.
The value is set when phase is either Succeeded, Failed or Stopped.
- Succeeded: Value from CompletionTime of the Kubernetes job.
- Failed: Value from LastTransitionTime of the Failed condition
of the Kubernetes job. - Stopped: The timestamp a job with
Stop=true was reonciled.'
- Failed: Value from LastTransitionTime of the Failed condition of the Kubernetes job.
- Stopped: The timestamp a job with Stop=true was reonciled.
format: date-time
type: string
failed:
Expand Down Expand Up @@ -257,16 +273,17 @@ spec:
format: int32
type: integer
image:
description: 'The name of container image that the container
is running. The container image may not match the image
used in the PodSpec, as it may have been resolved by
the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.'
description: |-
The name of container image that the container is running.
The container image may not match the image used in the PodSpec,
as it may have been resolved by the runtime.
More info: https://kubernetes.io/docs/concepts/containers/images.
type: string
imageID:
description: The image ID of the container's image. The
image ID may not match the image ID of the image used
in the PodSpec, as it may have been resolved by the
runtime.
description: |-
The image ID of the container's image. The image ID may not
match the image ID of the image used in the PodSpec, as it may have been
resolved by the runtime.
type: string
message:
description: A human-readable message indicating details
Expand Down
20 changes: 12 additions & 8 deletions charts/radix-operator/templates/radixdnsalias.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.15.0
name: radixdnsaliases.radix.equinor.com
spec:
group: radix.equinor.com
Expand Down Expand Up @@ -33,14 +32,19 @@ spec:
description: RadixDNSAlias is a Custom Resource Definition
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down
15 changes: 15 additions & 0 deletions hack/boilerplate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

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.
*/
5 changes: 0 additions & 5 deletions hack/codegen.sh

This file was deleted.

Loading

0 comments on commit 2181d90

Please sign in to comment.