Skip to content

Commit

Permalink
fix(control-plane): Updated kubernetes manifest files
Browse files Browse the repository at this point in the history
  • Loading branch information
isala404 committed Feb 15, 2022
1 parent d4b5588 commit 3361804
Show file tree
Hide file tree
Showing 22 changed files with 115 additions and 315 deletions.
2 changes: 1 addition & 1 deletion control-plane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=lazy-koala crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
58 changes: 1 addition & 57 deletions control-plane/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace: lazy-koala
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: lazy-koala-
# namePrefix: operator-

# Labels to add to all resources and selectors.
#commonLabels:
Expand All @@ -16,59 +16,3 @@ bases:
- ../crd
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
# [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
#- manager_config_patch.yaml

# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml

# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
#- 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
34 changes: 0 additions & 34 deletions control-plane/config/default/manager_auth_proxy_patch.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions control-plane/config/default/manager_config_patch.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions control-plane/config/manager/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: gazer-config
namespace: lazy-koala
data:
config.yaml: |
11 changes: 0 additions & 11 deletions control-plane/config/manager/controller_manager_config.yaml

This file was deleted.

11 changes: 7 additions & 4 deletions control-plane/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
resources:
- manager.yaml
- configmap.yaml

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: manager-config
files:
- controller_manager_config.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: ghcr.io/mrsupiri/lazy-koala/controller
newTag: latest
74 changes: 37 additions & 37 deletions control-plane/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,59 @@ apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: system
control-plane: lazy-koala
name: lazy-koala
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
name: lazy-koala-operator
namespace: lazy-koala
labels:
control-plane: controller-manager
control-plane: lazy-koala
spec:
selector:
matchLabels:
control-plane: controller-manager
control-plane: lazy-koala
replicas: 1
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
control-plane: lazy-koala
spec:
securityContext:
runAsNonRoot: true
containers:
- command:
- /manager
args:
- --leader-elect
image: controller:latest
name: manager
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
# TODO(user): Configure the resources accordingly based on the project requirements.
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: controller-manager
- command:
- /manager
# args:
# - --leader-elect
image: controller:latest
name: manager
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
# TODO(user): Configure the resources accordingly based on the project requirements.
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: lazy-koala
terminationGracePeriodSeconds: 10
2 changes: 0 additions & 2 deletions control-plane/config/prometheus/kustomization.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions control-plane/config/prometheus/monitor.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions control-plane/config/rbac/auth_proxy_client_clusterrole.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions control-plane/config/rbac/auth_proxy_role.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions control-plane/config/rbac/auth_proxy_role_binding.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions control-plane/config/rbac/auth_proxy_service.yaml

This file was deleted.

25 changes: 8 additions & 17 deletions control-plane/config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
resources:
# All RBAC will be applied under this service account in
# the deployment namespace. You may comment out this resource
# if your manager will use a service account that exists at
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
# subjects if changing service account names.
- service_account.yaml
- role.yaml
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
# All RBAC will be applied under this service account in
# the deployment namespace. You may comment out this resource
# if your manager will use a service account that exists at
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
# subjects if changing service account names.
- service_account.yaml
- role.yaml
- role_binding.yaml
Loading

0 comments on commit 3361804

Please sign in to comment.