Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated docs for Windows Kubernetes (#73)
* new release note and readme * change docs and added windows k8s deploy yaml
- Loading branch information
Showing
7 changed files
with
129 additions
and
9 deletions.
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
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,51 @@ | ||
## How to use the Kubernetes yaml files for Windows Server | ||
|
||
In this folder, we have 2 yaml files. | ||
- OMS Agent deployment yaml file which uses secrets (ws-omsagent-de-secrets.yaml) with secret generation scripts which generates the secrets yaml (omsagentsecret.yaml). | ||
|
||
### With Secret | ||
1. To use OMS Agent Daemon-set using Secrets, create the secrets first. | ||
|
||
- Copy the script and secret template file and make sure they are on the same directory. | ||
- secret generating script - secret-gen.sh | ||
- secret template - secret-template.yaml | ||
- Run the script. The script will ask for the OMS Workspace ID and Primary Key. Please insert that and the script will create a secret yaml file so you can run it. | ||
|
||
``` | ||
#> sudo bash ./secret-gen.sh | ||
``` | ||
|
||
- Create the secrets pod by running the following: | ||
``` kubectl create -f omsagentsecret.yaml ``` | ||
|
||
- To check, run the following: | ||
|
||
``` | ||
root@ubuntu16-13db:~# kubectl get secrets | ||
NAME TYPE DATA AGE | ||
default-token-gvl91 kubernetes.io/service-account-token 3 50d | ||
omsagent-secret Opaque 2 1d | ||
root@ubuntu16-13db:~# kubectl describe secrets omsagent-secret | ||
Name: omsagent-secret | ||
Namespace: default | ||
Labels: <none> | ||
Annotations: <none> | ||
Type: Opaque | ||
Data | ||
==== | ||
WSID: 36 bytes | ||
KEY: 88 bytes | ||
``` | ||
- Create your omsagent daemon-set by running ``` kubectl create -f ws-omsagent-de-secrets.yaml ``` | ||
|
||
2. Check to see whether the OMS Agent deployment is running fine. | ||
``` | ||
root@ubuntu16-13db:~# kubectl get deployment omsagent | ||
NAME DESIRED CURRENT NODE-SELECTOR AGE | ||
omsagent 1 1 <none> 1h | ||
``` | ||
|
||
|
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,13 @@ | ||
#!/bin/sh | ||
|
||
echo "Enter OMS Workspace ID" | ||
read WORKSPACE_ID | ||
echo "Enter OMS Primary Key" | ||
read SHARED_KEY | ||
|
||
WSID_BASE64_ENC=$(echo $WORKSPACE_ID | base64 | tr -d '\n') | ||
KEY_BASE64_ENC=$(echo $SHARED_KEY | base64 | tr -d '\n') | ||
sed -e "s#{{wsid_data}}#${WSID_BASE64_ENC}#g" -e "s#{{key_data}}#${KEY_BASE64_ENC}#g" ./secret-template.yaml > omsagentsecret.yaml | ||
#sed -e "s#{{key_data}}#${KEY_BASE64_ENC}#g" ./secret-template.yaml > secret.yaml | ||
|
||
echo "Task completed! secret.yaml file created." |
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,8 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: omsagent-secret | ||
type: Opaque | ||
data: | ||
WSID: {{wsid_data}} | ||
KEY: {{key_data}} |
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,51 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: omsagent | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: omsagent | ||
agentVersion: 1.4.1-45 | ||
dockerProviderVersion: 10.0.0-27 | ||
spec: | ||
containers: | ||
- name: omsagent | ||
image: "microsoft/oms" | ||
imagePullPolicy: Always | ||
securityContext: | ||
privileged: true | ||
ports: | ||
- containerPort: 25225 | ||
protocol: TCP | ||
- containerPort: 25224 | ||
protocol: UDP | ||
volumeMounts: | ||
- mountPath: /var/run/docker.sock | ||
name: docker-sock | ||
- mountPath: /var/log | ||
name: host-log | ||
- mountPath: /etc/omsagent-secret | ||
name: omsagent-secret | ||
readOnly: true | ||
livenessProbe: | ||
exec: | ||
command: | ||
- /bin/bash | ||
- -c | ||
- ps -ef | grep omsagent | grep -v "grep" | ||
initialDelaySeconds: 60 | ||
periodSeconds: 60 | ||
volumes: | ||
- name: docker-sock | ||
hostPath: | ||
path: /var/run/docker.sock | ||
- name: host-log | ||
hostPath: | ||
path: /var/log | ||
- name: omsagent-secret | ||
secret: | ||
secretName: omsagent-secret | ||
nodeSelector: | ||
role: master |
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