❯ kubectl top pods error: Metrics not available for pod on eks 1.20 - amazon-eks

I am running ❯ kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1
and it is returning an empty resource block
❯ kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1
{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"custom.metrics.k8s.io/v1beta1","resources":[]}
it's on EKS Version 1.20
Prometheus-adapter installed with helm chart: prometheus-adapter-2.5.1
When I run
❯ kubectl top pods
error: Metrics not available for pod monitoring/alertmanager-kube-kube-prometheus-stack-alertmanager-0, age: 446h45m44.145448

Related

Unable to run a react native apps by docker container

I am trying to dockerize react native app but can't do.When i am running docker-compose build command it shows following issues.
error: cannot communicate with server: Post http://localhost/v2/snaps/android-studio: dial unix /run/snapd.socket: connect: no such file or directory
Dockerfile:
FROM ubuntu:20.04
RUN apt update && apt-get install -y curl \
&& curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs
# Install android sdk
RUN apt-get install -y snapd
RUN snap install android-studio
WORKDIR /node
RUN npm install -i -g --force react-native-cli
RUN npm install -g --force react-native
COPY ["package.json", "package-lock.json", "./"]
RUN npm install -f --silent
Compose file:
version: '3.7'
services:
pd_rn:
build:
context: .
command: ["react-native", "start"]
ports:
- 8081:8081
volumes:
- ./:/node

Pandas error when installing on Gitlab runner YAML

I am attempting to deploy a python AWS CDK app through a Gitlab runner automated deploy using a gitlab-ci.yml script. The failure is happening at the synth stage:
cdk-synth:
stage: cdk-synth
cache: []
variables:
CDK_PREFIX: $CDK_PREFIX
tags:
- aws-cdk
image: node:14-alpine
before_script:
- apk add --no-cache python3 py3-pip
- npm install -g aws-cdk#2.15.0
- npm install -g cdk-assume-role-credential-plugin
- python3 -m venv .venv
- source .venv/bin/activate
- pip install --upgrade pip
- pip install -r requirements.txt
script:
- echo $CDK_PREFIX and "$CDK_PREFIX"
- cdk synth
This script was working successfully without error until adding pandas to the requirements.txt file below:
aws-cdk-lib==2.15.0
constructs>=10.0.0,<11.0.0
urllib3==1.26.8
requests==2.27.1
boto3==1.20.51
pandas==1.4.0
The automated deploy pipeline is now failing with an error of:
Collecting pandas==1.4.0
Downloading pandas-1.4.0.tar.gz (4.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.9/4.9 MB 93.8 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
error: subprocess-exited-with-error
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
I have attempted re-aligning the versions and updating pip without success. A google search suggests there is a dependency issue with the 'crypptography' package but does not suggest a clear fix besides uninstalling and re-installing pip which did not correct the issue.

how to build centos 8 singularity container from recipe

tried:
BootStrap: yum
MirrorURL: http://mirror.centos.org/centos-8/8.3.2011/centosplus/x86_64/os/
Include: yum
singularity build --sandbox centos8 centos8.def
INFO: Starting build...
INFO: Skipping GPG Key Import
Error: Nothing to do
FATAL: While performing build: conveyor failed to get: while bootstrapping: exit status 1
no idea what the problem is
Thanks!
If you don't need to use yum as the bootstrap, you can easily build it from docker
sudo singularity build --sandbox centos8.sif docker://centos:8.3.2011
You do not need docker installed to use it as a bootstrap method, it just tells singularity to pull the blobs from docker hub rather than building them itself.

Unable to install Free Lets Encrypt SSL on AWS EC2

Im unable to install free lets encrypt SSL on AWS EC2 new instance for a domain.
[ec2-user#ip-XXX-XX-XX-XXX ~]$ wget https://dl.eff.org/certbot-auto
[ec2-user#ip-XXX-XX-XX-XXX ~]$ chmod a+x certbot-auto
[ec2-user#ip-XXX-XX-XX-XXX ~]$ sudo ./certbot-auto --debug -v --server https://acme-v02.api.letsencrypt.org/directory certonly -d domainname.com
Error showing like this -
Skipping bootstrap because certbot-auto is deprecated on this system.
Your system is not supported by certbot-auto anymore.
Certbot cannot be installed.
Please visit https://certbot.eff.org/ to check for other alternatives.
Here is the server details
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2018.03
cpe:/o:amazon:linux:2018.03:ga```
Pls help how to install and use?

Cannot install cocoapods 0.29

I successfully install cocoapods 0.29, and after attempting to run pod setup, it claims I must install 0.29.
Can someone please explain this to me??
Successfully installed cocoapods-0.29.0
Parsing documentation for cocoapods-0.29.0
1 gem installed
bash-3.2$ pod setup
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 -
Update CocoaPods, or checkout the appropriate tag in the repo.
UPDATE:
After updating cocoapods, I am able to run pod setup, however still getting some error about 0.29 not being installed: (And also, when running pod --version, it says I'm on 0.22.3???)
bash-3.2$ sudo gem update cocoapods
Updating installed gems
Nothing to update
bash-3.2$ sudo pod setup
Setting up CocoaPods master repo
Already up-to-date.
Setup completed (read-only access)
bash-3.2$ pod install
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 -
Update CocoaPods, or checkout the appropriate tag in the repo.
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide/command.rb:210:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
bash-3.2$ pod --version
0.22.3
navigate this file and delete it
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide
then open ur terminal add this
sudo gem update
its worked for me 100%
Based on your comment
$ type -a pod
pod is /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
pod is /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod
pod is /usr/bin/pod
it appears you have multiple installations of Cocoapods: one with gem install cocoapods in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod and another with sudo gem install cocoapods in /usr/bin/pod (I don't know what /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod is).
So running gem install cocoapods should fix the problem by updating the install in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod.
I'd recommend cleaning up your install though by removing either the global (with sudo) one or the local (without sudo) one.
EDIT:
Here's my Jenkins install:
Installed Cocoapods with gem install cocoapods.
Running type -a pod yield:
$ type -a pod
pod is /Users/Shared/Jenkins/Home/gems/bin/pod
In the Jenkins global config, I added the following environment variables:
GEM_HOME = $JENKINS_HOME/gems
GEM_PATH = $JENKINS_HOME/gems:/usr/lib/ruby/gems/1.8/
PATH = $PATH:$HOME/gems/bin
I added a "Shell script" build step to each project with:
POD_PROJECT_DIRECTORY='MyProject' # Directory where the Podfile is. Probably the same as Xcode plugin's "Xcode Project Directory".
cd "$WORKSPACE/$POD_PROJECT_DIRECTORY"
# rm -rf ./Pods # Uncomment this line if you want to re-download all the Pods each time
pod install --no-color
I found the mismatch of version reported by 'pod --version' and what I was seeing when I updated to be mystifying. Then I realized I had more than one ruby installed on my machine. I changed my $PATH so that the ruby I needed to use came first (e.g. /usr/local/opt/ruby/bin):
In a new shell I found that 'pod --version' started reporting the '0.29.0' version I wanted.