Skip to content

Commit

Permalink
Merge pull request #37 from NetApp-Learning-Services/v1beta1
Browse files Browse the repository at this point in the history
Updated go lang dependencies again
  • Loading branch information
cburchett authored Mar 27, 2024
2 parents 6f7ecfd + 7cd8310 commit 3b1447b
Show file tree
Hide file tree
Showing 5 changed files with 446 additions and 36 deletions.
17 changes: 11 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

gatewayv1alpha1 "gateway/api/v1alpha1"
gatewayv1alpha2 "gateway/api/v1alpha2"
Expand Down Expand Up @@ -72,13 +74,16 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Scheme: scheme,
//MetricsBindAddress: metricsAddr,
//Port: 9443, //webhook port
// TODO: THIS CODE IS FOR 0.16.0 version and later
// Metrics: metricsserver.Options{
// BindAddress: metricsAddr,
// },
Port: 9443, //webhook port
Metrics: metricsserver.Options{
BindAddress: metricsAddr,
},
WebhookServer: webhook.NewServer(webhook.Options{
Port: 9443,
}),
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "f2ac972d.netapp.com",
Expand Down
341 changes: 341 additions & 0 deletions config/deploy/v1beta1/gatewayoperator.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: system
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: namespace
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
control-plane: controller-manager
name: gateway-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -1403,3 +1416,331 @@ spec:
storage: true
subresources:
status: {}
---
apiVersion: v1
imagePullSecrets:
- name: gateway-reg-cred-secret
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: controller-manager-sa
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
name: gateway-controller-manager
namespace: gateway-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: role
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
name: gateway-leader-election-role
namespace: gateway-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:
name: gateway-manager-role
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- gateway.netapp.com
resources:
- storagevirtualmachines
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- gateway.netapp.com
resources:
- storagevirtualmachines/finalizers
verbs:
- update
- apiGroups:
- gateway.netapp.com
resources:
- storagevirtualmachines/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: metrics-reader
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
name: gateway-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: proxy-role
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
name: gateway-proxy-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: RoleBinding
metadata:
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: rolebinding
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
name: gateway-leader-election-rolebinding
namespace: gateway-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: gateway-leader-election-role
subjects:
- kind: ServiceAccount
name: gateway-controller-manager
namespace: gateway-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
name: gateway-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: gateway-manager-role
subjects:
- kind: ServiceAccount
name: gateway-controller-manager
namespace: gateway-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: proxy-rolebinding
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
name: gateway-proxy-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: gateway-proxy-role
subjects:
- kind: ServiceAccount
name: gateway-controller-manager
namespace: gateway-system
---
apiVersion: v1
data:
.dockerconfigjson: eyJhdXRocyI6eyJodHRwczovL2RvY2tlci1yZWdpc3RyeTozMDAwMSI6eyJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJOZXRhcHAxISIsImF1dGgiOiJZV1J0YVc0NlRtVjBZWEJ3TVNFPSJ9fX0=
kind: Secret
metadata:
creationTimestamp: null
name: gateway-reg-cred-secret
namespace: gateway-system
type: kubernetes.io/dockerconfigjson
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: service
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
control-plane: controller-manager
name: gateway-controller-manager-metrics-service
namespace: gateway-system
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: https
selector:
control-plane: controller-manager
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: github.com_NetApp-Learning-Services_gateway
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: deployment
app.kubernetes.io/part-of: github.com_NetApp-Learning-Services_gateway
control-plane: controller-manager
name: gateway-controller-manager
namespace: gateway-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:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
command:
- /manager
image: curtisab/gateway:v1beta1
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: gateway-controller-manager
terminationGracePeriodSeconds: 10
Loading

0 comments on commit 3b1447b

Please sign in to comment.