-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
242 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: aks-periscope-role-binding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: aks-periscope-service-account | ||
roleRef: | ||
kind: ClusterRole | ||
name: aks-periscope-role | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: aks-periscope-role-binding-view | ||
subjects: | ||
- kind: ServiceAccount | ||
name: aks-periscope-service-account | ||
roleRef: | ||
kind: ClusterRole | ||
name: view | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: aks-periscope-role | ||
rules: | ||
- apiGroups: ["","metrics.k8s.io"] | ||
resources: ["pods", "nodes"] | ||
verbs: ["get", "watch", "list"] | ||
- apiGroups: ["aks-periscope.azure.github.com"] | ||
resources: ["diagnostics"] | ||
verbs: ["get", "watch", "list", "create", "patch"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: containerlogs-config | ||
data: | ||
DIAGNOSTIC_CONTAINERLOGS_LIST: kube-system | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: kubeobjects-config | ||
data: | ||
DIAGNOSTIC_KUBEOBJECTS_LIST: kube-system/pod kube-system/service kube-system/deployment | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nodelogs-config | ||
data: | ||
DIAGNOSTIC_NODELOGS_LIST: /var/log/azure/cluster-provision.log /var/log/cloud-init.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: diagnostics.aks-periscope.azure.github.com | ||
spec: | ||
group: aks-periscope.azure.github.com | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true | ||
validation: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
dns: | ||
type: string | ||
networkoutbound: | ||
type: string | ||
scope: Namespaced | ||
names: | ||
plural: diagnostics | ||
singular: diagnostic | ||
kind: Diagnostic | ||
shortNames: | ||
- apd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: aks-periscope | ||
labels: | ||
app: aks-periscope | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: aks-periscope | ||
template: | ||
metadata: | ||
labels: | ||
app: aks-periscope | ||
spec: | ||
serviceAccountName: aks-periscope-service-account | ||
hostPID: true | ||
nodeSelector: | ||
beta.kubernetes.io/os: linux | ||
containers: | ||
- name: aks-periscope | ||
image: aksrepos.azurecr.io/staging/aks-periscope | ||
securityContext: | ||
privileged: true | ||
imagePullPolicy: Always | ||
env: [] | ||
envFrom: | ||
- configMapRef: | ||
name: containerlogs-config | ||
- configMapRef: | ||
name: kubeobjects-config | ||
- configMapRef: | ||
name: nodelogs-config | ||
volumeMounts: | ||
- mountPath: /aks-periscope | ||
name: aks-periscope-storage | ||
resources: | ||
requests: | ||
memory: "500Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "2000Mi" | ||
cpu: "1000m" | ||
volumes: | ||
- name: aks-periscope-storage | ||
hostPath: | ||
path: /var/log/aks-periscope | ||
type: DirectoryOrCreate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- https://github.com/Azure/aks-periscope/blob/master/deployment/kustomization.yaml | ||
|
||
secretGenerator: | ||
- name: azureblob-secret | ||
literals: | ||
- AZURE_BLOB_SAS_KEY=<base 64 encoded value> | ||
|
||
patches: | ||
- target: | ||
group: apps | ||
kind: DaemonSet | ||
name: aks-periscope | ||
version: v1 | ||
patch: |- | ||
- op: add | ||
path: '/spec/template/spec/containers/0/env/-' | ||
value: | ||
name: AZURE_BLOB_ACCOUNT_NAME | ||
value: <name> | ||
- target: | ||
group: apps | ||
kind: DaemonSet | ||
name: aks-periscope | ||
version: v1 | ||
patch: |- | ||
- op: add | ||
path: '/spec/template/spec/containers/0/envFrom/-' | ||
value: | ||
secretRef: | ||
name: azureblob-secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: aks-periscope | ||
|
||
resources: | ||
- namespace.yaml | ||
- cluster-role.yaml | ||
- cluster-role-binding.yaml | ||
- config-map.yaml | ||
- crd.yaml | ||
- daemon-set.yaml | ||
- service-account.yaml | ||
|
||
images: | ||
- name: aksrepos.azurecr.io/staging/aks-periscope | ||
newTag: v0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: aks-periscope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: aks-periscope-service-account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Deploy with Kustomize | ||
|
||
To store the logs an Azure Blob Service account is required. | ||
|
||
Patch the DeamonSet to add the `AZURE_BLOB_ACCOUNT_NAME` env var: | ||
|
||
```yaml | ||
patches: | ||
- target: | ||
group: apps | ||
kind: DaemonSet | ||
name: aks-periscope | ||
version: v1 | ||
patch: |- | ||
- op: add | ||
path: '/spec/template/spec/containers/0/env/-' | ||
value: | ||
name: AZURE_BLOB_ACCOUNT_NAME | ||
value: your_account_name | ||
``` | ||
## Connect to the Storage Account using a SAS key | ||
Create the following secret to connect to the Storage Account using a SAS Key: | ||
```yaml | ||
secretGenerator: | ||
- name: azureblob-secret | ||
literals: | ||
- AZURE_BLOB_SAS_KEY=your_sas_key_base_64_encoded | ||
|
||
patches: | ||
- target: | ||
group: apps | ||
kind: DaemonSet | ||
name: aks-periscope | ||
version: v1 | ||
patch: |- | ||
- op: add | ||
path: '/spec/template/spec/containers/0/envFrom/-' | ||
value: | | ||
secretRef: | ||
name: azureblob-secret | ||
``` | ||
## Apply | ||
```sh | ||
kubectl apply -f <(kustomize build) | ||
``` |