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

Add install manifests #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p dist
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default > dist/install.yaml
$(KUSTOMIZE) build config/default > config/manifests/install.yaml

##@ Deployment

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ make build-installer IMG=<some-registry>/etcd-operator:tag
```

NOTE: The makefile target mentioned above generates an 'install.yaml'
file in the dist directory. This file contains all the resources built
file in the `config/manifests` directory. This file contains all the resources built
with Kustomize, which are necessary to install this project without
its dependencies.

Expand All @@ -101,7 +101,7 @@ its dependencies.
Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project, i.e.:

```sh
kubectl apply -f https://raw.githubusercontent.com/<org>/etcd-operator/<tag or branch>/dist/install.yaml
kubectl apply -f https://raw.githubusercontent.com/<org>/etcd-operator/<tag or branch>/config/manifests/install.yaml
```

## Contributing
Expand Down
6 changes: 6 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: controller
newTag: latest
351 changes: 351 additions & 0 deletions config/manifests/install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
control-plane: controller-manager
name: etcd-operator-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
name: etcdclusters.operator.etcd.io
spec:
group: operator.etcd.io
names:
kind: EtcdCluster
listKind: EtcdClusterList
plural: etcdclusters
singular: etcdcluster
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: EtcdCluster is the Schema for the etcdclusters API.
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
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
type: string
metadata:
type: object
spec:
description: EtcdClusterSpec defines the desired state of EtcdCluster.
properties:
size:
description: Size is the expected size of the etcd cluster.
type: integer
version:
description: Version is the expected version of the etcd container
image.
type: string
required:
- size
- version
type: object
status:
description: EtcdClusterStatus defines the observed state of EtcdCluster.
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
name: etcd-operator-controller-manager
namespace: etcd-operator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
name: etcd-operator-leader-election-role
namespace: etcd-operator-system
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
name: etcd-operator-etcdcluster-editor-role
rules:
- apiGroups:
- operator.etcd.io
resources:
- etcdclusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- operator.etcd.io
resources:
- etcdclusters/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
name: etcd-operator-etcdcluster-viewer-role
rules:
- apiGroups:
- operator.etcd.io
resources:
- etcdclusters
verbs:
- get
- list
- watch
- apiGroups:
- operator.etcd.io
resources:
- etcdclusters/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: etcd-operator-manager-role
rules:
- apiGroups:
- operator.etcd.io
resources:
- etcdclusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- operator.etcd.io
resources:
- etcdclusters/finalizers
verbs:
- update
- apiGroups:
- operator.etcd.io
resources:
- etcdclusters/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: etcd-operator-metrics-auth-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: etcd-operator-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
name: etcd-operator-leader-election-rolebinding
namespace: etcd-operator-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: etcd-operator-leader-election-role
subjects:
- kind: ServiceAccount
name: etcd-operator-controller-manager
namespace: etcd-operator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
name: etcd-operator-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: etcd-operator-manager-role
subjects:
- kind: ServiceAccount
name: etcd-operator-controller-manager
namespace: etcd-operator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: etcd-operator-metrics-auth-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: etcd-operator-metrics-auth-role
subjects:
- kind: ServiceAccount
name: etcd-operator-controller-manager
namespace: etcd-operator-system
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
control-plane: controller-manager
name: etcd-operator-controller-manager-metrics-service
namespace: etcd-operator-system
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: 8443
selector:
control-plane: controller-manager
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: etcd-operator
control-plane: controller-manager
name: etcd-operator-controller-manager
namespace: etcd-operator-system
spec:
replicas: 1
selector:
matchLabels:
control-plane: controller-manager
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
spec:
containers:
- args:
- --metrics-bind-address=:8443
- --leader-elect
- --health-probe-bind-address=:8081
command:
- /manager
image: controller:latest
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
securityContext:
runAsNonRoot: true
serviceAccountName: etcd-operator-controller-manager
terminationGracePeriodSeconds: 10