mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-05-06 17:26:51 +00:00
* update version from 3.2.0 to 4.0.0 * update deployment files Co-authored-by: Robert Brennan <contact@rbren.io>
271 lines
5.5 KiB
YAML
271 lines
5.5 KiB
YAML
---
|
|
# Source: polaris/templates/0-namespace.yaml
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: polaris
|
|
---
|
|
# Source: polaris/templates/serviceaccount.yaml
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: polaris
|
|
namespace: polaris
|
|
labels:
|
|
app: polaris
|
|
---
|
|
# Source: polaris/templates/rbac.yaml
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: polaris
|
|
labels:
|
|
app: polaris
|
|
rules:
|
|
# required by controller-runtime code doing a cluster wide lookup
|
|
# when it seems namespace would suffice
|
|
- apiGroups:
|
|
- ''
|
|
resources:
|
|
- 'nodes'
|
|
verbs:
|
|
- 'get'
|
|
- 'list'
|
|
- apiGroups:
|
|
- 'monitoring.coreos.com'
|
|
resources:
|
|
- 'prometheuses'
|
|
- 'alertmanagers'
|
|
verbs:
|
|
- 'get'
|
|
- 'list'
|
|
---
|
|
# Source: polaris/templates/rbac.yaml
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: polaris-view
|
|
labels:
|
|
app: polaris
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: view
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: polaris
|
|
namespace: polaris
|
|
---
|
|
# Source: polaris/templates/rbac.yaml
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: polaris
|
|
labels:
|
|
app: polaris
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: polaris
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: polaris
|
|
namespace: polaris
|
|
---
|
|
# Source: polaris/templates/webhook.service.yaml
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: polaris-webhook
|
|
namespace: polaris
|
|
labels:
|
|
app: polaris
|
|
spec:
|
|
ports:
|
|
- name: webhook
|
|
port: 443
|
|
protocol: TCP
|
|
targetPort: 9876
|
|
selector:
|
|
app: polaris
|
|
component: webhook
|
|
type: ClusterIP
|
|
---
|
|
# Source: polaris/templates/webhook.deployment.yaml
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: polaris-webhook
|
|
namespace: polaris
|
|
labels:
|
|
app: polaris
|
|
component: webhook
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: polaris
|
|
component: webhook
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: polaris
|
|
component: webhook
|
|
spec:
|
|
containers:
|
|
- name: webhook
|
|
command:
|
|
- polaris
|
|
- webhook
|
|
image: 'quay.io/fairwinds/polaris:4.0'
|
|
imagePullPolicy: 'Always'
|
|
ports:
|
|
- containerPort: 9876
|
|
# These are fairly useless readiness/liveness probes for now
|
|
# Follow this issue for potential improvements:
|
|
# https://github.com/kubernetes-sigs/controller-runtime/issues/356
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- ps -ef | grep polaris
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- ps -ef | grep polaris
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
resources:
|
|
limits:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
requests:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
privileged: false
|
|
readOnlyRootFilesystem: true
|
|
runAsNonRoot: true
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
volumeMounts:
|
|
- name: secret
|
|
mountPath: /opt/cert/
|
|
readOnly: true
|
|
- name: cr-logs
|
|
mountPath: /tmp/
|
|
readOnly: false
|
|
serviceAccountName: polaris
|
|
nodeSelector:
|
|
tolerations:
|
|
volumes:
|
|
- name: secret
|
|
secret:
|
|
secretName: polaris
|
|
- name: cr-logs
|
|
emptyDir: {}
|
|
---
|
|
# Source: polaris/templates/webhook.cert.yaml
|
|
apiVersion: cert-manager.io/v1alpha2
|
|
kind: Certificate
|
|
metadata:
|
|
name: polaris-cert
|
|
namespace: polaris
|
|
labels:
|
|
app: polaris
|
|
spec:
|
|
commonName: polaris-webhook.polaris.svc
|
|
dnsNames:
|
|
- polaris-webhook.polaris.svc
|
|
- polaris-webhook.polaris
|
|
- polaris-webhook
|
|
- polaris-webhook.polaris.svc.
|
|
issuerRef:
|
|
kind: Issuer
|
|
name: polaris-selfsigned
|
|
secretName: polaris
|
|
---
|
|
# Source: polaris/templates/webhook.cert.yaml
|
|
apiVersion: cert-manager.io/v1alpha2
|
|
kind: Issuer
|
|
metadata:
|
|
name: polaris-selfsigned
|
|
namespace: polaris
|
|
spec:
|
|
selfSigned: {}
|
|
---
|
|
# Source: polaris/templates/webhook.configuration.yaml
|
|
apiVersion: admissionregistration.k8s.io/v1beta1
|
|
kind: ValidatingWebhookConfiguration
|
|
metadata:
|
|
name: polaris-webhook
|
|
annotations:
|
|
cert-manager.io/inject-ca-from: polaris/polaris-cert
|
|
webhooks:
|
|
- admissionReviewVersions:
|
|
- v1beta1
|
|
clientConfig:
|
|
service:
|
|
name: polaris-webhook
|
|
namespace: polaris
|
|
path: /validate
|
|
port: 443
|
|
failurePolicy: Fail
|
|
matchPolicy: Exact
|
|
name: polaris.fairwinds.com
|
|
namespaceSelector:
|
|
|
|
matchExpressions:
|
|
- key: control-plane
|
|
operator: DoesNotExist
|
|
objectSelector:
|
|
|
|
{}
|
|
rules:
|
|
- apiGroups:
|
|
- apps
|
|
apiVersions:
|
|
- v1
|
|
- v1beta1
|
|
- v1beta2
|
|
operations:
|
|
- CREATE
|
|
- UPDATE
|
|
resources:
|
|
- daemonsets
|
|
- deployments
|
|
- statefulsets
|
|
scope: Namespaced
|
|
- apiGroups:
|
|
- batch
|
|
apiVersions:
|
|
- v1
|
|
- v1beta1
|
|
operations:
|
|
- CREATE
|
|
- UPDATE
|
|
resources:
|
|
- jobs
|
|
- cronjobs
|
|
scope: Namespaced
|
|
- apiGroups:
|
|
- ""
|
|
apiVersions:
|
|
- v1
|
|
operations:
|
|
- CREATE
|
|
- UPDATE
|
|
resources:
|
|
- pods
|
|
- replicationcontrollers
|
|
scope: Namespaced
|
|
sideEffects: None
|
|
timeoutSeconds: 10
|