Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crd2 #67

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open

Crd2 #67

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
5b95928
securitycontext updated
Bhargavi-Chilaka Feb 22, 2023
4dbce0c
node version is updated
Bhargavi-Chilaka Feb 22, 2023
afbcd01
node version is updated in circleci
Bhargavi-Chilaka Feb 22, 2023
02809fe
node version is updated in circleci
Bhargavi-Chilaka Feb 22, 2023
125a6ab
node version is updated in circleci
Bhargavi-Chilaka Feb 22, 2023
cccc4b7
docker envs are upadate
Bhargavi-Chilaka Feb 22, 2023
cac2f32
prometheus is disabled
Bhargavi-Chilaka Feb 23, 2023
9eb182d
updated values.yaml
Bhargavi-Chilaka Feb 23, 2023
041b965
dns upadated
Bhargavi-Chilaka Feb 24, 2023
d29e7b8
dns upadated
Bhargavi-Chilaka Feb 24, 2023
cd1ddab
api version updated
Bhargavi-Chilaka Feb 24, 2023
5a83ced
api version updated
Bhargavi-Chilaka Feb 24, 2023
84faccf
Update values.yaml and k8sutil.go
Mar 3, 2023
4f14a24
Version updated
Mar 7, 2023
2382977
Version Updated
Mar 7, 2023
7641071
Image version updated
Bhargavi-Chilaka Mar 10, 2023
fdb0758
namespace changed
Bhargavi-Chilaka Mar 23, 2023
318728a
volume removed
biswazr Mar 27, 2023
68e5ec8
volume removed
biswazr Mar 27, 2023
a9b7b1b
volume removed
biswazr Mar 27, 2023
e1d4bc9
gomod
biswazr Sep 28, 2024
92cf7a3
try1
Sep 28, 2024
5a21153
ty
biswazr Sep 28, 2024
f070d59
mod
Sep 28, 2024
b8db280
h
Sep 28, 2024
57ded0f
ok
biswazr Sep 28, 2024
6ae5770
ci
Sep 28, 2024
e37d2e4
ci
Sep 28, 2024
d23438a
ci
Sep 28, 2024
2ce1d96
ci
Sep 29, 2024
2407005
ci
Sep 29, 2024
5c221c6
test
Sep 29, 2024
59ec5c3
test
Sep 29, 2024
1faafd5
x
Sep 29, 2024
d15d335
x
Sep 29, 2024
f72ec65
v1
Sep 29, 2024
baaf7ca
v1
Sep 29, 2024
7169ced
v1
Sep 29, 2024
0ce8656
v1
Sep 29, 2024
5db7b94
v1
Sep 29, 2024
a6bda3e
v1
Sep 29, 2024
8fd05f0
upgrade
Sep 30, 2024
560b2b9
new validation
Sep 30, 2024
8bb3bbc
new validation
Sep 30, 2024
d2f7d85
new validation
Oct 1, 2024
8ed3a97
new validation
Oct 1, 2024
c565074
new validation
Oct 1, 2024
e85ead9
crd
Oct 1, 2024
e83c08b
code-gen
Oct 1, 2024
daa0649
h
Oct 1, 2024
ab04abb
h
Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ orbs:
jobs:
markdownlint:
docker:
- image: circleci/node:10.14.2
- image: cimg/node:18.14.1
auth:
username: ${DOCKER_USERNAME}
password: ${DOCKER_PASSWORD}
Expand All @@ -47,9 +47,9 @@ jobs:
name: lint README.md
command: markdownlint --config .markdownlint.json README.md
build:
working_directory: /go/src/github.com/objectrocket/sensu-operator
working_directory: go/src/github.com/objectrocket/sensu-operator
docker:
- image: circleci/golang:1.10
- image: cimg/go:1.18
auth:
username: ${DOCKER_USERNAME}
password: ${DOCKER_PASSWORD}
Expand All @@ -61,9 +61,9 @@ jobs:
name: Build the server binary and docker image
command: make docker-build IMAGE_VERSION=latest
unit_test:
working_directory: /go/src/github.com/objectrocket/sensu-operator
working_directory: go/src/github.com/objectrocket/sensu-operator
docker:
- image: circleci/golang:1.10
- image: cimg/go:1.18
auth:
username: ${DOCKER_USERNAME}
password: ${DOCKER_PASSWORD}
Expand All @@ -73,9 +73,9 @@ jobs:
name: go tests
command: make unittest
build_deploy:
working_directory: /go/src/github.com/objectrocket/sensu-operator
working_directory: go/src/github.com/objectrocket/sensu-operator
docker:
- image: circleci/golang:1.10
- image: cimg/go:1.18
auth:
username: ${DOCKER_USERNAME}
password: ${DOCKER_PASSWORD}
Expand All @@ -86,7 +86,7 @@ jobs:
- run:
name: docker login
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- run:
name: docker build and push
command: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# build stage
FROM golang:1.10 AS build-env
FROM golang:1.18 AS build-env
ARG APPVERSION=latest
WORKDIR /go/src/github.com/objectrocket/sensu-operator
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X github.com/objectrocket/sensu-operator/version.Version=$APPVERSION" -o _output/sensu-operator -i cmd/operator/main.go

FROM alpine:3.6
FROM alpine:3.12
ENV USER=sensu-operator
COPY --from=build-env /go/src/github.com/objectrocket/sensu-operator/_output/sensu-operator /usr/local/bin/sensu-operator
RUN apk add --no-cache --update ca-certificates && \
Expand Down
36 changes: 23 additions & 13 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ required = [
version = "kubernetes-1.13.1"

[[constraint]]
version = "kubernetes-1.13.1"
version = "kubernetes-1.16.0"
name = "k8s.io/apiextensions-apiserver"

[[constraint]]
Expand Down
4 changes: 3 additions & 1 deletion cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
// "k8s.io/client-go/kubernetes/typed/coordination/v1"
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
Expand Down Expand Up @@ -163,6 +164,7 @@ func mainLoop() {
namespace,
"sensu-operator",
kubecli.CoreV1(),
kubecli.CoordinationV1(),
resourcelock.ResourceLockConfig{
Identity: id,
EventRecorder: createRecorder(kubecli, name, namespace),
Expand Down Expand Up @@ -241,6 +243,6 @@ func getMyPodServiceAccount(kubecli kubernetes.Interface) (string, error) {
func createRecorder(kubecli kubernetes.Interface, name, namespace string) record.EventRecorder {
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartLogging(logrus.Infof)
eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(kubecli.Core().RESTClient()).Events(namespace)})
eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(kubecli.CoreV1().RESTClient()).Events(namespace)})
return eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: name})
}
2 changes: 1 addition & 1 deletion example/agent-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: extensions/v1
kind: DaemonSet
metadata:
name: sensu-agent
Expand Down
2 changes: 1 addition & 1 deletion example/backup-operator/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: extensions/v1
kind: Deployment
metadata:
name: sensu-backup-operator
Expand Down
12 changes: 10 additions & 2 deletions example/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,28 @@ metadata:
namespace: sensu

---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: sensu-operator
namespace: sensu
spec:
replicas: 1
selector:
matchLabels:
app: sensu-operator
release: sensu-operator
template:
metadata:
labels:
name: sensu-operator
release: sensu-operator
app: sensu-operator
spec:
containers:
- name: sensu-operator
image: objectrocket/sensu-operator:latest
imagePullPolicy: Never
imagePullPolicy: Always
env:
- name: MY_POD_NAMESPACE
valueFrom:
Expand All @@ -49,3 +55,5 @@ spec:
value: "4"
- name: SENSUOP_PROCESSING_RETRIES
value: "5"
imagePullSecrets:
- name: 'or-docker-secret'
2 changes: 1 addition & 1 deletion example/dummy-agent-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: extensions/v1
kind: Deployment
metadata:
name: dummy-service
Expand Down
12 changes: 7 additions & 5 deletions example/example-sensu-cluster-objectrocket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: SensuCluster
metadata:
annotations:
objectrocket.com/scope: clusterwide
name: platdev0
name: sensu
namespace: sensu
spec:
pod:
Expand All @@ -14,7 +14,9 @@ spec:
resources:
requests:
storage: 8Gi
storageClassName: standard
repository: sensu/sensu
size: 1
version: 5.14.0
storageClassName: gp2
repository: objectrocket/sensu-backend
size: 5
version: 5.20.2_or2
clusteradminusername: admin
clusteradminpassword: p@ssw0rd!
2 changes: 1 addition & 1 deletion example/rbac/cluster-role-binding-template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: <ROLE_BINDING_NAME>
Expand Down
2 changes: 1 addition & 1 deletion example/rbac/cluster-role-template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: <ROLE_NAME>
Expand Down
2 changes: 1 addition & 1 deletion example/rbac/role-binding-template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: <ROLE_BINDING_NAME>
Expand Down
2 changes: 1 addition & 1 deletion example/rbac/role-template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: <ROLE_NAME>
Expand Down
2 changes: 1 addition & 1 deletion example/restore-operator/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: extensions/v1
kind: Deployment
metadata:
name: sensu-restore-operator
Expand Down
Loading