Skip to content

Instantly share code, notes, and snippets.

@barkbay
Created July 1, 2020 06:37
Show Gist options
  • Save barkbay/4a4422022a9d7a453d8ed5482fe4307a to your computer and use it in GitHub Desktop.
Save barkbay/4a4422022a9d7a453d8ed5482fe4307a to your computer and use it in GitHub Desktop.
APM Server 8.0.0
apiVersion: v1
kind: Pod
metadata:
annotations:
k8s.v1.cni.cncf.io/networks-status: |-
[{
"name": "openshift-sdn",
"interface": "eth0",
"ips": [
"10.129.2.61"
],
"dns": {},
"default-route": [
"10.129.2.1"
]
}]
openshift.io/scc: restricted
creationTimestamp: "2020-07-01T06:30:12Z"
generateName: apm-server-quickstart-apm-server-84d9f55c8b-
labels:
apm.k8s.elastic.co/config-files-checksum: 36e108aa34d95af52b90f2e016d0a07672360acc5a26e060b11e628d
apm.k8s.elastic.co/name: apm-server-quickstart
common.k8s.elastic.co/type: apm-server
pod-template-hash: 84d9f55c8b
name: apm-server-quickstart-apm-server-84d9f55c8b-fh4hl
namespace: my-elastic
ownerReferences:
- apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: ReplicaSet
name: apm-server-quickstart-apm-server-84d9f55c8b
uid: 4c244ff2-bcbe-49b0-b54d-d91adb725469
resourceVersion: "2200742"
selfLink: /api/v1/namespaces/my-elastic/pods/apm-server-quickstart-apm-server-84d9f55c8b-fh4hl
uid: 8d104fad-3355-40f6-95d7-9c08c09000ed
spec:
automountServiceAccountToken: false
containers:
- command:
- apm-server
- run
- -e
- -c
- config/config-secret/apm-server.yml
env:
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: SECRET_TOKEN
valueFrom:
secretKeyRef:
key: secret-token
name: apm-server-quickstart-apm-token
image: docker.io/barkbay/apm-server:8.0.0-r2
imagePullPolicy: IfNotPresent
name: apm-server
ports:
- containerPort: 8200
name: https
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8200
scheme: HTTPS
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources:
limits:
memory: 512Mi
requests:
memory: 512Mi
securityContext:
capabilities:
drop:
- KILL
- MKNOD
- SETGID
- SETUID
runAsUser: 1000730000
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /usr/share/apm-server/data
name: apmserver-data
- mountPath: /usr/share/apm-server/config/config-secret
name: config
readOnly: true
- mountPath: /usr/share/apm-server/config
name: config-volume
- mountPath: /usr/share/apm-server/config/elasticsearch-certs
name: elasticsearch-certs
readOnly: true
- mountPath: /mnt/elastic-internal/http-certs
name: elastic-internal-http-certificates
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
imagePullSecrets:
- name: default-dockercfg-4lcdf
initContainers:
- command:
- /usr/bin/env
- bash
- -c
- "#!/usr/bin/env bash\n\nset -eux\n\nkeystore_initialized_flag=/usr/share/apm-server/data/elastic-internal-init-keystore.ok\n\nif
[[ -f \"${keystore_initialized_flag}\" ]]; then\n echo \"Keystore already
initialized.\"\n\texit 0\nfi\n\necho \"Initializing keystore.\"\n\n# create
a keystore in the default data path\n/usr/share/apm-server/apm-server keystore
create --force\n\n# add all existing secret entries into it\nfor filename in
\ /mnt/elastic-internal/secure-settings/*; do\n\t[[ -e \"$filename\" ]] || continue
# glob does not match\n\tkey=$(basename \"$filename\")\n\techo \"Adding \"$key\"
to the keystore.\"\n\t/usr/share/apm-server/apm-server keystore add \"$key\"
--stdin < \"$filename\"\ndone\n\ntouch /usr/share/apm-server/data/elastic-internal-init-keystore.ok\necho
\"Keystore initialization successful.\"\n"
env:
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
image: docker.io/barkbay/apm-server:8.0.0-r2
imagePullPolicy: IfNotPresent
name: elastic-internal-init-keystore
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
securityContext:
capabilities:
drop:
- KILL
- MKNOD
- SETGID
- SETUID
privileged: false
runAsUser: 1000730000
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /mnt/elastic-internal/secure-settings
name: elastic-internal-secure-settings
readOnly: true
- mountPath: /usr/share/apm-server/data
name: apmserver-data
- mountPath: /usr/share/apm-server/config/config-secret
name: config
readOnly: true
- mountPath: /usr/share/apm-server/config
name: config-volume
- mountPath: /usr/share/apm-server/config/elasticsearch-certs
name: elasticsearch-certs
readOnly: true
nodeName: local-snmh4-w-b-8bm8m.c.elastic-cloud-dev.internal
priority: 0
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
fsGroup: 1000730000
seLinuxOptions:
level: s0:c27,c14
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 300
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 300
- effect: NoSchedule
key: node.kubernetes.io/memory-pressure
operator: Exists
volumes:
- emptyDir: {}
name: apmserver-data
- name: config
secret:
defaultMode: 420
optional: false
secretName: apm-server-quickstart-apm-config
- emptyDir: {}
name: config-volume
- name: elastic-internal-secure-settings
secret:
defaultMode: 420
optional: false
secretName: apm-server-quickstart-apm-secure-settings
- name: elasticsearch-certs
secret:
defaultMode: 420
optional: false
secretName: apm-server-quickstart-apm-es-ca
- name: elastic-internal-http-certificates
secret:
defaultMode: 420
optional: false
secretName: apm-server-quickstart-apm-http-certs-internal
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2020-07-01T06:30:23Z"
status: "True"
type: Initialized
- lastProbeTime: null
lastTransitionTime: "2020-07-01T06:30:33Z"
status: "True"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2020-07-01T06:30:33Z"
status: "True"
type: ContainersReady
- lastProbeTime: null
lastTransitionTime: "2020-07-01T06:30:12Z"
status: "True"
type: PodScheduled
containerStatuses:
- containerID: cri-o://0db47abf09058ea6786b2e15af8df7d28cfc195f27182144cda0e8d9723a785f
image: docker.io/barkbay/apm-server:8.0.0-r2
imageID: docker.io/barkbay/apm-server@sha256:953684ccee16373cfe63b792509c481d82d0c1dce18961c0e74a122864762739
lastState: {}
name: apm-server
ready: true
restartCount: 0
started: true
state:
running:
startedAt: "2020-07-01T06:30:23Z"
hostIP: 10.0.32.3
initContainerStatuses:
- containerID: cri-o://dc405d11a4c063a1a5bab1bd2b8242c48d21e5050f99f82249cb3e12441391e2
image: docker.io/barkbay/apm-server:8.0.0-r2
imageID: docker.io/barkbay/apm-server@sha256:953684ccee16373cfe63b792509c481d82d0c1dce18961c0e74a122864762739
lastState: {}
name: elastic-internal-init-keystore
ready: true
restartCount: 0
state:
terminated:
containerID: cri-o://dc405d11a4c063a1a5bab1bd2b8242c48d21e5050f99f82249cb3e12441391e2
exitCode: 0
finishedAt: "2020-07-01T06:30:22Z"
reason: Completed
startedAt: "2020-07-01T06:30:20Z"
phase: Running
podIP: 10.129.2.61
podIPs:
- ip: 10.129.2.61
qosClass: Burstable
startTime: "2020-07-01T06:30:12Z"
---
apiVersion: v1
kind: Namespace
metadata:
name: my-elastic
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: quickstart
namespace: my-elastic
spec:
version: 8.0.0
image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
nodeSets:
- name: default
count: 3
config:
node.store.allow_mmap: false
---
apiVersion: v1
kind: Secret
metadata:
name: apm-secret
stringData:
my.secret: "true"
type: Opaque
---
apiVersion: apm.k8s.elastic.co/v1
kind: ApmServer
metadata:
name: apm-server-quickstart
namespace: my-elastic
spec:
version: 8.0.0
image: docker.io/barkbay/apm-server:8.0.0-r2 # generated according to https://github.com/elastic/beats/pull/18873#issuecomment-649593075
count: 1
elasticsearchRef:
name: quickstart
secureSettings:
- secretName: apm-secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment