Skip to content

Commit a73ae42

Browse files
authored
Add shortname lws for API & sort out build image command (#30)
* Build image based on git hash Signed-off-by: kerthcet <[email protected]> * Reduce the resource requests for local testing Signed-off-by: kerthcet <[email protected]> * Add short name lws for leaderWorkerSet Signed-off-by: kerthcet <[email protected]> --------- Signed-off-by: kerthcet <[email protected]>
1 parent 15148a8 commit a73ae42

File tree

7 files changed

+16
-17350
lines changed

7 files changed

+16
-17350
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.dylib
88
bin
99
testbin/*
10+
artifacts
1011
.DS_Store
1112
# Test binary, build with `go test -c`
1213
*.test

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Image URL to use all building/pushing image targets
2-
IMG ?= controller:latest
31
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
42
ENVTEST_K8S_VERSION = 1.28.3
53

@@ -16,6 +14,13 @@ endif
1614
# tools. (i.e. podman)
1715
CONTAINER_TOOL ?= docker
1816

17+
GIT_TAG ?= $(shell git describe --tags --dirty --always)
18+
# Image URL to use all building/pushing image targets
19+
IMAGE_REGISTRY ?= gcr.io/k8s-staging-lws
20+
IMAGE_NAME := lws
21+
IMAGE_REPO := $(IMAGE_REGISTRY)/$(IMAGE_NAME)
22+
IMG ?= $(IMAGE_REPO):$(GIT_TAG)
23+
1924
# Setting SHELL to bash allows bash commands to be executed by recipes.
2025
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
2126
SHELL = /usr/bin/env bash -o pipefail

api/leaderworkerset/v1/leaderworkerset_types.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ const (
145145
// +genclient
146146
//+kubebuilder:object:root=true
147147
//+kubebuilder:subresource:status
148+
//+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.hpaPodSelector
149+
//+kubebuilder:resource:shortName={lws}
148150

149151
// LeaderWorkerSet is the Schema for the leaderworkersets API
150-
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.hpaPodSelector
151152
type LeaderWorkerSet struct {
152153
metav1.TypeMeta `json:",inline"`
153154
metav1.ObjectMeta `json:"metadata,omitempty"`

artifacts/manifests.yaml

-17,343
This file was deleted.

config/crd/bases/leaderworkerset.x-k8s.io_leaderworkersets.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
kind: LeaderWorkerSet
1212
listKind: LeaderWorkerSetList
1313
plural: leaderworkersets
14+
shortNames:
15+
- lws
1416
singular: leaderworkerset
1517
scope: Namespaced
1618
versions:

config/manager/kustomization.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: controller
8-
newTag: latest
7+
newName: gcr.io/k8s-staging-lws/lws
8+
newTag: main

config/manager/manager.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ spec:
9393
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
9494
resources:
9595
requests:
96-
cpu: 2
97-
memory: 2Gi
96+
cpu: 1
97+
memory: 1Gi
9898
serviceAccountName: controller-manager
9999
terminationGracePeriodSeconds: 10

0 commit comments

Comments
 (0)